`org-export-htmlize-output-type' docstring patch
[org-mode/org-mode-NeilSmithlineMods.git] / lisp / org-entities.el
blob1c99b9eb5a572e8ab69e3d4285e18f76aa9ca4e7
1 ;;; org-entities.el --- Support for special entities in Org-mode
3 ;; Copyright (C) 2010 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 ;; Version: 7.4
11 ;; This file is part of GNU Emacs.
13 ;; GNU Emacs is free software: you can redistribute it and/or modify
14 ;; it under the terms of the GNU General Public License as published by
15 ;; the Free Software Foundation, either version 3 of the License, or
16 ;; (at your option) any later version.
18 ;; GNU Emacs is distributed in the hope that it will be useful,
19 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 ;; GNU General Public License for more details.
23 ;; You should have received a copy of the GNU General Public License
24 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
25 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
27 ;;; Commentary:
29 ;;; Code:
31 (require 'org-macs)
33 (declare-function org-table-align "org-table" ())
35 (eval-when-compile
36 (require 'cl))
38 (defgroup org-entities nil
39 "Options concerning entities in Org-mode."
40 :tag "Org Entities"
41 :group 'org)
43 (defcustom org-entities-ascii-explanatory nil
44 "Non-nil means replace special entities in ASCII.
45 For example, this will replace \"\\nsup\" with \"[not a superset of]\"
46 in backends where the corresponding character is not available."
47 :group 'org-entities
48 :type 'boolean)
50 (defcustom org-entities-user nil
51 "User-defined entities used in Org-mode to produce special characters.
52 Each entry in this list is a list of strings. It associates the name
53 of the entity that can be inserted into an Org file as \\name with the
54 appropriate replacements for the different export backends. The order
55 of the fields is the following
57 name As a string, without the leading backslash
58 LaTeX replacement In ready LaTeX, no further processing will take place
59 LaTeX mathp A Boolean, either t or nil. t if this entity needs
60 to be in math mode.
61 HTML replacement In ready HTML, no further processing will take place.
62 Usually this will be an &...; entity.
63 ASCII replacement Plain ASCII, no extensions. Symbols that cannot be
64 represented will be left as they are, but see the.
65 variable `org-entities-ascii-explanatory'.
66 Latin1 replacement Use the special characters available in latin1.
67 utf-8 replacement Use the special characters available in utf-8.
69 If you define new entities here that require specific LaTeX packages to be
70 loaded, add these packages to `org-export-latex-packages-alist'."
71 :group 'org-entities
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" "℘")
157 "** Greek"
158 ("Alpha" "A" nil "&Alpha;" "Alpha" "Alpha" "Α")
159 ("alpha" "\\alpha" t "&alpha;" "alpha" "alpha" "α")
160 ("Beta" "B" nil "&Beta;" "Beta" "Beta" "Β")
161 ("beta" "\\beta" t "&beta;" "beta" "beta" "β")
162 ("Gamma" "\\Gamma" t "&Gamma;" "Gamma" "Gamma" "Γ")
163 ("gamma" "\\gamma" t "&gamma;" "gamma" "gamma" "γ")
164 ("Delta" "\\Delta" t "&Delta;" "Delta" "Gamma" "Δ")
165 ("delta" "\\delta" t "&delta;" "delta" "delta" "δ")
166 ("Epsilon" "E" nil "&Epsilon;" "Epsilon" "Epsilon" "Ε")
167 ("epsilon" "\\epsilon" t "&epsilon;" "epsilon" "epsilon" "ε")
168 ("varepsilon" "\\varepsilon" t "&epsilon;" "varepsilon" "varepsilon" "ε")
169 ("Zeta" "Z" nil "&Zeta;" "Zeta" "Zeta" "Ζ")
170 ("zeta" "\\zeta" t "&zeta;" "zeta" "zeta" "ζ")
171 ("Eta" "H" nil "&Eta;" "Eta" "Eta" "Η")
172 ("eta" "\\eta" t "&eta;" "eta" "eta" "η")
173 ("Theta" "\\Theta" t "&Theta;" "Theta" "Theta" "Θ")
174 ("theta" "\\theta" t "&theta;" "theta" "theta" "θ")
175 ("thetasym" "\\vartheta" t "&thetasym;" "theta" "theta" "ϑ")
176 ("vartheta" "\\vartheta" t "&thetasym;" "theta" "theta" "ϑ")
177 ("Iota" "I" nil "&Iota;" "Iota" "Iota" "Ι")
178 ("iota" "\\iota" t "&iota;" "iota" "iota" "ι")
179 ("Kappa" "K" nil "&Kappa;" "Kappa" "Kappa" "Κ")
180 ("kappa" "\\kappa" t "&kappa;" "kappa" "kappa" "κ")
181 ("Lambda" "\\Lambda" t "&Lambda;" "Lambda" "Lambda" "Λ")
182 ("lambda" "\\lambda" t "&lambda;" "lambda" "lambda" "λ")
183 ("Mu" "M" nil "&Mu;" "Mu" "Mu" "Μ")
184 ("mu" "\\mu" t "&mu;" "mu" "mu" "μ")
185 ("nu" "\\nu" t "&nu;" "nu" "nu" "ν")
186 ("Nu" "N" nil "&Nu;" "Nu" "Nu" "Ν")
187 ("Xi" "\\Xi" t "&Xi;" "Xi" "Xi" "Ξ")
188 ("xi" "\\xi" t "&xi;" "xi" "xi" "ξ")
189 ("Omicron" "O" nil "&Omicron;" "Omicron" "Omicron" "Ο")
190 ("omicron" "\\textit{o}" nil "&omicron;" "omicron" "omicron" "ο")
191 ("Pi" "\\Pi" t "&Pi;" "Pi" "Pi" "Π")
192 ("pi" "\\pi" t "&pi;" "pi" "pi" "π")
193 ("Rho" "P" nil "&Rho;" "Rho" "Rho" "Ρ")
194 ("rho" "\\rho" t "&rho;" "rho" "rho" "ρ")
195 ("Sigma" "\\Sigma" t "&Sigma;" "Sigma" "Sigma" "Σ")
196 ("sigma" "\\sigma" t "&sigma;" "sigma" "sigma" "σ")
197 ("sigmaf" "\\varsigma" t "&sigmaf;" "sigmaf" "sigmaf" "ς")
198 ("varsigma" "\\varsigma" t "&sigmaf;" "varsigma" "varsigma" "ς")
199 ("Tau" "T" nil "&Tau;" "Tau" "Tau" "Τ")
200 ("Upsilon" "\\Upsilon" t "&Upsilon;" "Upsilon" "Upsilon" "Υ")
201 ("upsih" "\\Upsilon" t "&upsih;" "upsilon" "upsilon" "ϒ")
202 ("upsilon" "\\upsilon" t "&upsilon;" "upsilon" "upsilon" "υ")
203 ("Phi" "\\Phi" t "&Phi;" "Phi" "Phi" "Φ")
204 ("phi" "\\phi" t "&phi;" "phi" "phi" "φ")
205 ("Chi" "X" nil "&Chi;" "Chi" "Chi" "Χ")
206 ("chi" "\\chi" t "&chi;" "chi" "chi" "χ")
207 ("acutex" "\\acute x" t "&acute;x" "'x" "'x" "𝑥́")
208 ("Psi" "\\Psi" t "&Psi;" "Psi" "Psi" "Ψ")
209 ("psi" "\\psi" t "&psi;" "psi" "psi" "ψ")
210 ("tau" "\\tau" t "&tau;" "tau" "tau" "τ")
211 ("Omega" "\\Omega" t "&Omega;" "Omega" "Omega" "Ω")
212 ("omega" "\\omega" t "&omega;" "omega" "omega" "ω")
213 ("piv" "\\varpi" t "&piv;" "omega-pi" "omega-pi" "ϖ")
214 ("partial" "\\partial" t "&part;" "[partial differential]" "[partial differential]" "∂")
216 "** Hebrew"
217 ("alefsym" "\\aleph" t "&alefsym;" "aleph" "aleph" "ℵ")
219 "** Dead languages"
220 ("ETH" "\\DH{}" nil "&ETH;" "D" "Ð" "Ð")
221 ("eth" "\\dh{}" nil "&eth;" "dh" "ð" "ð")
222 ("THORN" "\\TH{}" nil "&THORN;" "TH" "Þ" "Þ")
223 ("thorn" "\\th{}" nil "&thorn;" "th" "þ" "þ")
225 "* Punctuation"
226 "** Dots and Marks"
227 ("dots" "\\dots{}" nil "&hellip;" "..." "..." "…")
228 ("hellip" "\\dots{}" nil "&hellip;" "..." "..." "…")
229 ("middot" "\\textperiodcentered{}" nil "&middot;" "." "·" "·")
230 ("iexcl" "!`" nil "&iexcl;" "!" "¡" "¡")
231 ("iquest" "?`" nil "&iquest;" "?" "¿" "¿")
233 "** Dash-like"
234 ("shy" "\\-" nil "&shy;" "" "" "")
235 ("ndash" "--" nil "&ndash;" "-" "-" "–")
236 ("mdash" "---" nil "&mdash;" "--" "--" "—")
238 "** Quotations"
239 ("quot" "\\textquotedbl{}" nil "&quot;" "\"" "\"" "\"")
240 ("acute" "\\textasciiacute{}" nil "&acute;" "'" "´" "´")
241 ("ldquo" "\\textquotedblleft{}" nil "&ldquo;" "\"" "\"" "“")
242 ("rdquo" "\\textquotedblright{}" nil "&rdquo;" "\"" "\"" "”")
243 ("bdquo" "\\quotedblbase{}" nil "&bdquo;" "\"" "\"" "„")
244 ("lsquo" "\\textquoteleft{}" nil "&lsquo;" "`" "`" "‘")
245 ("rsquo" "\\textquoteright{}" nil "&rsquo;" "'" "'" "’")
246 ("sbquo" "\\quotesinglbase{}" nil "&sbquo;" "," "," "‚")
247 ("laquo" "\\guillemotleft{}" nil "&laquo;" "<<" "«" "«")
248 ("raquo" "\\guillemotright{}" nil "&raquo;" ">>" "»" "»")
249 ("lsaquo" "\\guilsinglleft{}" nil "&lsaquo;" "<" "<" "‹")
250 ("rsaquo" "\\guilsinglright{}" nil "&rsaquo;" ">" ">" "›")
252 "* Other"
253 "** Misc. (often used)"
254 ("circ" "\\circ" t "&circ;" "^" "^" "ˆ")
255 ("vert" "\\vert{}" t "&#124;" "|" "|" "|")
256 ("brvbar" "\\textbrokenbar{}" nil "&brvbar;" "|" "¦" "¦")
257 ("sect" "\\S" nil "&sect;" "paragraph" "§" "§")
258 ("amp" "\\&" nil "&amp;" "&" "&" "&")
259 ("lt" "\\textless{}" nil "&lt;" "<" "<" "<")
260 ("gt" "\\textgreater{}" nil "&gt;" ">" ">" ">")
261 ("tilde" "\\~{}" nil "&tilde;" "~" "~" "~")
262 ("dagger" "\\textdagger{}" nil "&dagger;" "[dagger]" "[dagger]" "†")
263 ("Dagger" "\\textdaggerdbl{}" nil "&Dagger;" "[doubledagger]" "[doubledagger]" "‡")
265 "** Whitespace"
266 ("nbsp" "~" nil "&nbsp;" " " " " " ")
267 ("ensp" "\\hspace*{.5em}" nil "&ensp;" " " " " " ")
268 ("emsp" "\\hspace*{1em}" nil "&emsp;" " " " " " ")
269 ("thinsp" "\\hspace*{.2em}" nil "&thinsp;" " " " " " ")
271 "** Currency"
272 ("curren" "\\textcurrency{}" nil "&curren;" "curr." "¤" "¤")
273 ("cent" "\\textcent{}" nil "&cent;" "cent" "¢" "¢")
274 ("pound" "\\pounds{}" nil "&pound;" "pound" "£" "£")
275 ("yen" "\\textyen{}" nil "&yen;" "yen" "¥" "¥")
276 ("euro" "\\texteuro{}" nil "&euro;" "EUR" "EUR" "€")
277 ("EUR" "\\EUR{}" nil "&euro;" "EUR" "EUR" "€")
278 ("EURdig" "\\EURdig{}" nil "&euro;" "EUR" "EUR" "€")
279 ("EURhv" "\\EURhv{}" nil "&euro;" "EUR" "EUR" "€")
280 ("EURcr" "\\EURcr{}" nil "&euro;" "EUR" "EUR" "€")
281 ("EURtm" "\\EURtm{}" nil "&euro;" "EUR" "EUR" "€")
283 "** Property Marks"
284 ("copy" "\\textcopyright{}" nil "&copy;" "(c)" "©" "©")
285 ("reg" "\\textregistered{}" nil "&reg;" "(r)" "®" "®")
286 ("trade" "\\texttrademark{}" nil "&trade;" "TM" "TM" "™")
288 "** Science et al."
289 ("minus" "\\minus" t "&minus;" "-" "-" "−")
290 ("pm" "\\textpm{}" nil "&plusmn;" "+-" "±" "±")
291 ("plusmn" "\\textpm{}" nil "&plusmn;" "+-" "±" "±")
292 ("times" "\\texttimes{}" nil "&times;" "*" "×" "×")
293 ("frasl" "/" nil "&frasl;" "/" "/" "⁄")
294 ("div" "\\textdiv{}" nil "&divide;" "/" "÷" "÷")
295 ("frac12" "\\textonehalf{}" nil "&frac12;" "1/2" "½" "½")
296 ("frac14" "\\textonequarter{}" nil "&frac14;" "1/4" "¼" "¼")
297 ("frac34" "\\textthreequarters{}" nil "&frac34;" "3/4" "¾" "¾")
298 ("permil" "\\textperthousand{}" nil "&permil;" "per thousand" "per thousand" "‰")
299 ("sup1" "\\textonesuperior{}" nil "&sup1;" "^1" "¹" "¹")
300 ("sup2" "\\texttwosuperior{}" nil "&sup2;" "^2" "²" "²")
301 ("sup3" "\\textthreesuperior{}" nil "&sup3;" "^3" "³" "³")
302 ("radic" "\\sqrt{\\,}" t "&radic;" "[square root]" "[square root]" "√")
303 ("sum" "\\sum" t "&sum;" "[sum]" "[sum]" "∑")
304 ("prod" "\\prod" t "&prod;" "[product]" "[n-ary product]" "∏")
305 ("micro" "\\textmu{}" nil "&micro;" "micro" "µ" "µ")
306 ("macr" "\\textasciimacron{}" nil "&macr;" "[macron]" "¯" "¯")
307 ("deg" "\\textdegree{}" nil "deg" "degree" "°" "°")
308 ("prime" "\\prime" t "&prime;" "'" "'" "′")
309 ("Prime" "\\prime{}\\prime" t "&Prime;" "''" "''" "″")
310 ("infin" "\\propto" t "&infin;" "[infinity]" "[infinity]" "∞")
311 ("infty" "\\infty" t "&infin;" "[infinity]" "[infinity]" "∞")
312 ("prop" "\\propto" t "&prop;" "[proportional to]" "[proportional to]" "∝")
313 ("proptp" "\\propto" t "&prop;" "[proportional to]" "[proportional to]" "∝")
314 ("not" "\\textlnot{}" nil "&not;" "[angled dash]" "¬" "¬")
315 ("land" "\\land" t "&and;" "[logical and]" "[logical and]" "∧")
316 ("wedge" "\\wedge" t "&and;" "[logical and]" "[logical and]" "∧")
317 ("lor" "\\lor" t "&or;" "[logical or]" "[logical or]" "∨")
318 ("vee" "\\vee" t "&or;" "[logical or]" "[logical or]" "∨")
319 ("cap" "\\cap" t "&cap;" "[intersection]" "[intersection]" "∩")
320 ("cup" "\\cup" t "&cup;" "[union]" "[union]" "∪")
321 ("int" "\\int" t "&int;" "[integral]" "[integral]" "∫")
322 ("there4" "\\therefore" t "&there4;" "[therefore]" "[therefore]" "∴")
323 ("sim" "\\sim" t "&sim;" "~" "~" "∼")
324 ("cong" "\\cong" t "&cong;" "[approx. equal to]" "[approx. equal to]" "≅")
325 ("simeq" "\\simeq" t "&cong;" "[approx. equal to]" "[approx. equal to]" "≅")
326 ("asymp" "\\asymp" t "&asymp;" "[almost equal to]" "[almost equal to]" "≈")
327 ("approx" "\\approx" t "&asymp;" "[almost equal to]" "[almost equal to]" "≈")
328 ("ne" "\\ne" t "&ne;" "[not equal to]" "[not equal to]" "≠")
329 ("neq" "\\neq" t "&ne;" "[not equal to]" "[not equal to]" "≠")
330 ("equiv" "\\equiv" t "&equiv;" "[identical to]" "[identical to]" "≡")
331 ("le" "\\le" t "&le;" "<=" "<=" "≤")
332 ("ge" "\\ge" t "&ge;" ">=" ">=" "≥")
333 ("sub" "\\subset" t "&sub;" "[subset of]" "[subset of]" "⊂")
334 ("subset" "\\subset" t "&sub;" "[subset of]" "[subset of]" "⊂")
335 ("sup" "\\supset" t "&sup;" "[superset of]" "[superset of]" "⊃")
336 ("supset" "\\supset" t "&sup;" "[superset of]" "[superset of]" "⊃")
337 ("nsub" "\\not\\subset" t "&nsub;" "[not a subset of]" "[not a subset of" "⊄")
338 ("sube" "\\subseteq" t "&sube;" "[subset of or equal to]" "[subset of or equal to]" "⊆")
339 ("nsup" "\\not\\supset" t "&nsup;" "[not a superset of]" "[not a superset of]" "⊅")
340 ("supe" "\\supseteq" t "&supe;" "[superset of or equal to]" "[superset of or equal to]" "⊇")
341 ("forall" "\\forall" t "&forall;" "[for all]" "[for all]" "∀")
342 ("exist" "\\exists" t "&exist;" "[there exists]" "[there exists]" "∃")
343 ("exists" "\\exists" t "&exist;" "[there exists]" "[there exists]" "∃")
344 ("empty" "\\empty" t "&empty;" "[empty set]" "[empty set]" "∅")
345 ("emptyset" "\\emptyset" t "&empty;" "[empty set]" "[empty set]" "∅")
346 ("isin" "\\in" t "&isin;" "[element of]" "[element of]" "∈")
347 ("in" "\\in" t "&isin;" "[element of]" "[element of]" "∈")
348 ("notin" "\\notin" t "&notin;" "[not an element of]" "[not an element of]" "∉")
349 ("ni" "\\ni" t "&ni;" "[contains as member]" "[contains as member]" "∋")
350 ("nabla" "\\nabla" t "&nabla;" "[nabla]" "[nabla]" "∇")
351 ("ang" "\\angle" t "&ang;" "[angle]" "[angle]" "∠")
352 ("angle" "\\angle" t "&ang;" "[angle]" "[angle]" "∠")
353 ("perp" "\\perp" t "&perp;" "[up tack]" "[up tack]" "⊥")
354 ("sdot" "\\cdot" t "&sdot;" "[dot]" "[dot]" "⋅")
355 ("cdot" "\\cdot" t "&sdot;" "[dot]" "[dot]" "⋅")
356 ("lceil" "\\lceil" t "&lceil;" "[left ceiling]" "[left ceiling]" "⌈")
357 ("rceil" "\\rceil" t "&rceil;" "[right ceiling]" "[right ceiling]" "⌉")
358 ("lfloor" "\\lfloor" t "&lfloor;" "[left floor]" "[left floor]" "⌊")
359 ("rfloor" "\\rfloor" t "&rfloor;" "[right floor]" "[right floor]" "⌋")
360 ("lang" "\\langle" t "&lang;" "<" "<" "⟨")
361 ("rang" "\\rangle" t "&rang;" ">" ">" "⟩")
363 "** Arrows"
364 ("larr" "\\leftarrow" t "&larr;" "<-" "<-" "←")
365 ("leftarrow" "\\leftarrow" t "&larr;" "<-" "<-" "←")
366 ("gets" "\\gets" t "&larr;" "<-" "<-" "←")
367 ("lArr" "\\Leftarrow" t "&lArr;" "<=" "<=" "⇐")
368 ("Leftarrow" "\\Leftarrow" t "&lArr;" "<=" "<=" "⇐")
369 ("uarr" "\\uparrow" t "&uarr;" "[uparrow]" "[uparrow]" "↑")
370 ("uparrow" "\\uparrow" t "&uarr;" "[uparrow]" "[uparrow]" "↑")
371 ("uArr" "\\Uparrow" t "&uArr;" "[dbluparrow]" "[dbluparrow]" "⇑")
372 ("Uparrow" "\\Uparrow" t "&uArr;" "[dbluparrow]" "[dbluparrow]" "⇑")
373 ("rarr" "\\rightarrow" t "&rarr;" "->" "->" "→")
374 ("to" "\\to" t "&rarr;" "->" "->" "→")
375 ("rightarrow" "\\rightarrow" t "&rarr;" "->" "->" "→")
376 ("rArr" "\\Rightarrow" t "&rArr;" "=>" "=>" "⇒")
377 ("Rightarrow" "\\Rightarrow" t "&rArr;" "=>" "=>" "⇒")
378 ("darr" "\\downarrow" t "&darr;" "[downarrow]" "[downarrow]" "↓")
379 ("downarrow" "\\downarrow" t "&darr;" "[downarrow]" "[downarrow]" "↓")
380 ("dArr" "\\Downarrow" t "&dArr;" "[dbldownarrow]" "[dbldownarrow]" "⇓")
381 ("Downarrow" "\\Downarrow" t "&dArr;" "[dbldownarrow]" "[dbldownarrow]" "⇓")
382 ("harr" "\\leftrightarrow" t "&harr;" "<->" "<->" "↔")
383 ("leftrightarrow" "\\leftrightarrow" t "&harr;" "<->" "<->" "↔")
384 ("hArr" "\\Leftrightarrow" t "&hArr;" "<=>" "<=>" "⇔")
385 ("Leftrightarrow" "\\Leftrightarrow" t "&hArr;" "<=>" "<=>" "⇔")
386 ("crarr" "\\hookleftarrow" t "&crarr;" "<-'" "<-'" "↵")
387 ("hookleftarrow" "\\hookleftarrow" t "&crarr;" "<-'" "<-'" "↵")
389 "** Function names"
390 ("arccos" "\\arccos" t "arccos" "arccos" "arccos" "arccos")
391 ("arcsin" "\\arcsin" t "arcsin" "arcsin" "arcsin" "arcsin")
392 ("arctan" "\\arctan" t "arctan" "arctan" "arctan" "arctan")
393 ("arg" "\\arg" t "arg" "arg" "arg" "arg")
394 ("cos" "\\cos" t "cos" "cos" "cos" "cos")
395 ("cosh" "\\cosh" t "cosh" "cosh" "cosh" "cosh")
396 ("cot" "\\cot" t "cot" "cot" "cot" "cot")
397 ("coth" "\\coth" t "coth" "coth" "coth" "coth")
398 ("csc" "\\csc" t "csc" "csc" "csc" "csc")
399 ("deg" "\\deg" t "&deg;" "deg" "deg" "deg")
400 ("det" "\\det" t "det" "det" "det" "det")
401 ("dim" "\\dim" t "dim" "dim" "dim" "dim")
402 ("exp" "\\exp" t "exp" "exp" "exp" "exp")
403 ("gcd" "\\gcd" t "gcd" "gcd" "gcd" "gcd")
404 ("hom" "\\hom" t "hom" "hom" "hom" "hom")
405 ("inf" "\\inf" t "inf" "inf" "inf" "inf")
406 ("ker" "\\ker" t "ker" "ker" "ker" "ker")
407 ("lg" "\\lg" t "lg" "lg" "lg" "lg")
408 ("lim" "\\lim" t "lim" "lim" "lim" "lim")
409 ("liminf" "\\liminf" t "liminf" "liminf" "liminf" "liminf")
410 ("limsup" "\\limsup" t "limsup" "limsup" "limsup" "limsup")
411 ("ln" "\\ln" t "ln" "ln" "ln" "ln")
412 ("log" "\\log" t "log" "log" "log" "log")
413 ("max" "\\max" t "max" "max" "max" "max")
414 ("min" "\\min" t "min" "min" "min" "min")
415 ("Pr" "\\Pr" t "Pr" "Pr" "Pr" "Pr")
416 ("sec" "\\sec" t "sec" "sec" "sec" "sec")
417 ("sin" "\\sin" t "sin" "sin" "sin" "sin")
418 ("sinh" "\\sinh" t "sinh" "sinh" "sinh" "sinh")
419 ("sup" "\\sup" t "&sup;" "sup" "sup" "sup")
420 ("tan" "\\tan" t "tan" "tan" "tan" "tan")
421 ("tanh" "\\tanh" t "tanh" "tanh" "tanh" "tanh")
423 "** Signs & Symbols"
424 ("bull" "\\textbullet{}" nil "&bull;" "*" "*" "•")
425 ("bullet" "\\textbullet{}" nil "&bull;" "*" "*" "•")
426 ("star" "\\star" t "*" "*" "*" "⋆")
427 ("lowast" "\\ast" t "&lowast;" "*" "*" "∗")
428 ("ast" "\\ast" t "&lowast;" "*" "*" "*")
429 ("odot" "\\odot" t "o" "[circled dot]" "[circled dot]" "ʘ")
430 ("oplus" "\\oplus" t "&oplus;" "[circled plus]" "[circled plus]" "⊕")
431 ("otimes" "\\otimes" t "&otimes;" "[circled times]" "[circled times]" "⊗")
432 ("checkmark" "\\checkmark" t "&#10003;" "[checkmark]" "[checkmark]" "✓")
434 "** Miscellaneous (seldom used)"
435 ("para" "\\P{}" nil "&para;" "[pilcrow]" "¶" "¶")
436 ("ordf" "\\textordfeminine{}" nil "&ordf;" "_a_" "ª" "ª")
437 ("ordm" "\\textordmasculine{}" nil "&ordm;" "_o_" "º" "º")
438 ("cedil" "\\c{}" nil "&cedil;" "[cedilla]" "¸" "¸")
439 ("oline" "\\overline{~}" t "&oline;" "[overline]" "¯" "‾")
440 ("uml" "\\textasciidieresis{}" nil "&uml;" "[diaeresis]" "¨" "¨")
441 ("zwnj" "\\/{}" nil "&zwnj;" "" "" "‌")
442 ("zwj" "" nil "&zwj;" "" "" "‍")
443 ("lrm" "" nil "&lrm;" "" "" "‎")
444 ("rlm" "" nil "&rlm;" "" "" "‏")
446 "** Smilies"
447 ("smile" "\\smile" t "&#9786;" ":-)" ":-)" "⌣")
448 ("smiley" "\\smiley{}" nil "&#9786;" ":-)" ":-)" "☺")
449 ("blacksmile" "\\blacksmiley{}" nil "&#9787;" ":-)" ":-)" "☻")
450 ("sad" "\\frownie{}" nil "&#9785;" ":-(" ":-(" "☹")
452 "** Suits"
453 ("clubs" "\\clubsuit" t "&clubs;" "[clubs]" "[clubs]" "♣")
454 ("clubsuit" "\\clubsuit" t "&clubs;" "[clubs]" "[clubs]" "♣")
455 ("spades" "\\spadesuit" t "&spades;" "[spades]" "[spades]" "♠")
456 ("spadesuit" "\\spadesuit" t "&spades;" "[spades]" "[spades]" "♠")
457 ("hearts" "\\heartsuit" t "&hearts;" "[hearts]" "[hearts]" "♥")
458 ("heartsuit" "\\heartsuit" t "&heartsuit;" "[hearts]" "[hearts]" "♥")
459 ("diams" "\\diamondsuit" t "&diams;" "[diamonds]" "[diamonds]" "♦")
460 ("diamondsuit" "\\diamondsuit" t "&diams;" "[diamonds]" "[diamonds]" "♦")
461 ("Diamond" "\\diamond" t "&diamond;" "[diamond]" "[diamond]" "⋄")
462 ("loz" "\\diamond" t "&loz;" "[lozenge]" "[lozenge]" "◊")
464 "Default entities used in Org-mode to produce special characters.
465 For details see `org-entities-user'.")
467 (defsubst org-entity-get (name)
468 "Get the proper association for NAME from the entity lists.
469 This first checks the user list, then the built-in list."
470 (or (assoc name org-entities-user)
471 (assoc name org-entities)))
473 (defun org-entity-get-representation (name kind)
474 "Get the correct representation of entity NAME for export type KIND.
475 Kind can be any of `latex', `html', `ascii', `latin1', or `utf8'."
476 (let* ((e (org-entity-get name))
477 (n (cdr (assq kind '((latex . 1) (html . 3) (ascii . 4)
478 (latin1 . 5) (utf8 . 6)))))
479 (r (and e n (nth n e))))
480 (if (and e r
481 (not org-entities-ascii-explanatory)
482 (memq kind '(ascii latin1 utf8))
483 (= (string-to-char r) ?\[))
484 (concat "\\" name)
485 r)))
487 (defsubst org-entity-latex-math-p (name)
488 "Does entity NAME require math mode in LaTeX?"
489 (nth 2 (org-entity-get name)))
491 ;; Helpfunctions to create a table for orgmode.org/worg/org-symbols.org
493 (defun org-entities-create-table ()
494 "Create an org-mode table with all entities."
495 (interactive)
496 (let ((ll org-entities)
497 (pos (point))
498 e latex mathp html latin utf8 name ascii)
499 (insert "|Name|LaTeX code|LaTeX|HTML code |HTML|ASCII|Latin1|UTF-8\n|-\n")
500 (while ll
501 (when (listp e)
502 (setq e (pop ll))
503 (setq name (car e)
504 latex (nth 1 e)
505 mathp (nth 2 e)
506 html (nth 3 e)
507 ascii (nth 4 e)
508 latin (nth 5 e)
509 utf8 (nth 6 e))
510 (if (equal ascii "|") (setq ascii "\\vert"))
511 (if (equal latin "|") (setq latin "\\vert"))
512 (if (equal utf8 "|") (setq utf8 "\\vert"))
513 (if (equal ascii "=>") (setq ascii "= >"))
514 (if (equal latin "=>") (setq latin "= >"))
515 (insert "|" name
516 "|" (format "=%s=" latex)
517 "|" (format (if mathp "$%s$" "$\\mbox{%s}$")
518 latex)
519 "|" (format "=%s=" html) "|" html
520 "|" ascii "|" latin "|" utf8
521 "|\n")))
522 (goto-char pos)
523 (org-table-align)))
525 (defun org-entities-help ()
526 "Create a Help buffer with all available entities."
527 (interactive)
528 (with-output-to-temp-buffer "*Org Entity Help*"
529 (princ "Org-mode entities\n=================\n\n")
530 (let ((ll (append '("* User-defined additions (variable org-entities-user)")
531 org-entities-user
532 org-entities))
533 e latex mathp html latin utf8 name ascii
534 (lastwasstring t)
535 (head (concat
536 "\n"
537 " Symbol Org entity LaTeX code HTML code\n"
538 " -----------------------------------------------------------\n")))
539 (while ll
540 (setq e (pop ll))
541 (if (stringp e)
542 (progn
543 (princ e)
544 (princ "\n")
545 (setq lastwasstring t))
546 (if lastwasstring (princ head))
547 (setq lastwasstring nil)
548 (setq name (car e)
549 latex (nth 1 e)
550 html (nth 3 e)
551 utf8 (nth 6 e))
552 (princ (format " %-8s \\%-16s %-22s %-13s\n"
553 utf8 name latex html))))))
554 (with-current-buffer "*Org Entity Help*"
555 (org-mode))
556 (select-window (get-buffer-window "*Org Entity Help*")))
559 (defun replace-amp ()
560 "Postprocess HTML file to unescape the ampersand."
561 (interactive)
562 (while (re-search-forward "<td>&amp;\\([^<;]+;\\)" nil t)
563 (replace-match (concat "<td>&" (match-string 1)) t t)))
565 (provide 'org-entities)
567 ;; Local variables:
568 ;; coding: utf-8
569 ;; End:
571 ;; arch-tag: e6bd163f-7419-4009-9c93-a74623016424
573 ;;; org-entities.el ends here