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