Fix Org ChangeLog entries and remove arch-tag.
[bpt/emacs.git] / lisp / org / org-entities.el
CommitLineData
ed21c5c8
CD
1;;; org-entities.el --- Support for special entities in Org-mode
2
3ab2c837 3;; Copyright (C) 2010 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
3ab2c837 9;; Version: 7.7
ed21c5c8
CD
10;;
11;; This file is part of GNU Emacs.
12;;
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.
17
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.
22
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
26;;
27;;; Commentary:
28
86fbb8ca
CD
29;;; Code:
30
ed21c5c8
CD
31(require 'org-macs)
32
33(declare-function org-table-align "org-table" ())
34
35(eval-when-compile
36 (require 'cl))
37
38(defgroup org-entities nil
39 "Options concerning entities in Org-mode."
40 :tag "Org Entities"
41 :group 'org)
42
43(defcustom org-entities-ascii-explanatory nil
44 "Non-nil means replace special entities in ASCII.
45For example, this will replace \"\\nsup\" with \"[not a superset of]\"
46in backends where the corresponding character is not available."
47 :group 'org-entities
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
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 "))))
81
82(defconst org-entities
86fbb8ca
CD
83 '(
84 "* Letters"
85 "** Latin"
ed21c5c8 86 ("Agrave" "\\`{A}" nil "&Agrave;" "A" "À" "À")
86fbb8ca 87 ("agrave" "\\`{a}" nil "&agrave;" "a" "à" "à")
ed21c5c8 88 ("Aacute" "\\'{A}" nil "&Aacute;" "A" "Á" "Á")
86fbb8ca 89 ("aacute" "\\'{a}" nil "&aacute;" "a" "á" "á")
ed21c5c8 90 ("Acirc" "\\^{A}" nil "&Acirc;" "A" "Â" "Â")
86fbb8ca 91 ("acirc" "\\^{a}" nil "&acirc;" "a" "â" "â")
ed21c5c8 92 ("Atilde" "\\~{A}" nil "&Atilde;" "A" "Ã" "Ã")
86fbb8ca 93 ("atilde" "\\~{a}" nil "&atilde;" "a" "ã" "ã")
ed21c5c8 94 ("Auml" "\\\"{A}" nil "&Auml;" "Ae" "Ä" "Ä")
86fbb8ca 95 ("auml" "\\\"{a}" nil "&auml;" "ae" "ä" "ä")
ed21c5c8
CD
96 ("Aring" "\\AA{}" nil "&Aring;" "A" "Å" "Å")
97 ("AA" "\\AA{}" nil "&Aring;" "A" "Å" "Å")
ed21c5c8 98 ("aring" "\\aa{}" nil "&aring;" "a" "å" "å")
86fbb8ca 99 ("AElig" "\\AE{}" nil "&AElig;" "AE" "Æ" "Æ")
ed21c5c8 100 ("aelig" "\\ae{}" nil "&aelig;" "ae" "æ" "æ")
86fbb8ca 101 ("Ccedil" "\\c{C}" nil "&Ccedil;" "C" "Ç" "Ç")
ed21c5c8 102 ("ccedil" "\\c{c}" nil "&ccedil;" "c" "ç" "ç")
86fbb8ca 103 ("Egrave" "\\`{E}" nil "&Egrave;" "E" "È" "È")
ed21c5c8 104 ("egrave" "\\`{e}" nil "&egrave;" "e" "è" "è")
86fbb8ca 105 ("Eacute" "\\'{E}" nil "&Eacute;" "E" "É" "É")
ed21c5c8 106 ("eacute" "\\'{e}" nil "&eacute;" "e" "é" "é")
86fbb8ca 107 ("Ecirc" "\\^{E}" nil "&Ecirc;" "E" "Ê" "Ê")
ed21c5c8 108 ("ecirc" "\\^{e}" nil "&ecirc;" "e" "ê" "ê")
86fbb8ca 109 ("Euml" "\\\"{E}" nil "&Euml;" "E" "Ë" "Ë")
ed21c5c8 110 ("euml" "\\\"{e}" nil "&euml;" "e" "ë" "ë")
86fbb8ca 111 ("Igrave" "\\`{I}" nil "&Igrave;" "I" "Ì" "Ì")
ed21c5c8 112 ("igrave" "\\`{i}" nil "&igrave;" "i" "ì" "ì")
86fbb8ca 113 ("Iacute" "\\'{I}" nil "&Iacute;" "I" "Í" "Í")
ed21c5c8 114 ("iacute" "\\'{i}" nil "&iacute;" "i" "í" "í")
86fbb8ca 115 ("Icirc" "\\^{I}" nil "&Icirc;" "I" "Î" "Î")
ed21c5c8 116 ("icirc" "\\^{i}" nil "&icirc;" "i" "î" "î")
86fbb8ca 117 ("Iuml" "\\\"{I}" nil "&Iuml;" "I" "Ï" "Ï")
ed21c5c8 118 ("iuml" "\\\"{i}" nil "&iuml;" "i" "ï" "ï")
86fbb8ca 119 ("Ntilde" "\\~{N}" nil "&Ntilde;" "N" "Ñ" "Ñ")
ed21c5c8 120 ("ntilde" "\\~{n}" nil "&ntilde;" "n" "ñ" "ñ")
86fbb8ca 121 ("Ograve" "\\`{O}" nil "&Ograve;" "O" "Ò" "Ò")
ed21c5c8 122 ("ograve" "\\`{o}" nil "&ograve;" "o" "ò" "ò")
86fbb8ca 123 ("Oacute" "\\'{O}" nil "&Oacute;" "O" "Ó" "Ó")
ed21c5c8 124 ("oacute" "\\'{o}" nil "&oacute;" "o" "ó" "ó")
86fbb8ca 125 ("Ocirc" "\\^{O}" nil "&Ocirc;" "O" "Ô" "Ô")
ed21c5c8 126 ("ocirc" "\\^{o}" nil "&ocirc;" "o" "ô" "ô")
86fbb8ca 127 ("Otilde" "\\~{O}" nil "&Otilde;" "O" "Õ" "Õ")
ed21c5c8 128 ("otilde" "\\~{o}" nil "&otilde;" "o" "õ" "õ")
86fbb8ca 129 ("Ouml" "\\\"{O}" nil "&Ouml;" "Oe" "Ö" "Ö")
ed21c5c8 130 ("ouml" "\\\"{o}" nil "&ouml;" "oe" "ö" "ö")
86fbb8ca 131 ("Oslash" "\\O" nil "&Oslash;" "O" "Ø" "Ø")
ed21c5c8 132 ("oslash" "\\o{}" nil "&oslash;" "o" "ø" "ø")
86fbb8ca
CD
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" "Ù" "Ù")
ed21c5c8 139 ("ugrave" "\\`{u}" nil "&ugrave;" "u" "ù" "ù")
86fbb8ca 140 ("Uacute" "\\'{U}" nil "&Uacute;" "U" "Ú" "Ú")
ed21c5c8 141 ("uacute" "\\'{u}" nil "&uacute;" "u" "ú" "ú")
86fbb8ca 142 ("Ucirc" "\\^{U}" nil "&Ucirc;" "U" "Û" "Û")
ed21c5c8 143 ("ucirc" "\\^{u}" nil "&ucirc;" "u" "û" "û")
86fbb8ca 144 ("Uuml" "\\\"{U}" nil "&Uuml;" "Ue" "Ü" "Ü")
ed21c5c8 145 ("uuml" "\\\"{u}" nil "&uuml;" "ue" "ü" "ü")
86fbb8ca 146 ("Yacute" "\\'{Y}" nil "&Yacute;" "Y" "Ý" "Ý")
ed21c5c8 147 ("yacute" "\\'{y}" nil "&yacute;" "y" "ý" "ý")
86fbb8ca 148 ("Yuml" "\\\"{Y}" nil "&Yuml;" "Y" "Y" "Ÿ")
ed21c5c8 149 ("yuml" "\\\"{y}" nil "&yuml;" "y" "ÿ" "ÿ")
86fbb8ca
CD
150
151 "** Latin (special face)"
ed21c5c8 152 ("fnof" "\\textit{f}" nil "&fnof;" "f" "f" "ƒ")
86fbb8ca
CD
153 ("real" "\\Re" t "&real;" "R" "R" "ℜ")
154 ("image" "\\Im" t "&image;" "I" "I" "ℑ")
155 ("weierp" "\\wp" t "&weierp;" "P" "P" "℘")
156
157 "** Greek"
ed21c5c8 158 ("Alpha" "A" nil "&Alpha;" "Alpha" "Alpha" "Α")
ed21c5c8 159 ("alpha" "\\alpha" t "&alpha;" "alpha" "alpha" "α")
86fbb8ca 160 ("Beta" "B" nil "&Beta;" "Beta" "Beta" "Β")
ed21c5c8 161 ("beta" "\\beta" t "&beta;" "beta" "beta" "β")
86fbb8ca 162 ("Gamma" "\\Gamma" t "&Gamma;" "Gamma" "Gamma" "Γ")
ed21c5c8 163 ("gamma" "\\gamma" t "&gamma;" "gamma" "gamma" "γ")
86fbb8ca 164 ("Delta" "\\Delta" t "&Delta;" "Delta" "Gamma" "Δ")
ed21c5c8 165 ("delta" "\\delta" t "&delta;" "delta" "delta" "δ")
86fbb8ca 166 ("Epsilon" "E" nil "&Epsilon;" "Epsilon" "Epsilon" "Ε")
ed21c5c8
CD
167 ("epsilon" "\\epsilon" t "&epsilon;" "epsilon" "epsilon" "ε")
168 ("varepsilon" "\\varepsilon" t "&epsilon;" "varepsilon" "varepsilon" "ε")
86fbb8ca 169 ("Zeta" "Z" nil "&Zeta;" "Zeta" "Zeta" "Ζ")
ed21c5c8 170 ("zeta" "\\zeta" t "&zeta;" "zeta" "zeta" "ζ")
86fbb8ca 171 ("Eta" "H" nil "&Eta;" "Eta" "Eta" "Η")
ed21c5c8 172 ("eta" "\\eta" t "&eta;" "eta" "eta" "η")
86fbb8ca 173 ("Theta" "\\Theta" t "&Theta;" "Theta" "Theta" "Θ")
ed21c5c8 174 ("theta" "\\theta" t "&theta;" "theta" "theta" "θ")
86fbb8ca
CD
175 ("thetasym" "\\vartheta" t "&thetasym;" "theta" "theta" "ϑ")
176 ("vartheta" "\\vartheta" t "&thetasym;" "theta" "theta" "ϑ")
177 ("Iota" "I" nil "&Iota;" "Iota" "Iota" "Ι")
ed21c5c8 178 ("iota" "\\iota" t "&iota;" "iota" "iota" "ι")
86fbb8ca 179 ("Kappa" "K" nil "&Kappa;" "Kappa" "Kappa" "Κ")
ed21c5c8 180 ("kappa" "\\kappa" t "&kappa;" "kappa" "kappa" "κ")
86fbb8ca 181 ("Lambda" "\\Lambda" t "&Lambda;" "Lambda" "Lambda" "Λ")
ed21c5c8 182 ("lambda" "\\lambda" t "&lambda;" "lambda" "lambda" "λ")
86fbb8ca 183 ("Mu" "M" nil "&Mu;" "Mu" "Mu" "Μ")
ed21c5c8
CD
184 ("mu" "\\mu" t "&mu;" "mu" "mu" "μ")
185 ("nu" "\\nu" t "&nu;" "nu" "nu" "ν")
86fbb8ca
CD
186 ("Nu" "N" nil "&Nu;" "Nu" "Nu" "Ν")
187 ("Xi" "\\Xi" t "&Xi;" "Xi" "Xi" "Ξ")
ed21c5c8 188 ("xi" "\\xi" t "&xi;" "xi" "xi" "ξ")
86fbb8ca 189 ("Omicron" "O" nil "&Omicron;" "Omicron" "Omicron" "Ο")
ed21c5c8 190 ("omicron" "\\textit{o}" nil "&omicron;" "omicron" "omicron" "ο")
86fbb8ca 191 ("Pi" "\\Pi" t "&Pi;" "Pi" "Pi" "Π")
ed21c5c8 192 ("pi" "\\pi" t "&pi;" "pi" "pi" "π")
86fbb8ca 193 ("Rho" "P" nil "&Rho;" "Rho" "Rho" "Ρ")
ed21c5c8 194 ("rho" "\\rho" t "&rho;" "rho" "rho" "ρ")
86fbb8ca
CD
195 ("Sigma" "\\Sigma" t "&Sigma;" "Sigma" "Sigma" "Σ")
196 ("sigma" "\\sigma" t "&sigma;" "sigma" "sigma" "σ")
ed21c5c8
CD
197 ("sigmaf" "\\varsigma" t "&sigmaf;" "sigmaf" "sigmaf" "ς")
198 ("varsigma" "\\varsigma" t "&sigmaf;" "varsigma" "varsigma" "ς")
86fbb8ca
CD
199 ("Tau" "T" nil "&Tau;" "Tau" "Tau" "Τ")
200 ("Upsilon" "\\Upsilon" t "&Upsilon;" "Upsilon" "Upsilon" "Υ")
201 ("upsih" "\\Upsilon" t "&upsih;" "upsilon" "upsilon" "ϒ")
ed21c5c8 202 ("upsilon" "\\upsilon" t "&upsilon;" "upsilon" "upsilon" "υ")
86fbb8ca 203 ("Phi" "\\Phi" t "&Phi;" "Phi" "Phi" "Φ")
ed21c5c8 204 ("phi" "\\phi" t "&phi;" "phi" "phi" "φ")
86fbb8ca 205 ("Chi" "X" nil "&Chi;" "Chi" "Chi" "Χ")
ed21c5c8 206 ("chi" "\\chi" t "&chi;" "chi" "chi" "χ")
86fbb8ca
CD
207 ("acutex" "\\acute x" t "&acute;x" "'x" "'x" "𝑥́")
208 ("Psi" "\\Psi" t "&Psi;" "Psi" "Psi" "Ψ")
ed21c5c8 209 ("psi" "\\psi" t "&psi;" "psi" "psi" "ψ")
86fbb8ca
CD
210 ("tau" "\\tau" t "&tau;" "tau" "tau" "τ")
211 ("Omega" "\\Omega" t "&Omega;" "Omega" "Omega" "Ω")
ed21c5c8 212 ("omega" "\\omega" t "&omega;" "omega" "omega" "ω")
ed21c5c8 213 ("piv" "\\varpi" t "&piv;" "omega-pi" "omega-pi" "ϖ")
86fbb8ca
CD
214 ("partial" "\\partial" t "&part;" "[partial differential]" "[partial differential]" "∂")
215
216 "** Hebrew"
217 ("alefsym" "\\aleph" t "&alefsym;" "aleph" "aleph" "ℵ")
218
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" "þ" "þ")
224
225 "* Punctuation"
226 "** Dots and Marks"
ed21c5c8 227 ("dots" "\\dots{}" nil "&hellip;" "..." "..." "…")
86fbb8ca
CD
228 ("hellip" "\\dots{}" nil "&hellip;" "..." "..." "…")
229 ("middot" "\\textperiodcentered{}" nil "&middot;" "." "·" "·")
230 ("iexcl" "!`" nil "&iexcl;" "!" "¡" "¡")
231 ("iquest" "?`" nil "&iquest;" "?" "¿" "¿")
232
233 "** Dash-like"
234 ("shy" "\\-" nil "&shy;" "" "" "")
235 ("ndash" "--" nil "&ndash;" "-" "-" "–")
236 ("mdash" "---" nil "&mdash;" "--" "--" "—")
237
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;" ">" ">" "›")
251
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]" "‡")
264
265 "** Whitespace"
266 ("nbsp" "~" nil "&nbsp;" " " " " " ")
267 ("ensp" "\\hspace*{.5em}" nil "&ensp;" " " " " " ")
268 ("emsp" "\\hspace*{1em}" nil "&emsp;" " " " " " ")
269 ("thinsp" "\\hspace*{.2em}" nil "&thinsp;" " " " " " ")
270
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" "€")
282
283 "** Property Marks"
284 ("copy" "\\textcopyright{}" nil "&copy;" "(c)" "©" "©")
285 ("reg" "\\textregistered{}" nil "&reg;" "(r)" "®" "®")
ed21c5c8 286 ("trade" "\\texttrademark{}" nil "&trade;" "TM" "TM" "™")
86fbb8ca
CD
287
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" "³" "³")
ed21c5c8 302 ("radic" "\\sqrt{\\,}" t "&radic;" "[square root]" "[square root]" "√")
86fbb8ca
CD
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]" "¯" "¯")
3ab2c837 307 ("deg" "\\textdegree{}" nil "&deg;" "degree" "°" "°")
86fbb8ca
CD
308 ("prime" "\\prime" t "&prime;" "'" "'" "′")
309 ("Prime" "\\prime{}\\prime" t "&Prime;" "''" "''" "″")
ed21c5c8
CD
310 ("infin" "\\propto" t "&infin;" "[infinity]" "[infinity]" "∞")
311 ("infty" "\\infty" t "&infin;" "[infinity]" "[infinity]" "∞")
86fbb8ca
CD
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]" "∧")
ed21c5c8 316 ("wedge" "\\wedge" t "&and;" "[logical and]" "[logical and]" "∧")
86fbb8ca 317 ("lor" "\\lor" t "&or;" "[logical or]" "[logical or]" "∨")
ed21c5c8
CD
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]" "∫")
ed21c5c8
CD
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]" "⊆")
86fbb8ca 339 ("nsup" "\\not\\supset" t "&nsup;" "[not a superset of]" "[not a superset of]" "⊅")
ed21c5c8 340 ("supe" "\\supseteq" t "&supe;" "[superset of or equal to]" "[superset of or equal to]" "⊇")
86fbb8ca
CD
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]" "∠")
ed21c5c8
CD
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;" ">" ">" "⟩")
86fbb8ca
CD
362
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;" "<-'" "<-'" "↵")
388
389 "** Function names"
ed21c5c8
CD
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")
86fbb8ca
CD
422
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]" "✓")
433
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;" "" "" "‏")
445
446 "** Smilies"
447 ("smile" "\\smile" t "&#9786;" ":-)" ":-)" "⌣")
ed21c5c8 448 ("smiley" "\\smiley{}" nil "&#9786;" ":-)" ":-)" "☺")
86fbb8ca
CD
449 ("blacksmile" "\\blacksmiley{}" nil "&#9787;" ":-)" ":-)" "☻")
450 ("sad" "\\frownie{}" nil "&#9785;" ":-(" ":-(" "☹")
451
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]" "◊")
ed21c5c8 463 )
86fbb8ca 464 "Default entities used in Org-mode to produce special characters.
ed21c5c8
CD
465For details see `org-entities-user'.")
466
467(defsubst org-entity-get (name)
468 "Get the proper association for NAME from the entity lists.
469This first checks the user list, then the built-in list."
470 (or (assoc name org-entities-user)
471 (assoc name org-entities)))
472
473(defun org-entity-get-representation (name kind)
474 "Get the correct representation of entity NAME for export type KIND.
475Kind 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)))
486
487(defsubst org-entity-latex-math-p (name)
488 "Does entity NAME require math mode in LaTeX?"
489 (nth 2 (org-entity-get name)))
490
491;; Helpfunctions to create a table for orgmode.org/worg/org-symbols.org
492
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
86fbb8ca
CD
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")))
ed21c5c8
CD
522 (goto-char pos)
523 (org-table-align)))
524
86fbb8ca
CD
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*")))
557
558
ed21c5c8 559(defun replace-amp ()
86fbb8ca 560 "Postprocess HTML file to unescape the ampersand."
ed21c5c8
CD
561 (interactive)
562 (while (re-search-forward "<td>&amp;\\([^<;]+;\\)" nil t)
563 (replace-match (concat "<td>&" (match-string 1)) t t)))
564
565(provide 'org-entities)
566
c50b0f11
GM
567;; Local variables:
568;; coding: utf-8
569;; End:
ed21c5c8 570
5b409b39 571
86fbb8ca 572
ed21c5c8 573;;; org-entities.el ends here