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