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