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