Better integration between Babel and `C-c C-c'
[org-mode/org-tableheadings.git] / lisp / org-entities.el
blobdcab7d722085a99cfd2e0cef14bfb9efda7a1da1
1 ;;; org-entities.el --- Support for Special Entities -*- lexical-binding: t; -*-
3 ;; Copyright (C) 2010-2016 Free Software Foundation, Inc.
5 ;; Author: Carsten Dominik <carsten at orgmode dot org>,
6 ;; Ulf Stegemann <ulf at zeitform dot de>
7 ;; Keywords: outlines, calendar, wp
8 ;; Homepage: http://orgmode.org
9 ;;
10 ;; This file is part of GNU Emacs.
12 ;; GNU Emacs is free software: you can redistribute it and/or modify
13 ;; it under the terms of the GNU General Public License as published by
14 ;; the Free Software Foundation, either version 3 of the License, or
15 ;; (at your option) any later version.
17 ;; GNU Emacs is distributed in the hope that it will be useful,
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ;; GNU General Public License for more details.
22 ;; You should have received a copy of the GNU General Public License
23 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
24 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
26 ;;; Commentary:
28 ;;; Code:
30 (declare-function org-toggle-pretty-entities "org" ())
31 (declare-function org-table-align "org-table" ())
33 (defgroup org-entities nil
34 "Options concerning entities in Org mode."
35 :tag "Org Entities"
36 :group 'org)
38 (defun org-entities--user-safe-p (v)
39 "Non-nil if V is a safe value for `org-entities-user'."
40 (pcase v
41 (`nil t)
42 (`(,(and (pred stringp)
43 (pred (string-match-p "\\`[a-zA-Z][a-zA-Z0-9]*\\'")))
44 ,(pred stringp) ,(pred booleanp) ,(pred stringp)
45 ,(pred stringp) ,(pred stringp) ,(pred stringp))
47 (_ nil)))
49 (defcustom org-entities-user nil
50 "User-defined entities used in Org to produce special characters.
51 Each entry in this list is a list of strings. It associates the name
52 of the entity that can be inserted into an Org file as \\name with the
53 appropriate replacements for the different export backends. The order
54 of the fields is the following
56 name As a string, without the leading backslash.
57 LaTeX replacement In ready LaTeX, no further processing will take place.
58 LaTeX mathp Either t or nil. When t this entity needs to be in
59 math mode.
60 HTML replacement In ready HTML, no further processing will take place.
61 Usually this will be an &...; entity.
62 ASCII replacement Plain ASCII, no extensions.
63 Latin1 replacement Use the special characters available in latin1.
64 utf-8 replacement Use the special characters available in utf-8.
66 If you define new entities here that require specific LaTeX
67 packages to be loaded, add these packages to `org-latex-packages-alist'."
68 :group 'org-entities
69 :version "24.1"
70 :type '(repeat
71 (list
72 (string :tag "name ")
73 (string :tag "LaTeX ")
74 (boolean :tag "Require LaTeX math?")
75 (string :tag "HTML ")
76 (string :tag "ASCII ")
77 (string :tag "Latin1")
78 (string :tag "utf-8 ")))
79 :safe #'org-entities--user-safe-p)
81 (defconst org-entities
82 (append
83 '("* Letters"
84 "** Latin"
85 ("Agrave" "\\`{A}" nil "&Agrave;" "A" "À" "À")
86 ("agrave" "\\`{a}" nil "&agrave;" "a" "à" "à")
87 ("Aacute" "\\'{A}" nil "&Aacute;" "A" "Á" "Á")
88 ("aacute" "\\'{a}" nil "&aacute;" "a" "á" "á")
89 ("Acirc" "\\^{A}" nil "&Acirc;" "A" "Â" "Â")
90 ("acirc" "\\^{a}" nil "&acirc;" "a" "â" "â")
91 ("Atilde" "\\~{A}" nil "&Atilde;" "A" "Ã" "Ã")
92 ("atilde" "\\~{a}" nil "&atilde;" "a" "ã" "ã")
93 ("Auml" "\\\"{A}" nil "&Auml;" "Ae" "Ä" "Ä")
94 ("auml" "\\\"{a}" nil "&auml;" "ae" "ä" "ä")
95 ("Aring" "\\AA{}" nil "&Aring;" "A" "Å" "Å")
96 ("AA" "\\AA{}" nil "&Aring;" "A" "Å" "Å")
97 ("aring" "\\aa{}" nil "&aring;" "a" "å" "å")
98 ("AElig" "\\AE{}" nil "&AElig;" "AE" "Æ" "Æ")
99 ("aelig" "\\ae{}" nil "&aelig;" "ae" "æ" "æ")
100 ("Ccedil" "\\c{C}" nil "&Ccedil;" "C" "Ç" "Ç")
101 ("ccedil" "\\c{c}" nil "&ccedil;" "c" "ç" "ç")
102 ("Egrave" "\\`{E}" nil "&Egrave;" "E" "È" "È")
103 ("egrave" "\\`{e}" nil "&egrave;" "e" "è" "è")
104 ("Eacute" "\\'{E}" nil "&Eacute;" "E" "É" "É")
105 ("eacute" "\\'{e}" nil "&eacute;" "e" "é" "é")
106 ("Ecirc" "\\^{E}" nil "&Ecirc;" "E" "Ê" "Ê")
107 ("ecirc" "\\^{e}" nil "&ecirc;" "e" "ê" "ê")
108 ("Euml" "\\\"{E}" nil "&Euml;" "E" "Ë" "Ë")
109 ("euml" "\\\"{e}" nil "&euml;" "e" "ë" "ë")
110 ("Igrave" "\\`{I}" nil "&Igrave;" "I" "Ì" "Ì")
111 ("igrave" "\\`{i}" nil "&igrave;" "i" "ì" "ì")
112 ("Iacute" "\\'{I}" nil "&Iacute;" "I" "Í" "Í")
113 ("iacute" "\\'{i}" nil "&iacute;" "i" "í" "í")
114 ("Icirc" "\\^{I}" nil "&Icirc;" "I" "Î" "Î")
115 ("icirc" "\\^{i}" nil "&icirc;" "i" "î" "î")
116 ("Iuml" "\\\"{I}" nil "&Iuml;" "I" "Ï" "Ï")
117 ("iuml" "\\\"{i}" nil "&iuml;" "i" "ï" "ï")
118 ("Ntilde" "\\~{N}" nil "&Ntilde;" "N" "Ñ" "Ñ")
119 ("ntilde" "\\~{n}" nil "&ntilde;" "n" "ñ" "ñ")
120 ("Ograve" "\\`{O}" nil "&Ograve;" "O" "Ò" "Ò")
121 ("ograve" "\\`{o}" nil "&ograve;" "o" "ò" "ò")
122 ("Oacute" "\\'{O}" nil "&Oacute;" "O" "Ó" "Ó")
123 ("oacute" "\\'{o}" nil "&oacute;" "o" "ó" "ó")
124 ("Ocirc" "\\^{O}" nil "&Ocirc;" "O" "Ô" "Ô")
125 ("ocirc" "\\^{o}" nil "&ocirc;" "o" "ô" "ô")
126 ("Otilde" "\\~{O}" nil "&Otilde;" "O" "Õ" "Õ")
127 ("otilde" "\\~{o}" nil "&otilde;" "o" "õ" "õ")
128 ("Ouml" "\\\"{O}" nil "&Ouml;" "Oe" "Ö" "Ö")
129 ("ouml" "\\\"{o}" nil "&ouml;" "oe" "ö" "ö")
130 ("Oslash" "\\O" nil "&Oslash;" "O" "Ø" "Ø")
131 ("oslash" "\\o{}" nil "&oslash;" "o" "ø" "ø")
132 ("OElig" "\\OE{}" nil "&OElig;" "OE" "OE" "Œ")
133 ("oelig" "\\oe{}" nil "&oelig;" "oe" "oe" "œ")
134 ("Scaron" "\\v{S}" nil "&Scaron;" "S" "S" "Š")
135 ("scaron" "\\v{s}" nil "&scaron;" "s" "s" "š")
136 ("szlig" "\\ss{}" nil "&szlig;" "ss" "ß" "ß")
137 ("Ugrave" "\\`{U}" nil "&Ugrave;" "U" "Ù" "Ù")
138 ("ugrave" "\\`{u}" nil "&ugrave;" "u" "ù" "ù")
139 ("Uacute" "\\'{U}" nil "&Uacute;" "U" "Ú" "Ú")
140 ("uacute" "\\'{u}" nil "&uacute;" "u" "ú" "ú")
141 ("Ucirc" "\\^{U}" nil "&Ucirc;" "U" "Û" "Û")
142 ("ucirc" "\\^{u}" nil "&ucirc;" "u" "û" "û")
143 ("Uuml" "\\\"{U}" nil "&Uuml;" "Ue" "Ü" "Ü")
144 ("uuml" "\\\"{u}" nil "&uuml;" "ue" "ü" "ü")
145 ("Yacute" "\\'{Y}" nil "&Yacute;" "Y" "Ý" "Ý")
146 ("yacute" "\\'{y}" nil "&yacute;" "y" "ý" "ý")
147 ("Yuml" "\\\"{Y}" nil "&Yuml;" "Y" "Y" "Ÿ")
148 ("yuml" "\\\"{y}" nil "&yuml;" "y" "ÿ" "ÿ")
150 "** Latin (special face)"
151 ("fnof" "\\textit{f}" nil "&fnof;" "f" "f" "ƒ")
152 ("real" "\\Re" t "&real;" "R" "R" "ℜ")
153 ("image" "\\Im" t "&image;" "I" "I" "ℑ")
154 ("weierp" "\\wp" t "&weierp;" "P" "P" "℘")
155 ("ell" "\\ell" t "&ell;" "ell" "ell" "ℓ")
156 ("imath" "\\imath" t "&imath;" "[dotless i]" "dotless i" "ı")
157 ("jmath" "\\jmath" t "&jmath;" "[dotless j]" "dotless j" "ȷ")
159 "** Greek"
160 ("Alpha" "A" nil "&Alpha;" "Alpha" "Alpha" "Α")
161 ("alpha" "\\alpha" t "&alpha;" "alpha" "alpha" "α")
162 ("Beta" "B" nil "&Beta;" "Beta" "Beta" "Β")
163 ("beta" "\\beta" t "&beta;" "beta" "beta" "β")
164 ("Gamma" "\\Gamma" t "&Gamma;" "Gamma" "Gamma" "Γ")
165 ("gamma" "\\gamma" t "&gamma;" "gamma" "gamma" "γ")
166 ("Delta" "\\Delta" t "&Delta;" "Delta" "Delta" "Δ")
167 ("delta" "\\delta" t "&delta;" "delta" "delta" "δ")
168 ("Epsilon" "E" nil "&Epsilon;" "Epsilon" "Epsilon" "Ε")
169 ("epsilon" "\\epsilon" t "&epsilon;" "epsilon" "epsilon" "ε")
170 ("varepsilon" "\\varepsilon" t "&epsilon;" "varepsilon" "varepsilon" "ε")
171 ("Zeta" "Z" nil "&Zeta;" "Zeta" "Zeta" "Ζ")
172 ("zeta" "\\zeta" t "&zeta;" "zeta" "zeta" "ζ")
173 ("Eta" "H" nil "&Eta;" "Eta" "Eta" "Η")
174 ("eta" "\\eta" t "&eta;" "eta" "eta" "η")
175 ("Theta" "\\Theta" t "&Theta;" "Theta" "Theta" "Θ")
176 ("theta" "\\theta" t "&theta;" "theta" "theta" "θ")
177 ("thetasym" "\\vartheta" t "&thetasym;" "theta" "theta" "ϑ")
178 ("vartheta" "\\vartheta" t "&thetasym;" "theta" "theta" "ϑ")
179 ("Iota" "I" nil "&Iota;" "Iota" "Iota" "Ι")
180 ("iota" "\\iota" t "&iota;" "iota" "iota" "ι")
181 ("Kappa" "K" nil "&Kappa;" "Kappa" "Kappa" "Κ")
182 ("kappa" "\\kappa" t "&kappa;" "kappa" "kappa" "κ")
183 ("Lambda" "\\Lambda" t "&Lambda;" "Lambda" "Lambda" "Λ")
184 ("lambda" "\\lambda" t "&lambda;" "lambda" "lambda" "λ")
185 ("Mu" "M" nil "&Mu;" "Mu" "Mu" "Μ")
186 ("mu" "\\mu" t "&mu;" "mu" "mu" "μ")
187 ("nu" "\\nu" t "&nu;" "nu" "nu" "ν")
188 ("Nu" "N" nil "&Nu;" "Nu" "Nu" "Ν")
189 ("Xi" "\\Xi" t "&Xi;" "Xi" "Xi" "Ξ")
190 ("xi" "\\xi" t "&xi;" "xi" "xi" "ξ")
191 ("Omicron" "O" nil "&Omicron;" "Omicron" "Omicron" "Ο")
192 ("omicron" "\\textit{o}" nil "&omicron;" "omicron" "omicron" "ο")
193 ("Pi" "\\Pi" t "&Pi;" "Pi" "Pi" "Π")
194 ("pi" "\\pi" t "&pi;" "pi" "pi" "π")
195 ("Rho" "P" nil "&Rho;" "Rho" "Rho" "Ρ")
196 ("rho" "\\rho" t "&rho;" "rho" "rho" "ρ")
197 ("Sigma" "\\Sigma" t "&Sigma;" "Sigma" "Sigma" "Σ")
198 ("sigma" "\\sigma" t "&sigma;" "sigma" "sigma" "σ")
199 ("sigmaf" "\\varsigma" t "&sigmaf;" "sigmaf" "sigmaf" "ς")
200 ("varsigma" "\\varsigma" t "&sigmaf;" "varsigma" "varsigma" "ς")
201 ("Tau" "T" nil "&Tau;" "Tau" "Tau" "Τ")
202 ("Upsilon" "\\Upsilon" t "&Upsilon;" "Upsilon" "Upsilon" "Υ")
203 ("upsih" "\\Upsilon" t "&upsih;" "upsilon" "upsilon" "ϒ")
204 ("upsilon" "\\upsilon" t "&upsilon;" "upsilon" "upsilon" "υ")
205 ("Phi" "\\Phi" t "&Phi;" "Phi" "Phi" "Φ")
206 ("phi" "\\phi" t "&phi;" "phi" "phi" "ɸ")
207 ("varphi" "\\varphi" t "&varphi;" "varphi" "varphi" "φ")
208 ("Chi" "X" nil "&Chi;" "Chi" "Chi" "Χ")
209 ("chi" "\\chi" t "&chi;" "chi" "chi" "χ")
210 ("acutex" "\\acute x" t "&acute;x" "'x" "'x" "𝑥́")
211 ("Psi" "\\Psi" t "&Psi;" "Psi" "Psi" "Ψ")
212 ("psi" "\\psi" t "&psi;" "psi" "psi" "ψ")
213 ("tau" "\\tau" t "&tau;" "tau" "tau" "τ")
214 ("Omega" "\\Omega" t "&Omega;" "Omega" "Omega" "Ω")
215 ("omega" "\\omega" t "&omega;" "omega" "omega" "ω")
216 ("piv" "\\varpi" t "&piv;" "omega-pi" "omega-pi" "ϖ")
217 ("varpi" "\\varpi" t "&piv;" "omega-pi" "omega-pi" "ϖ")
218 ("partial" "\\partial" t "&part;" "[partial differential]" "[partial differential]" "∂")
220 "** Hebrew"
221 ("alefsym" "\\aleph" t "&alefsym;" "aleph" "aleph" "ℵ")
222 ("aleph" "\\aleph" t "&aleph;" "aleph" "aleph" "ℵ")
223 ("gimel" "\\gimel" t "&gimel;" "gimel" "gimel" "ℷ")
224 ("beth" "\\beth" t "&beth;" "beth" "beth" "ב")
225 ("dalet" "\\daleth" t "&daleth;" "dalet" "dalet" "ד")
227 "** Dead languages"
228 ("ETH" "\\DH{}" nil "&ETH;" "D" "Ð" "Ð")
229 ("eth" "\\dh{}" nil "&eth;" "dh" "ð" "ð")
230 ("THORN" "\\TH{}" nil "&THORN;" "TH" "Þ" "Þ")
231 ("thorn" "\\th{}" nil "&thorn;" "th" "þ" "þ")
233 "* Punctuation"
234 "** Dots and Marks"
235 ("dots" "\\dots{}" nil "&hellip;" "..." "..." "…")
236 ("cdots" "\\cdots{}" t "&ctdot;" "..." "..." "⋯")
237 ("hellip" "\\dots{}" nil "&hellip;" "..." "..." "…")
238 ("middot" "\\textperiodcentered{}" nil "&middot;" "." "·" "·")
239 ("iexcl" "!`" nil "&iexcl;" "!" "¡" "¡")
240 ("iquest" "?`" nil "&iquest;" "?" "¿" "¿")
242 "** Dash-like"
243 ("shy" "\\-" nil "&shy;" "" "" "")
244 ("ndash" "--" nil "&ndash;" "-" "-" "–")
245 ("mdash" "---" nil "&mdash;" "--" "--" "—")
247 "** Quotations"
248 ("quot" "\\textquotedbl{}" nil "&quot;" "\"" "\"" "\"")
249 ("acute" "\\textasciiacute{}" nil "&acute;" "'" "´" "´")
250 ("ldquo" "\\textquotedblleft{}" nil "&ldquo;" "\"" "\"" "“")
251 ("rdquo" "\\textquotedblright{}" nil "&rdquo;" "\"" "\"" "”")
252 ("bdquo" "\\quotedblbase{}" nil "&bdquo;" "\"" "\"" "„")
253 ("lsquo" "\\textquoteleft{}" nil "&lsquo;" "`" "`" "‘")
254 ("rsquo" "\\textquoteright{}" nil "&rsquo;" "'" "'" "’")
255 ("sbquo" "\\quotesinglbase{}" nil "&sbquo;" "," "," "‚")
256 ("laquo" "\\guillemotleft{}" nil "&laquo;" "<<" "«" "«")
257 ("raquo" "\\guillemotright{}" nil "&raquo;" ">>" "»" "»")
258 ("lsaquo" "\\guilsinglleft{}" nil "&lsaquo;" "<" "<" "‹")
259 ("rsaquo" "\\guilsinglright{}" nil "&rsaquo;" ">" ">" "›")
261 "* Other"
262 "** Misc. (often used)"
263 ("circ" "\\^{}" nil "&circ;" "^" "^" "∘")
264 ("vert" "\\vert{}" t "&vert;" "|" "|" "|")
265 ("vbar" "|" nil "|" "|" "|" "|")
266 ("brvbar" "\\textbrokenbar{}" nil "&brvbar;" "|" "¦" "¦")
267 ("S" "\\S" nil "&sect;" "paragraph" "§" "§")
268 ("sect" "\\S" nil "&sect;" "paragraph" "§" "§")
269 ("amp" "\\&" nil "&amp;" "&" "&" "&")
270 ("lt" "\\textless{}" nil "&lt;" "<" "<" "<")
271 ("gt" "\\textgreater{}" nil "&gt;" ">" ">" ">")
272 ("tilde" "\\textasciitilde{}" nil "~" "~" "~" "~")
273 ("slash" "/" nil "/" "/" "/" "/")
274 ("plus" "+" nil "+" "+" "+" "+")
275 ("under" "\\_" nil "_" "_" "_" "_")
276 ("equal" "=" nil "=" "=" "=" "=")
277 ("asciicirc" "\\textasciicircum{}" nil "^" "^" "^" "^")
278 ("dagger" "\\textdagger{}" nil "&dagger;" "[dagger]" "[dagger]" "†")
279 ("dag" "\\dag{}" nil "&dagger;" "[dagger]" "[dagger]" "†")
280 ("Dagger" "\\textdaggerdbl{}" nil "&Dagger;" "[doubledagger]" "[doubledagger]" "‡")
281 ("ddag" "\\ddag{}" nil "&Dagger;" "[doubledagger]" "[doubledagger]" "‡")
283 "** Whitespace"
284 ("nbsp" "~" nil "&nbsp;" " " "\x00A0" "\x00A0")
285 ("ensp" "\\hspace*{.5em}" nil "&ensp;" " " " " " ")
286 ("emsp" "\\hspace*{1em}" nil "&emsp;" " " " " " ")
287 ("thinsp" "\\hspace*{.2em}" nil "&thinsp;" " " " " " ")
289 "** Currency"
290 ("curren" "\\textcurrency{}" nil "&curren;" "curr." "¤" "¤")
291 ("cent" "\\textcent{}" nil "&cent;" "cent" "¢" "¢")
292 ("pound" "\\pounds{}" nil "&pound;" "pound" "£" "£")
293 ("yen" "\\textyen{}" nil "&yen;" "yen" "¥" "¥")
294 ("euro" "\\texteuro{}" nil "&euro;" "EUR" "EUR" "€")
295 ("EUR" "\\texteuro{}" nil "&euro;" "EUR" "EUR" "€")
297 "** Property Marks"
298 ("copy" "\\textcopyright{}" nil "&copy;" "(c)" "©" "©")
299 ("reg" "\\textregistered{}" nil "&reg;" "(r)" "®" "®")
300 ("trade" "\\texttrademark{}" nil "&trade;" "TM" "TM" "™")
302 "** Science et al."
303 ("minus" "\\minus" t "&minus;" "-" "-" "−")
304 ("pm" "\\textpm{}" nil "&plusmn;" "+-" "±" "±")
305 ("plusmn" "\\textpm{}" nil "&plusmn;" "+-" "±" "±")
306 ("times" "\\texttimes{}" nil "&times;" "*" "×" "×")
307 ("frasl" "/" nil "&frasl;" "/" "/" "⁄")
308 ("colon" "\\colon" t ":" ":" ":" ":")
309 ("div" "\\textdiv{}" nil "&divide;" "/" "÷" "÷")
310 ("frac12" "\\textonehalf{}" nil "&frac12;" "1/2" "½" "½")
311 ("frac14" "\\textonequarter{}" nil "&frac14;" "1/4" "¼" "¼")
312 ("frac34" "\\textthreequarters{}" nil "&frac34;" "3/4" "¾" "¾")
313 ("permil" "\\textperthousand{}" nil "&permil;" "per thousand" "per thousand" "‰")
314 ("sup1" "\\textonesuperior{}" nil "&sup1;" "^1" "¹" "¹")
315 ("sup2" "\\texttwosuperior{}" nil "&sup2;" "^2" "²" "²")
316 ("sup3" "\\textthreesuperior{}" nil "&sup3;" "^3" "³" "³")
317 ("radic" "\\sqrt{\\,}" t "&radic;" "[square root]" "[square root]" "√")
318 ("sum" "\\sum" t "&sum;" "[sum]" "[sum]" "∑")
319 ("prod" "\\prod" t "&prod;" "[product]" "[n-ary product]" "∏")
320 ("micro" "\\textmu{}" nil "&micro;" "micro" "µ" "µ")
321 ("macr" "\\textasciimacron{}" nil "&macr;" "[macron]" "¯" "¯")
322 ("deg" "\\textdegree{}" nil "&deg;" "degree" "°" "°")
323 ("prime" "\\prime" t "&prime;" "'" "'" "′")
324 ("Prime" "\\prime{}\\prime" t "&Prime;" "''" "''" "″")
325 ("infin" "\\infty" t "&infin;" "[infinity]" "[infinity]" "∞")
326 ("infty" "\\infty" t "&infin;" "[infinity]" "[infinity]" "∞")
327 ("prop" "\\propto" t "&prop;" "[proportional to]" "[proportional to]" "∝")
328 ("propto" "\\propto" t "&prop;" "[proportional to]" "[proportional to]" "∝")
329 ("not" "\\textlnot{}" nil "&not;" "[angled dash]" "¬" "¬")
330 ("neg" "\\neg{}" t "&not;" "[angled dash]" "¬" "¬")
331 ("land" "\\land" t "&and;" "[logical and]" "[logical and]" "∧")
332 ("wedge" "\\wedge" t "&and;" "[logical and]" "[logical and]" "∧")
333 ("lor" "\\lor" t "&or;" "[logical or]" "[logical or]" "∨")
334 ("vee" "\\vee" t "&or;" "[logical or]" "[logical or]" "∨")
335 ("cap" "\\cap" t "&cap;" "[intersection]" "[intersection]" "∩")
336 ("cup" "\\cup" t "&cup;" "[union]" "[union]" "∪")
337 ("smile" "\\smile" t "&smile;" "[cup product]" "[cup product]" "⌣")
338 ("frown" "\\frown" t "&frown;" "[Cap product]" "[cap product]" "⌢")
339 ("int" "\\int" t "&int;" "[integral]" "[integral]" "∫")
340 ("therefore" "\\therefore" t "&there4;" "[therefore]" "[therefore]" "∴")
341 ("there4" "\\therefore" t "&there4;" "[therefore]" "[therefore]" "∴")
342 ("because" "\\because" t "&because;" "[because]" "[because]" "∵")
343 ("sim" "\\sim" t "&sim;" "~" "~" "∼")
344 ("cong" "\\cong" t "&cong;" "[approx. equal to]" "[approx. equal to]" "≅")
345 ("simeq" "\\simeq" t "&cong;" "[approx. equal to]" "[approx. equal to]" "≅")
346 ("asymp" "\\asymp" t "&asymp;" "[almost equal to]" "[almost equal to]" "≈")
347 ("approx" "\\approx" t "&asymp;" "[almost equal to]" "[almost equal to]" "≈")
348 ("ne" "\\ne" t "&ne;" "[not equal to]" "[not equal to]" "≠")
349 ("neq" "\\neq" t "&ne;" "[not equal to]" "[not equal to]" "≠")
350 ("equiv" "\\equiv" t "&equiv;" "[identical to]" "[identical to]" "≡")
352 ("triangleq" "\\triangleq" t "&triangleq;" "[defined to]" "[defined to]" "≜")
353 ("le" "\\le" t "&le;" "<=" "<=" "≤")
354 ("leq" "\\le" t "&le;" "<=" "<=" "≤")
355 ("ge" "\\ge" t "&ge;" ">=" ">=" "≥")
356 ("geq" "\\ge" t "&ge;" ">=" ">=" "≥")
357 ("lessgtr" "\\lessgtr" t "&lessgtr;" "[less than or greater than]" "[less than or greater than]" "≶")
358 ("lesseqgtr" "\\lesseqgtr" t "&lesseqgtr;" "[less than or equal or greater than or equal]" "[less than or equal or greater than or equal]" "⋚")
359 ("ll" "\\ll" t "&Lt;" "<<" "<<" "≪")
360 ("Ll" "\\lll" t "&Ll;" "<<<" "<<<" "⋘")
361 ("lll" "\\lll" t "&Ll;" "<<<" "<<<" "⋘")
362 ("gg" "\\gg" t "&Gt;" ">>" ">>" "≫")
363 ("Gg" "\\ggg" t "&Gg;" ">>>" ">>>" "⋙")
364 ("ggg" "\\ggg" t "&Gg;" ">>>" ">>>" "⋙")
365 ("prec" "\\prec" t "&pr;" "[precedes]" "[precedes]" "≺")
366 ("preceq" "\\preceq" t "&prcue;" "[precedes or equal]" "[precedes or equal]" "≼")
367 ("preccurlyeq" "\\preccurlyeq" t "&prcue;" "[precedes or equal]" "[precedes or equal]" "≼")
368 ("succ" "\\succ" t "&sc;" "[succeeds]" "[succeeds]" "≻")
369 ("succeq" "\\succeq" t "&sccue;" "[succeeds or equal]" "[succeeds or equal]" "≽")
370 ("succcurlyeq" "\\succcurlyeq" t "&sccue;" "[succeeds or equal]" "[succeeds or equal]" "≽")
371 ("sub" "\\subset" t "&sub;" "[subset of]" "[subset of]" "⊂")
372 ("subset" "\\subset" t "&sub;" "[subset of]" "[subset of]" "⊂")
373 ("sup" "\\supset" t "&sup;" "[superset of]" "[superset of]" "⊃")
374 ("supset" "\\supset" t "&sup;" "[superset of]" "[superset of]" "⊃")
375 ("nsub" "\\not\\subset" t "&nsub;" "[not a subset of]" "[not a subset of" "⊄")
376 ("sube" "\\subseteq" t "&sube;" "[subset of or equal to]" "[subset of or equal to]" "⊆")
377 ("nsup" "\\not\\supset" t "&nsup;" "[not a superset of]" "[not a superset of]" "⊅")
378 ("supe" "\\supseteq" t "&supe;" "[superset of or equal to]" "[superset of or equal to]" "⊇")
379 ("setminus" "\\setminus" t "&setminus;" "\" "\" "⧵")
380 ("forall" "\\forall" t "&forall;" "[for all]" "[for all]" "∀")
381 ("exist" "\\exists" t "&exist;" "[there exists]" "[there exists]" "∃")
382 ("exists" "\\exists" t "&exist;" "[there exists]" "[there exists]" "∃")
383 ("nexist" "\\nexists" t "&exist;" "[there does not exists]" "[there does not exists]" "∄")
384 ("nexists" "\\nexists" t "&exist;" "[there does not exists]" "[there does not exists]" "∄")
385 ("empty" "\\empty" t "&empty;" "[empty set]" "[empty set]" "∅")
386 ("emptyset" "\\emptyset" t "&empty;" "[empty set]" "[empty set]" "∅")
387 ("isin" "\\in" t "&isin;" "[element of]" "[element of]" "∈")
388 ("in" "\\in" t "&isin;" "[element of]" "[element of]" "∈")
389 ("notin" "\\notin" t "&notin;" "[not an element of]" "[not an element of]" "∉")
390 ("ni" "\\ni" t "&ni;" "[contains as member]" "[contains as member]" "∋")
391 ("nabla" "\\nabla" t "&nabla;" "[nabla]" "[nabla]" "∇")
392 ("ang" "\\angle" t "&ang;" "[angle]" "[angle]" "∠")
393 ("angle" "\\angle" t "&ang;" "[angle]" "[angle]" "∠")
394 ("perp" "\\perp" t "&perp;" "[up tack]" "[up tack]" "⊥")
395 ("parallel" "\\parallel" t "&parallel;" "||" "||" "∥")
396 ("sdot" "\\cdot" t "&sdot;" "[dot]" "[dot]" "⋅")
397 ("cdot" "\\cdot" t "&sdot;" "[dot]" "[dot]" "⋅")
398 ("lceil" "\\lceil" t "&lceil;" "[left ceiling]" "[left ceiling]" "⌈")
399 ("rceil" "\\rceil" t "&rceil;" "[right ceiling]" "[right ceiling]" "⌉")
400 ("lfloor" "\\lfloor" t "&lfloor;" "[left floor]" "[left floor]" "⌊")
401 ("rfloor" "\\rfloor" t "&rfloor;" "[right floor]" "[right floor]" "⌋")
402 ("lang" "\\langle" t "&lang;" "<" "<" "⟨")
403 ("rang" "\\rangle" t "&rang;" ">" ">" "⟩")
404 ("langle" "\\langle" t "&lang;" "<" "<" "⟨")
405 ("rangle" "\\rangle" t "&rang;" ">" ">" "⟩")
406 ("hbar" "\\hbar" t "&hbar;" "hbar" "hbar" "ℏ")
407 ("mho" "\\mho" t "&mho;" "mho" "mho" "℧")
409 "** Arrows"
410 ("larr" "\\leftarrow" t "&larr;" "<-" "<-" "←")
411 ("leftarrow" "\\leftarrow" t "&larr;" "<-" "<-" "←")
412 ("gets" "\\gets" t "&larr;" "<-" "<-" "←")
413 ("lArr" "\\Leftarrow" t "&lArr;" "<=" "<=" "⇐")
414 ("Leftarrow" "\\Leftarrow" t "&lArr;" "<=" "<=" "⇐")
415 ("uarr" "\\uparrow" t "&uarr;" "[uparrow]" "[uparrow]" "↑")
416 ("uparrow" "\\uparrow" t "&uarr;" "[uparrow]" "[uparrow]" "↑")
417 ("uArr" "\\Uparrow" t "&uArr;" "[dbluparrow]" "[dbluparrow]" "⇑")
418 ("Uparrow" "\\Uparrow" t "&uArr;" "[dbluparrow]" "[dbluparrow]" "⇑")
419 ("rarr" "\\rightarrow" t "&rarr;" "->" "->" "→")
420 ("to" "\\to" t "&rarr;" "->" "->" "→")
421 ("rightarrow" "\\rightarrow" t "&rarr;" "->" "->" "→")
422 ("rArr" "\\Rightarrow" t "&rArr;" "=>" "=>" "⇒")
423 ("Rightarrow" "\\Rightarrow" t "&rArr;" "=>" "=>" "⇒")
424 ("darr" "\\downarrow" t "&darr;" "[downarrow]" "[downarrow]" "↓")
425 ("downarrow" "\\downarrow" t "&darr;" "[downarrow]" "[downarrow]" "↓")
426 ("dArr" "\\Downarrow" t "&dArr;" "[dbldownarrow]" "[dbldownarrow]" "⇓")
427 ("Downarrow" "\\Downarrow" t "&dArr;" "[dbldownarrow]" "[dbldownarrow]" "⇓")
428 ("harr" "\\leftrightarrow" t "&harr;" "<->" "<->" "↔")
429 ("leftrightarrow" "\\leftrightarrow" t "&harr;" "<->" "<->" "↔")
430 ("hArr" "\\Leftrightarrow" t "&hArr;" "<=>" "<=>" "⇔")
431 ("Leftrightarrow" "\\Leftrightarrow" t "&hArr;" "<=>" "<=>" "⇔")
432 ("crarr" "\\hookleftarrow" t "&crarr;" "<-'" "<-'" "↵")
433 ("hookleftarrow" "\\hookleftarrow" t "&crarr;" "<-'" "<-'" "↵")
435 "** Function names"
436 ("arccos" "\\arccos" t "arccos" "arccos" "arccos" "arccos")
437 ("arcsin" "\\arcsin" t "arcsin" "arcsin" "arcsin" "arcsin")
438 ("arctan" "\\arctan" t "arctan" "arctan" "arctan" "arctan")
439 ("arg" "\\arg" t "arg" "arg" "arg" "arg")
440 ("cos" "\\cos" t "cos" "cos" "cos" "cos")
441 ("cosh" "\\cosh" t "cosh" "cosh" "cosh" "cosh")
442 ("cot" "\\cot" t "cot" "cot" "cot" "cot")
443 ("coth" "\\coth" t "coth" "coth" "coth" "coth")
444 ("csc" "\\csc" t "csc" "csc" "csc" "csc")
445 ("deg" "\\deg" t "&deg;" "deg" "deg" "deg")
446 ("det" "\\det" t "det" "det" "det" "det")
447 ("dim" "\\dim" t "dim" "dim" "dim" "dim")
448 ("exp" "\\exp" t "exp" "exp" "exp" "exp")
449 ("gcd" "\\gcd" t "gcd" "gcd" "gcd" "gcd")
450 ("hom" "\\hom" t "hom" "hom" "hom" "hom")
451 ("inf" "\\inf" t "inf" "inf" "inf" "inf")
452 ("ker" "\\ker" t "ker" "ker" "ker" "ker")
453 ("lg" "\\lg" t "lg" "lg" "lg" "lg")
454 ("lim" "\\lim" t "lim" "lim" "lim" "lim")
455 ("liminf" "\\liminf" t "liminf" "liminf" "liminf" "liminf")
456 ("limsup" "\\limsup" t "limsup" "limsup" "limsup" "limsup")
457 ("ln" "\\ln" t "ln" "ln" "ln" "ln")
458 ("log" "\\log" t "log" "log" "log" "log")
459 ("max" "\\max" t "max" "max" "max" "max")
460 ("min" "\\min" t "min" "min" "min" "min")
461 ("Pr" "\\Pr" t "Pr" "Pr" "Pr" "Pr")
462 ("sec" "\\sec" t "sec" "sec" "sec" "sec")
463 ("sin" "\\sin" t "sin" "sin" "sin" "sin")
464 ("sinh" "\\sinh" t "sinh" "sinh" "sinh" "sinh")
465 ("sup" "\\sup" t "&sup;" "sup" "sup" "sup")
466 ("tan" "\\tan" t "tan" "tan" "tan" "tan")
467 ("tanh" "\\tanh" t "tanh" "tanh" "tanh" "tanh")
469 "** Signs & Symbols"
470 ("bull" "\\textbullet{}" nil "&bull;" "*" "*" "•")
471 ("bullet" "\\textbullet{}" nil "&bull;" "*" "*" "•")
472 ("star" "\\star" t "*" "*" "*" "⋆")
473 ("lowast" "\\ast" t "&lowast;" "*" "*" "∗")
474 ("ast" "\\ast" t "&lowast;" "*" "*" "*")
475 ("odot" "\\odot" t "o" "[circled dot]" "[circled dot]" "ʘ")
476 ("oplus" "\\oplus" t "&oplus;" "[circled plus]" "[circled plus]" "⊕")
477 ("otimes" "\\otimes" t "&otimes;" "[circled times]" "[circled times]" "⊗")
478 ("check" "\\checkmark" t "&checkmark;" "[checkmark]" "[checkmark]" "✓")
479 ("checkmark" "\\checkmark" t "&check;" "[checkmark]" "[checkmark]" "✓")
481 "** Miscellaneous (seldom used)"
482 ("para" "\\P{}" nil "&para;" "[pilcrow]" "¶" "¶")
483 ("ordf" "\\textordfeminine{}" nil "&ordf;" "_a_" "ª" "ª")
484 ("ordm" "\\textordmasculine{}" nil "&ordm;" "_o_" "º" "º")
485 ("cedil" "\\c{}" nil "&cedil;" "[cedilla]" "¸" "¸")
486 ("oline" "\\overline{~}" t "&oline;" "[overline]" "¯" "‾")
487 ("uml" "\\textasciidieresis{}" nil "&uml;" "[diaeresis]" "¨" "¨")
488 ("zwnj" "\\/{}" nil "&zwnj;" "" "" "‌")
489 ("zwj" "" nil "&zwj;" "" "" "‍")
490 ("lrm" "" nil "&lrm;" "" "" "‎")
491 ("rlm" "" nil "&rlm;" "" "" "‏")
493 "** Smilies"
494 ("smiley" "\\ddot\\smile" t "&#9786;" ":-)" ":-)" "☺")
495 ("blacksmile" "\\ddot\\smile" t "&#9787;" ":-)" ":-)" "☻")
496 ("sad" "\\ddot\\frown" t "&#9785;" ":-(" ":-(" "☹")
497 ("frowny" "\\ddot\\frown" t "&#9785;" ":-(" ":-(" "☹")
499 "** Suits"
500 ("clubs" "\\clubsuit" t "&clubs;" "[clubs]" "[clubs]" "♣")
501 ("clubsuit" "\\clubsuit" t "&clubs;" "[clubs]" "[clubs]" "♣")
502 ("spades" "\\spadesuit" t "&spades;" "[spades]" "[spades]" "♠")
503 ("spadesuit" "\\spadesuit" t "&spades;" "[spades]" "[spades]" "♠")
504 ("hearts" "\\heartsuit" t "&hearts;" "[hearts]" "[hearts]" "♥")
505 ("heartsuit" "\\heartsuit" t "&heartsuit;" "[hearts]" "[hearts]" "♥")
506 ("diams" "\\diamondsuit" t "&diams;" "[diamonds]" "[diamonds]" "◆")
507 ("diamondsuit" "\\diamondsuit" t "&diams;" "[diamonds]" "[diamonds]" "◆")
508 ("diamond" "\\diamondsuit" t "&diamond;" "[diamond]" "[diamond]" "◆")
509 ("Diamond" "\\diamondsuit" t "&diamond;" "[diamond]" "[diamond]" "◆")
510 ("loz" "\\lozenge" t "&loz;" "[lozenge]" "[lozenge]" "⧫"))
511 ;; Add "\_ "-entity family for spaces.
512 (let (space-entities html-spaces (entity "_"))
513 (dolist (n (number-sequence 1 20) (nreverse space-entities))
514 (let ((spaces (make-string n ?\s)))
515 (push (list (setq entity (concat entity " "))
516 (format "\\hspace*{%sem}" (* n .5))
518 (setq html-spaces (concat "&ensp;" html-spaces))
519 spaces
520 spaces
521 (make-string n ?\x2002))
522 space-entities)))))
523 "Default entities used in Org mode to produce special characters.
524 For details see `org-entities-user'.")
526 (defsubst org-entity-get (name)
527 "Get the proper association for NAME from the entity lists.
528 This first checks the user list, then the built-in list."
529 (or (assoc name org-entities-user)
530 (assoc name org-entities)))
532 ;; Helpfunctions to create a table for orgmode.org/worg/org-symbols.org
534 (defun org-entities-create-table ()
535 "Create an Org mode table with all entities."
536 (interactive)
537 (let ((pos (point)))
538 (insert "|Name|LaTeX code|LaTeX|HTML code |HTML|ASCII|Latin1|UTF-8\n|-\n")
539 (dolist (e org-entities)
540 (pcase e
541 (`(,name ,latex ,mathp ,html ,ascii ,latin ,utf8)
542 (if (equal ascii "|") (setq ascii "\\vert"))
543 (if (equal latin "|") (setq latin "\\vert"))
544 (if (equal utf8 "|") (setq utf8 "\\vert"))
545 (if (equal ascii "=>") (setq ascii "= >"))
546 (if (equal latin "=>") (setq latin "= >"))
547 (insert "|" name
548 "|" (format "=%s=" latex)
549 "|" (format (if mathp "$%s$" "$\\mbox{%s}$") latex)
550 "|" (format "=%s=" html) "|" html
551 "|" ascii "|" latin "|" utf8
552 "|\n"))))
553 (goto-char pos)
554 (org-table-align)))
556 (defvar org-pretty-entities) ;; declare defcustom from org
557 (defun org-entities-help ()
558 "Create a Help buffer with all available entities."
559 (interactive)
560 (with-output-to-temp-buffer "*Org Entity Help*"
561 (princ "Org mode entities\n=================\n\n")
562 (let ((ll (append '("* User-defined additions (variable org-entities-user)")
563 org-entities-user
564 org-entities))
565 (lastwasstring t)
566 (head (concat
567 "\n"
568 " Symbol Org entity LaTeX code HTML code\n"
569 " -----------------------------------------------------------\n")))
570 (dolist (e ll)
571 (pcase e
572 (`(,name ,latex ,_ ,html ,_ ,_ ,utf8)
573 (when lastwasstring
574 (princ head)
575 (setq lastwasstring nil))
576 (princ (format " %-8s \\%-16s %-22s %-13s\n"
577 utf8 name latex html)))
578 ((pred stringp)
579 (princ e)
580 (princ "\n")
581 (setq lastwasstring t))))))
582 (with-current-buffer "*Org Entity Help*"
583 (org-mode)
584 (when org-pretty-entities
585 (org-toggle-pretty-entities)))
586 (select-window (get-buffer-window "*Org Entity Help*")))
589 (provide 'org-entities)
591 ;; Local variables:
592 ;; coding: utf-8
593 ;; End:
595 ;;; org-entities.el ends here