Revert "don't insert a padline at the top of the file"
[org-mode.git] / lisp / org-entities.el
blob638da7861bf1a5a351fcb3ac94ff21590be9f08a
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" "℘")
157 ("ell" "\\ell" t "&ell;" "ell" "ell" "ℓ")
158 ("imath" "\\imath" t "&imath;" "[dotless i]" "dotless i" "ı")
159 ("jmath" "\\jmath" t "&jmath;" "[dotless j]" "dotless j" "ȷ")
161 "** Greek"
162 ("Alpha" "A" nil "&Alpha;" "Alpha" "Alpha" "Α")
163 ("alpha" "\\alpha" t "&alpha;" "alpha" "alpha" "α")
164 ("Beta" "B" nil "&Beta;" "Beta" "Beta" "Β")
165 ("beta" "\\beta" t "&beta;" "beta" "beta" "β")
166 ("Gamma" "\\Gamma" t "&Gamma;" "Gamma" "Gamma" "Γ")
167 ("gamma" "\\gamma" t "&gamma;" "gamma" "gamma" "γ")
168 ("Delta" "\\Delta" t "&Delta;" "Delta" "Gamma" "Δ")
169 ("delta" "\\delta" t "&delta;" "delta" "delta" "δ")
170 ("Epsilon" "E" nil "&Epsilon;" "Epsilon" "Epsilon" "Ε")
171 ("epsilon" "\\epsilon" t "&epsilon;" "epsilon" "epsilon" "ε")
172 ("varepsilon" "\\varepsilon" t "&epsilon;" "varepsilon" "varepsilon" "ε")
173 ("Zeta" "Z" nil "&Zeta;" "Zeta" "Zeta" "Ζ")
174 ("zeta" "\\zeta" t "&zeta;" "zeta" "zeta" "ζ")
175 ("Eta" "H" nil "&Eta;" "Eta" "Eta" "Η")
176 ("eta" "\\eta" t "&eta;" "eta" "eta" "η")
177 ("Theta" "\\Theta" t "&Theta;" "Theta" "Theta" "Θ")
178 ("theta" "\\theta" t "&theta;" "theta" "theta" "θ")
179 ("thetasym" "\\vartheta" t "&thetasym;" "theta" "theta" "ϑ")
180 ("vartheta" "\\vartheta" t "&thetasym;" "theta" "theta" "ϑ")
181 ("Iota" "I" nil "&Iota;" "Iota" "Iota" "Ι")
182 ("iota" "\\iota" t "&iota;" "iota" "iota" "ι")
183 ("Kappa" "K" nil "&Kappa;" "Kappa" "Kappa" "Κ")
184 ("kappa" "\\kappa" t "&kappa;" "kappa" "kappa" "κ")
185 ("Lambda" "\\Lambda" t "&Lambda;" "Lambda" "Lambda" "Λ")
186 ("lambda" "\\lambda" t "&lambda;" "lambda" "lambda" "λ")
187 ("Mu" "M" nil "&Mu;" "Mu" "Mu" "Μ")
188 ("mu" "\\mu" t "&mu;" "mu" "mu" "μ")
189 ("nu" "\\nu" t "&nu;" "nu" "nu" "ν")
190 ("Nu" "N" nil "&Nu;" "Nu" "Nu" "Ν")
191 ("Xi" "\\Xi" t "&Xi;" "Xi" "Xi" "Ξ")
192 ("xi" "\\xi" t "&xi;" "xi" "xi" "ξ")
193 ("Omicron" "O" nil "&Omicron;" "Omicron" "Omicron" "Ο")
194 ("omicron" "\\textit{o}" nil "&omicron;" "omicron" "omicron" "ο")
195 ("Pi" "\\Pi" t "&Pi;" "Pi" "Pi" "Π")
196 ("pi" "\\pi" t "&pi;" "pi" "pi" "π")
197 ("Rho" "P" nil "&Rho;" "Rho" "Rho" "Ρ")
198 ("rho" "\\rho" t "&rho;" "rho" "rho" "ρ")
199 ("Sigma" "\\Sigma" t "&Sigma;" "Sigma" "Sigma" "Σ")
200 ("sigma" "\\sigma" t "&sigma;" "sigma" "sigma" "σ")
201 ("sigmaf" "\\varsigma" t "&sigmaf;" "sigmaf" "sigmaf" "ς")
202 ("varsigma" "\\varsigma" t "&sigmaf;" "varsigma" "varsigma" "ς")
203 ("Tau" "T" nil "&Tau;" "Tau" "Tau" "Τ")
204 ("Upsilon" "\\Upsilon" t "&Upsilon;" "Upsilon" "Upsilon" "Υ")
205 ("upsih" "\\Upsilon" t "&upsih;" "upsilon" "upsilon" "ϒ")
206 ("upsilon" "\\upsilon" t "&upsilon;" "upsilon" "upsilon" "υ")
207 ("Phi" "\\Phi" t "&Phi;" "Phi" "Phi" "Φ")
208 ("phi" "\\phi" t "&phi;" "phi" "phi" "φ")
209 ("varphi" "\\varphi" t "&varphi;" "varphi" "varphi" "ɸ")
210 ("Chi" "X" nil "&Chi;" "Chi" "Chi" "Χ")
211 ("chi" "\\chi" t "&chi;" "chi" "chi" "χ")
212 ("acutex" "\\acute x" t "&acute;x" "'x" "'x" "𝑥́")
213 ("Psi" "\\Psi" t "&Psi;" "Psi" "Psi" "Ψ")
214 ("psi" "\\psi" t "&psi;" "psi" "psi" "ψ")
215 ("tau" "\\tau" t "&tau;" "tau" "tau" "τ")
216 ("Omega" "\\Omega" t "&Omega;" "Omega" "Omega" "Ω")
217 ("omega" "\\omega" t "&omega;" "omega" "omega" "ω")
218 ("piv" "\\varpi" t "&piv;" "omega-pi" "omega-pi" "ϖ")
219 ("varpi" "\\varpi" t "&piv;" "omega-pi" "omega-pi" "ϖ")
220 ("partial" "\\partial" t "&part;" "[partial differential]" "[partial differential]" "∂")
222 "** Hebrew"
223 ("alefsym" "\\aleph" t "&alefsym;" "aleph" "aleph" "ℵ")
224 ("aleph" "\\aleph" t "&aleph;" "aleph" "aleph" "ℵ")
225 ("gimel" "\\gimel" t "&gimel;" "gimel" "gimel" "ℷ")
226 ("beth" "\\beth" t "&beth;" "beth" "beth" "ב")
227 ("dalet" "\\daleth" t "&daleth;" "dalet" "dalet" "ד")
229 "** Dead languages"
230 ("ETH" "\\DH{}" nil "&ETH;" "D" "Ð" "Ð")
231 ("eth" "\\dh{}" nil "&eth;" "dh" "ð" "ð")
232 ("THORN" "\\TH{}" nil "&THORN;" "TH" "Þ" "Þ")
233 ("thorn" "\\th{}" nil "&thorn;" "th" "þ" "þ")
235 "* Punctuation"
236 "** Dots and Marks"
237 ("dots" "\\dots{}" nil "&hellip;" "..." "..." "…")
238 ("cdots" "\\cdots{}" t "&ctdot;" "..." "..." "⋯")
239 ("hellip" "\\dots{}" nil "&hellip;" "..." "..." "…")
240 ("middot" "\\textperiodcentered{}" nil "&middot;" "." "·" "·")
241 ("iexcl" "!`" nil "&iexcl;" "!" "¡" "¡")
242 ("iquest" "?`" nil "&iquest;" "?" "¿" "¿")
244 "** Dash-like"
245 ("shy" "\\-" nil "&shy;" "" "" "")
246 ("ndash" "--" nil "&ndash;" "-" "-" "–")
247 ("mdash" "---" nil "&mdash;" "--" "--" "—")
249 "** Quotations"
250 ("quot" "\\textquotedbl{}" nil "&quot;" "\"" "\"" "\"")
251 ("acute" "\\textasciiacute{}" nil "&acute;" "'" "´" "´")
252 ("ldquo" "\\textquotedblleft{}" nil "&ldquo;" "\"" "\"" "“")
253 ("rdquo" "\\textquotedblright{}" nil "&rdquo;" "\"" "\"" "”")
254 ("bdquo" "\\quotedblbase{}" nil "&bdquo;" "\"" "\"" "„")
255 ("lsquo" "\\textquoteleft{}" nil "&lsquo;" "`" "`" "‘")
256 ("rsquo" "\\textquoteright{}" nil "&rsquo;" "'" "'" "’")
257 ("sbquo" "\\quotesinglbase{}" nil "&sbquo;" "," "," "‚")
258 ("laquo" "\\guillemotleft{}" nil "&laquo;" "<<" "«" "«")
259 ("raquo" "\\guillemotright{}" nil "&raquo;" ">>" "»" "»")
260 ("lsaquo" "\\guilsinglleft{}" nil "&lsaquo;" "<" "<" "‹")
261 ("rsaquo" "\\guilsinglright{}" nil "&rsaquo;" ">" ">" "›")
263 "* Other"
264 "** Misc. (often used)"
265 ("circ" "\\^{}" nil "&circ;" "^" "^" "ˆ")
266 ("vert" "\\vert{}" t "&vert;" "|" "|" "|")
267 ("brvbar" "\\textbrokenbar{}" nil "&brvbar;" "|" "¦" "¦")
268 ("S" "\\S" nil "&sect;" "paragraph" "§" "§")
269 ("sect" "\\S" nil "&sect;" "paragraph" "§" "§")
270 ("amp" "\\&" nil "&amp;" "&" "&" "&")
271 ("lt" "\\textless{}" nil "&lt;" "<" "<" "<")
272 ("gt" "\\textgreater{}" nil "&gt;" ">" ">" ">")
273 ("tilde" "\\textasciitilde{}" nil "~" "~" "~" "~")
274 ("slash" "/" nil "/" "/" "/" "/")
275 ("plus" "+" nil "+" "+" "+" "+")
276 ("under" "\\_" nil "_" "_" "_" "_")
277 ("equal" "=" nil "=" "=" "=" "=")
278 ("asciicirc" "\\textasciicircum{}" nil "^" "^" "^" "^")
279 ("dagger" "\\textdagger{}" nil "&dagger;" "[dagger]" "[dagger]" "†")
280 ("dag" "\\dag{}" nil "&dagger;" "[dagger]" "[dagger]" "†")
281 ("Dagger" "\\textdaggerdbl{}" nil "&Dagger;" "[doubledagger]" "[doubledagger]" "‡")
282 ("ddag" "\\ddag{}" nil "&Dagger;" "[doubledagger]" "[doubledagger]" "‡")
284 "** Whitespace"
285 ("nbsp" "~" nil "&nbsp;" " " " " " ")
286 ("ensp" "\\hspace*{.5em}" nil "&ensp;" " " " " " ")
287 ("emsp" "\\hspace*{1em}" nil "&emsp;" " " " " " ")
288 ("thinsp" "\\hspace*{.2em}" nil "&thinsp;" " " " " " ")
290 "** Currency"
291 ("curren" "\\textcurrency{}" nil "&curren;" "curr." "¤" "¤")
292 ("cent" "\\textcent{}" nil "&cent;" "cent" "¢" "¢")
293 ("pound" "\\pounds{}" nil "&pound;" "pound" "£" "£")
294 ("yen" "\\textyen{}" nil "&yen;" "yen" "¥" "¥")
295 ("euro" "\\texteuro{}" nil "&euro;" "EUR" "EUR" "€")
296 ("EUR" "\\EUR{}" nil "&euro;" "EUR" "EUR" "€")
297 ("EURdig" "\\EURdig{}" nil "&euro;" "EUR" "EUR" "€")
298 ("EURhv" "\\EURhv{}" nil "&euro;" "EUR" "EUR" "€")
299 ("EURcr" "\\EURcr{}" nil "&euro;" "EUR" "EUR" "€")
300 ("EURtm" "\\EURtm{}" nil "&euro;" "EUR" "EUR" "€")
302 "** Property Marks"
303 ("copy" "\\textcopyright{}" nil "&copy;" "(c)" "©" "©")
304 ("reg" "\\textregistered{}" nil "&reg;" "(r)" "®" "®")
305 ("trade" "\\texttrademark{}" nil "&trade;" "TM" "TM" "™")
307 "** Science et al."
308 ("minus" "\\minus" t "&minus;" "-" "-" "−")
309 ("pm" "\\textpm{}" nil "&plusmn;" "+-" "±" "±")
310 ("plusmn" "\\textpm{}" nil "&plusmn;" "+-" "±" "±")
311 ("times" "\\texttimes{}" nil "&times;" "*" "×" "×")
312 ("frasl" "/" nil "&frasl;" "/" "/" "⁄")
313 ("colon" "\\colon" t ":" ":" ":" ":")
314 ("div" "\\textdiv{}" nil "&divide;" "/" "÷" "÷")
315 ("frac12" "\\textonehalf{}" nil "&frac12;" "1/2" "½" "½")
316 ("frac14" "\\textonequarter{}" nil "&frac14;" "1/4" "¼" "¼")
317 ("frac34" "\\textthreequarters{}" nil "&frac34;" "3/4" "¾" "¾")
318 ("permil" "\\textperthousand{}" nil "&permil;" "per thousand" "per thousand" "‰")
319 ("sup1" "\\textonesuperior{}" nil "&sup1;" "^1" "¹" "¹")
320 ("sup2" "\\texttwosuperior{}" nil "&sup2;" "^2" "²" "²")
321 ("sup3" "\\textthreesuperior{}" nil "&sup3;" "^3" "³" "³")
322 ("radic" "\\sqrt{\\,}" t "&radic;" "[square root]" "[square root]" "√")
323 ("sum" "\\sum" t "&sum;" "[sum]" "[sum]" "∑")
324 ("prod" "\\prod" t "&prod;" "[product]" "[n-ary product]" "∏")
325 ("micro" "\\textmu{}" nil "&micro;" "micro" "µ" "µ")
326 ("macr" "\\textasciimacron{}" nil "&macr;" "[macron]" "¯" "¯")
327 ("deg" "\\textdegree{}" nil "&deg;" "degree" "°" "°")
328 ("prime" "\\prime" t "&prime;" "'" "'" "′")
329 ("Prime" "\\prime{}\\prime" t "&Prime;" "''" "''" "″")
330 ("infin" "\\propto" t "&infin;" "[infinity]" "[infinity]" "∞")
331 ("infty" "\\infty" t "&infin;" "[infinity]" "[infinity]" "∞")
332 ("prop" "\\propto" t "&prop;" "[proportional to]" "[proportional to]" "∝")
333 ("proptp" "\\propto" t "&prop;" "[proportional to]" "[proportional to]" "∝")
334 ("not" "\\textlnot{}" nil "&not;" "[angled dash]" "¬" "¬")
335 ("neg" "\\neg{}" t "&not;" "[angled dash]" "¬" "¬")
336 ("land" "\\land" t "&and;" "[logical and]" "[logical and]" "∧")
337 ("wedge" "\\wedge" t "&and;" "[logical and]" "[logical and]" "∧")
338 ("lor" "\\lor" t "&or;" "[logical or]" "[logical or]" "∨")
339 ("vee" "\\vee" t "&or;" "[logical or]" "[logical or]" "∨")
340 ("cap" "\\cap" t "&cap;" "[intersection]" "[intersection]" "∩")
341 ("cup" "\\cup" t "&cup;" "[union]" "[union]" "∪")
342 ("int" "\\int" t "&int;" "[integral]" "[integral]" "∫")
343 ("therefore" "\\therefore" t "&there4;" "[therefore]" "[therefore]" "∴")
344 ("there4" "\\therefore" t "&there4;" "[therefore]" "[therefore]" "∴")
345 ("because" "\\because" t "&because;" "[because]" "[because]" "∵")
346 ("sim" "\\sim" t "&sim;" "~" "~" "∼")
347 ("cong" "\\cong" t "&cong;" "[approx. equal to]" "[approx. equal to]" "≅")
348 ("simeq" "\\simeq" t "&cong;" "[approx. equal to]" "[approx. equal to]" "≅")
349 ("asymp" "\\asymp" t "&asymp;" "[almost equal to]" "[almost equal to]" "≈")
350 ("approx" "\\approx" t "&asymp;" "[almost equal to]" "[almost equal to]" "≈")
351 ("ne" "\\ne" t "&ne;" "[not equal to]" "[not equal to]" "≠")
352 ("neq" "\\neq" t "&ne;" "[not equal to]" "[not equal to]" "≠")
353 ("equiv" "\\equiv" t "&equiv;" "[identical to]" "[identical to]" "≡")
355 ("triangleq" "\\triangleq" t "&triangleq;" "[defined to]" "[defined to]" "≜")
356 ("le" "\\le" t "&le;" "<=" "<=" "≤")
357 ("leq" "\\le" t "&le;" "<=" "<=" "≤")
358 ("ge" "\\ge" t "&ge;" ">=" ">=" "≥")
359 ("geq" "\\ge" t "&ge;" ">=" ">=" "≥")
360 ("lessgtr" "\\lessgtr" t "&lessgtr;" "[less than or greater than]" "[less than or greater than]" "≶")
361 ("lesseqgtr" "\\lesseqgtr" t "&lesseqgtr;" "[less than or equal or greater than or equal]" "[less than or equal or greater than or equal]" "⋚")
362 ("ll" "\\ll" t "&Lt;" "<<" "<<" "≪")
363 ("Ll" "\lll" t "&Ll;" "<<<" "<<<" "⋘")
364 ("lll" "\lll" t "&Ll;" "<<<" "<<<" "⋘")
365 ("gg" "\\gg" t "&Gt;" ">>" ">>" "≫")
366 ("Gg" "\\ggg" t "&Gg;" ">>>" ">>>" "⋙")
367 ("ggg" "\\ggg" t "&Gg;" ">>>" ">>>" "⋙")
368 ("prec" "\\prec" t "&pr;" "[precedes]" "[precedes]" "≺")
369 ("preceq" "\\preceq" t "&prcue;" "[precedes or equal]" "[precedes or equal]" "≼")
370 ("preccurlyeq" "\\preccurlyeq" t "&prcue;" "[precedes or equal]" "[precedes or equal]" "≼")
371 ("succ" "\\succ" t "&sc;" "[succeeds]" "[succeeds]" "≻")
372 ("succeq" "\\succeq" t "&sccue;" "[succeeds or equal]" "[succeeds or equal]" "≽")
373 ("succcurlyeq" "\\succcurlyeq" t "&sccue;" "[succeeds or equal]" "[succeeds or equal]" "≽")
374 ("sub" "\\subset" t "&sub;" "[subset of]" "[subset of]" "⊂")
375 ("subset" "\\subset" t "&sub;" "[subset of]" "[subset of]" "⊂")
376 ("sup" "\\supset" t "&sup;" "[superset of]" "[superset of]" "⊃")
377 ("supset" "\\supset" t "&sup;" "[superset of]" "[superset of]" "⊃")
378 ("nsub" "\\not\\subset" t "&nsub;" "[not a subset of]" "[not a subset of" "⊄")
379 ("sube" "\\subseteq" t "&sube;" "[subset of or equal to]" "[subset of or equal to]" "⊆")
380 ("nsup" "\\not\\supset" t "&nsup;" "[not a superset of]" "[not a superset of]" "⊅")
381 ("supe" "\\supseteq" t "&supe;" "[superset of or equal to]" "[superset of or equal to]" "⊇")
382 ("setminus" "\\setminus" t "&setminus;" "\" "\" "⧵")
383 ("forall" "\\forall" t "&forall;" "[for all]" "[for all]" "∀")
384 ("exist" "\\exists" t "&exist;" "[there exists]" "[there exists]" "∃")
385 ("exists" "\\exists" t "&exist;" "[there exists]" "[there exists]" "∃")
386 ("nexist" "\\nexists" t "&exist;" "[there does not exists]" "[there does not exists]" "∄")
387 ("nexists" "\\nexists" t "&exist;" "[there does not exists]" "[there does not exists]" "∄")
388 ("empty" "\\empty" t "&empty;" "[empty set]" "[empty set]" "∅")
389 ("emptyset" "\\emptyset" t "&empty;" "[empty set]" "[empty set]" "∅")
390 ("isin" "\\in" t "&isin;" "[element of]" "[element of]" "∈")
391 ("in" "\\in" t "&isin;" "[element of]" "[element of]" "∈")
392 ("notin" "\\notin" t "&notin;" "[not an element of]" "[not an element of]" "∉")
393 ("ni" "\\ni" t "&ni;" "[contains as member]" "[contains as member]" "∋")
394 ("nabla" "\\nabla" t "&nabla;" "[nabla]" "[nabla]" "∇")
395 ("ang" "\\angle" t "&ang;" "[angle]" "[angle]" "∠")
396 ("angle" "\\angle" t "&ang;" "[angle]" "[angle]" "∠")
397 ("perp" "\\perp" t "&perp;" "[up tack]" "[up tack]" "⊥")
398 ("sdot" "\\cdot" t "&sdot;" "[dot]" "[dot]" "⋅")
399 ("cdot" "\\cdot" t "&sdot;" "[dot]" "[dot]" "⋅")
400 ("lceil" "\\lceil" t "&lceil;" "[left ceiling]" "[left ceiling]" "⌈")
401 ("rceil" "\\rceil" t "&rceil;" "[right ceiling]" "[right ceiling]" "⌉")
402 ("lfloor" "\\lfloor" t "&lfloor;" "[left floor]" "[left floor]" "⌊")
403 ("rfloor" "\\rfloor" t "&rfloor;" "[right floor]" "[right floor]" "⌋")
404 ("lang" "\\langle" t "&lang;" "<" "<" "⟨")
405 ("rang" "\\rangle" t "&rang;" ">" ">" "⟩")
406 ("hbar" "\\hbar" t "&hbar;" "hbar" "hbar" "ℏ")
407 ("mho" "\\mho" t "&mho;" "mho" "mho" "℧")
409 "** Arrows"
410 ("larr" "\\leftarrow" t "&larr;" "<-" "<-" "←")
411 ("leftarrow" "\\leftarrow" t "&larr;" "<-" "<-" "←")
412 ("gets" "\\gets" t "&larr;" "<-" "<-" "←")
413 ("lArr" "\\Leftarrow" t "&lArr;" "<=" "<=" "⇐")
414 ("Leftarrow" "\\Leftarrow" t "&lArr;" "<=" "<=" "⇐")
415 ("uarr" "\\uparrow" t "&uarr;" "[uparrow]" "[uparrow]" "↑")
416 ("uparrow" "\\uparrow" t "&uarr;" "[uparrow]" "[uparrow]" "↑")
417 ("uArr" "\\Uparrow" t "&uArr;" "[dbluparrow]" "[dbluparrow]" "⇑")
418 ("Uparrow" "\\Uparrow" t "&uArr;" "[dbluparrow]" "[dbluparrow]" "⇑")
419 ("rarr" "\\rightarrow" t "&rarr;" "->" "->" "→")
420 ("to" "\\to" t "&rarr;" "->" "->" "→")
421 ("rightarrow" "\\rightarrow" t "&rarr;" "->" "->" "→")
422 ("rArr" "\\Rightarrow" t "&rArr;" "=>" "=>" "⇒")
423 ("Rightarrow" "\\Rightarrow" t "&rArr;" "=>" "=>" "⇒")
424 ("darr" "\\downarrow" t "&darr;" "[downarrow]" "[downarrow]" "↓")
425 ("downarrow" "\\downarrow" t "&darr;" "[downarrow]" "[downarrow]" "↓")
426 ("dArr" "\\Downarrow" t "&dArr;" "[dbldownarrow]" "[dbldownarrow]" "⇓")
427 ("Downarrow" "\\Downarrow" t "&dArr;" "[dbldownarrow]" "[dbldownarrow]" "⇓")
428 ("harr" "\\leftrightarrow" t "&harr;" "<->" "<->" "↔")
429 ("leftrightarrow" "\\leftrightarrow" t "&harr;" "<->" "<->" "↔")
430 ("hArr" "\\Leftrightarrow" t "&hArr;" "<=>" "<=>" "⇔")
431 ("Leftrightarrow" "\\Leftrightarrow" t "&hArr;" "<=>" "<=>" "⇔")
432 ("crarr" "\\hookleftarrow" t "&crarr;" "<-'" "<-'" "↵")
433 ("hookleftarrow" "\\hookleftarrow" t "&crarr;" "<-'" "<-'" "↵")
435 "** Function names"
436 ("arccos" "\\arccos" t "arccos" "arccos" "arccos" "arccos")
437 ("arcsin" "\\arcsin" t "arcsin" "arcsin" "arcsin" "arcsin")
438 ("arctan" "\\arctan" t "arctan" "arctan" "arctan" "arctan")
439 ("arg" "\\arg" t "arg" "arg" "arg" "arg")
440 ("cos" "\\cos" t "cos" "cos" "cos" "cos")
441 ("cosh" "\\cosh" t "cosh" "cosh" "cosh" "cosh")
442 ("cot" "\\cot" t "cot" "cot" "cot" "cot")
443 ("coth" "\\coth" t "coth" "coth" "coth" "coth")
444 ("csc" "\\csc" t "csc" "csc" "csc" "csc")
445 ("deg" "\\deg" t "&deg;" "deg" "deg" "deg")
446 ("det" "\\det" t "det" "det" "det" "det")
447 ("dim" "\\dim" t "dim" "dim" "dim" "dim")
448 ("exp" "\\exp" t "exp" "exp" "exp" "exp")
449 ("gcd" "\\gcd" t "gcd" "gcd" "gcd" "gcd")
450 ("hom" "\\hom" t "hom" "hom" "hom" "hom")
451 ("inf" "\\inf" t "inf" "inf" "inf" "inf")
452 ("ker" "\\ker" t "ker" "ker" "ker" "ker")
453 ("lg" "\\lg" t "lg" "lg" "lg" "lg")
454 ("lim" "\\lim" t "lim" "lim" "lim" "lim")
455 ("liminf" "\\liminf" t "liminf" "liminf" "liminf" "liminf")
456 ("limsup" "\\limsup" t "limsup" "limsup" "limsup" "limsup")
457 ("ln" "\\ln" t "ln" "ln" "ln" "ln")
458 ("log" "\\log" t "log" "log" "log" "log")
459 ("max" "\\max" t "max" "max" "max" "max")
460 ("min" "\\min" t "min" "min" "min" "min")
461 ("Pr" "\\Pr" t "Pr" "Pr" "Pr" "Pr")
462 ("sec" "\\sec" t "sec" "sec" "sec" "sec")
463 ("sin" "\\sin" t "sin" "sin" "sin" "sin")
464 ("sinh" "\\sinh" t "sinh" "sinh" "sinh" "sinh")
465 ("sup" "\\sup" t "&sup;" "sup" "sup" "sup")
466 ("tan" "\\tan" t "tan" "tan" "tan" "tan")
467 ("tanh" "\\tanh" t "tanh" "tanh" "tanh" "tanh")
469 "** Signs & Symbols"
470 ("bull" "\\textbullet{}" nil "&bull;" "*" "*" "•")
471 ("bullet" "\\textbullet{}" nil "&bull;" "*" "*" "•")
472 ("star" "\\star" t "*" "*" "*" "⋆")
473 ("lowast" "\\ast" t "&lowast;" "*" "*" "∗")
474 ("ast" "\\ast" t "&lowast;" "*" "*" "*")
475 ("odot" "\\odot" t "o" "[circled dot]" "[circled dot]" "ʘ")
476 ("oplus" "\\oplus" t "&oplus;" "[circled plus]" "[circled plus]" "⊕")
477 ("otimes" "\\otimes" t "&otimes;" "[circled times]" "[circled times]" "⊗")
478 ("check" "\\checkmark" t "&checkmark;" "[checkmark]" "[checkmark]" "✓")
479 ("checkmark" "\\checkmark" t "&check;" "[checkmark]" "[checkmark]" "✓")
481 "** Miscellaneous (seldom used)"
482 ("para" "\\P{}" nil "&para;" "[pilcrow]" "¶" "¶")
483 ("ordf" "\\textordfeminine{}" nil "&ordf;" "_a_" "ª" "ª")
484 ("ordm" "\\textordmasculine{}" nil "&ordm;" "_o_" "º" "º")
485 ("cedil" "\\c{}" nil "&cedil;" "[cedilla]" "¸" "¸")
486 ("oline" "\\overline{~}" t "&oline;" "[overline]" "¯" "‾")
487 ("uml" "\\textasciidieresis{}" nil "&uml;" "[diaeresis]" "¨" "¨")
488 ("zwnj" "\\/{}" nil "&zwnj;" "" "" "‌")
489 ("zwj" "" nil "&zwj;" "" "" "‍")
490 ("lrm" "" nil "&lrm;" "" "" "‎")
491 ("rlm" "" nil "&rlm;" "" "" "‏")
493 "** Smilies"
494 ("smile" "\\smile" t "&smile;" ":-)" ":-)" "⌣")
495 ("frown" "\\frown" t "&frown;" ":-(" ":-(" "⌢")
496 ("smiley" "\\smiley{}" nil "&#9786;" ":-)" ":-)" "☺")
497 ("blacksmile" "\\blacksmiley{}" nil "&#9787;" ":-)" ":-)" "☻")
498 ("sad" "\\frownie{}" nil "&#9785;" ":-(" ":-(" "☹")
500 "** Suits"
501 ("clubs" "\\clubsuit" t "&clubs;" "[clubs]" "[clubs]" "♣")
502 ("clubsuit" "\\clubsuit" t "&clubs;" "[clubs]" "[clubs]" "♣")
503 ("spades" "\\spadesuit" t "&spades;" "[spades]" "[spades]" "♠")
504 ("spadesuit" "\\spadesuit" t "&spades;" "[spades]" "[spades]" "♠")
505 ("hearts" "\\heartsuit" t "&hearts;" "[hearts]" "[hearts]" "♥")
506 ("heartsuit" "\\heartsuit" t "&heartsuit;" "[hearts]" "[hearts]" "♥")
507 ("diams" "\\diamondsuit" t "&diams;" "[diamonds]" "[diamonds]" "◆")
508 ("diamondsuit" "\\diamondsuit" t "&diams;" "[diamonds]" "[diamonds]" "◆")
509 ("diamond" "\\diamondsuit" t "&diamond;" "[diamond]" "[diamond]" "◆")
510 ("Diamond" "\\diamondsuit" t "&diamond;" "[diamond]" "[diamond]" "◆")
511 ("loz" "\\lozenge" t "&loz;" "[lozenge]" "[lozenge]" "⧫")
513 "Default entities used in Org-mode to produce special characters.
514 For details see `org-entities-user'.")
516 (defsubst org-entity-get (name)
517 "Get the proper association for NAME from the entity lists.
518 This first checks the user list, then the built-in list."
519 (or (assoc name org-entities-user)
520 (assoc name org-entities)))
522 (defun org-entity-get-representation (name kind)
523 "Get the correct representation of entity NAME for export type KIND.
524 Kind can be any of `latex', `html', `ascii', `latin1', or `utf8'."
525 (let* ((e (org-entity-get name))
526 (n (cdr (assq kind '((latex . 1) (html . 3) (ascii . 4)
527 (latin1 . 5) (utf8 . 6)))))
528 (r (and e n (nth n e))))
529 (if (and e r
530 (not org-entities-ascii-explanatory)
531 (memq kind '(ascii latin1 utf8))
532 (= (string-to-char r) ?\[))
533 (concat "\\" name)
534 r)))
536 (defsubst org-entity-latex-math-p (name)
537 "Does entity NAME require math mode in LaTeX?"
538 (nth 2 (org-entity-get name)))
540 ;; Helpfunctions to create a table for orgmode.org/worg/org-symbols.org
542 (defun org-entities-create-table ()
543 "Create an Org mode table with all entities."
544 (interactive)
545 (let ((pos (point)) e latex mathp html latin utf8 name ascii)
546 (insert "|Name|LaTeX code|LaTeX|HTML code |HTML|ASCII|Latin1|UTF-8\n|-\n")
547 (mapc (lambda (e) (when (listp e)
548 (setq name (car e)
549 latex (nth 1 e)
550 mathp (nth 2 e)
551 html (nth 3 e)
552 ascii (nth 4 e)
553 latin (nth 5 e)
554 utf8 (nth 6 e))
555 (if (equal ascii "|") (setq ascii "\\vert"))
556 (if (equal latin "|") (setq latin "\\vert"))
557 (if (equal utf8 "|") (setq utf8 "\\vert"))
558 (if (equal ascii "=>") (setq ascii "= >"))
559 (if (equal latin "=>") (setq latin "= >"))
560 (insert "|" name
561 "|" (format "=%s=" latex)
562 "|" (format (if mathp "$%s$" "$\\mbox{%s}$")
563 latex)
564 "|" (format "=%s=" html) "|" html
565 "|" ascii "|" latin "|" utf8
566 "|\n")))
567 org-entities)
568 (goto-char pos)
569 (org-table-align)))
571 (defun org-entities-help ()
572 "Create a Help buffer with all available entities."
573 (interactive)
574 (with-output-to-temp-buffer "*Org Entity Help*"
575 (princ "Org-mode entities\n=================\n\n")
576 (let ((ll (append '("* User-defined additions (variable org-entities-user)")
577 org-entities-user
578 org-entities))
579 e latex mathp html latin utf8 name ascii
580 (lastwasstring t)
581 (head (concat
582 "\n"
583 " Symbol Org entity LaTeX code HTML code\n"
584 " -----------------------------------------------------------\n")))
585 (while ll
586 (setq e (pop ll))
587 (if (stringp e)
588 (progn
589 (princ e)
590 (princ "\n")
591 (setq lastwasstring t))
592 (if lastwasstring (princ head))
593 (setq lastwasstring nil)
594 (setq name (car e)
595 latex (nth 1 e)
596 html (nth 3 e)
597 utf8 (nth 6 e))
598 (princ (format " %-8s \\%-16s %-22s %-13s\n"
599 utf8 name latex html))))))
600 (with-current-buffer "*Org Entity Help*"
601 (org-mode))
602 (select-window (get-buffer-window "*Org Entity Help*")))
605 (defun replace-amp ()
606 "Postprocess HTML file to unescape the ampersand."
607 (interactive)
608 (while (re-search-forward "<td>&amp;\\([^<;]+;\\)" nil t)
609 (replace-match (concat "<td>&" (match-string 1)) t t)))
611 (provide 'org-entities)
613 ;; Local variables:
614 ;; coding: utf-8
615 ;; End:
617 ;;; org-entities.el ends here