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