org-entities.el 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488
  1. ;;; org-entities.el --- Support for special entities in Org-mode
  2. ;; Copyright (C) 2010 Free Software Foundation, Inc.
  3. ;; Author: Carsten Dominik <carsten at orgmode dot org>,
  4. ;; Ulf Stegemann <ulf at zeitform dot de>
  5. ;; Keywords: outlines, calendar, wp
  6. ;; Homepage: http://orgmode.org
  7. ;; Version: 6.34trans
  8. ;;
  9. ;; This file is part of GNU Emacs.
  10. ;;
  11. ;; GNU Emacs is free software: you can redistribute it and/or modify
  12. ;; it under the terms of the GNU General Public License as published by
  13. ;; the Free Software Foundation, either version 3 of the License, or
  14. ;; (at your option) any later version.
  15. ;; GNU Emacs is distributed in the hope that it will be useful,
  16. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. ;; GNU General Public License for more details.
  19. ;; You should have received a copy of the GNU General Public License
  20. ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
  21. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  22. ;;
  23. ;;; Commentary:
  24. (declare-function org-table-align "org-table" ())
  25. (eval-when-compile
  26. (require 'cl))
  27. (defgroup org-entities nil
  28. "Options concerning entities in Org-mode."
  29. :tag "Org Entities"
  30. :group 'org)
  31. (defcustom org-entities-ascii-explanatory nil
  32. "Non-nil means replace special entities in ASCII.
  33. For example, this will replace \"\\nsup\" with \"[not a superset of]\"
  34. in backends where the corresponding character is not available."
  35. :group 'org-entities
  36. :type 'boolean)
  37. (defcustom org-entities-user nil
  38. "User-defined entities used in Org-mode to preduce special characters.
  39. Each entry in this list is a list of strings. It associate the name
  40. of the entity that can be inserted into an Org file as \\name with the
  41. appropriate replacements for the different export backends. The order
  42. of the fields is he following
  43. name As a string, without the leading backslash
  44. LaTeX replacement In ready LaTeX, no further processing will take place
  45. LaTeX mathp A Boolean, either t or nil. t if this entity needs
  46. to be in math mode.
  47. HTML replacement In ready HTML, no further processing will take place.
  48. Usually this will be an &...; entity.
  49. ASCII replacement Plain ASCII, no extensions. Symbols that cannot be
  50. represented will be written out as an explanatory text.
  51. But see the variable `org-entities-ascii-keep-macro-form'.
  52. Latin1 replacement Use the special characters available in latin1.
  53. utf-8 replacement Use special character available in utf-8."
  54. :group 'org-entities
  55. :type '(repeat
  56. (list
  57. (string :tag "name ")
  58. (string :tag "LaTeX ")
  59. (boolean :tag "Require LaTeX math?")
  60. (string :tag "HTML ")
  61. (string :tag "ASCII ")
  62. (string :tag "Latin1")
  63. (string :tag "utf-8 "))))
  64. (defconst org-entities
  65. '(("nbsp" "~" nil "&nbsp;" " " " " " ")
  66. ("iexcl" "!`" nil "&iexcl;" "!" "¡" "¡")
  67. ("cent" "\\textcent{}" nil "&cent;" "cent" "¢" "¢")
  68. ("pound" "\\pounds{}" nil "&pound;" "pound" "£" "£")
  69. ("curren" "\\textcurrency{}" nil "&curren;" "curr." "¤" "¤")
  70. ("yen" "\\textyen{}" nil "&yen;" "yen" "¥" "¥")
  71. ("brvbar" "\\textbrokenbar{}" nil "&brvbar;" "|" "¦" "¦")
  72. ("vert" "\\vert{}" t "&#124;" "|" "|" "|")
  73. ("sect" "\\S" nil "&sect;" "paragraph" "§" "§")
  74. ("uml" "\\textasciidieresis{}" nil "&uml;" "[diaeresis]" "¨" "¨")
  75. ("copy" "\\textcopyright{}" nil "&copy;" "(c)" "©" "©")
  76. ("ordf" "\\textordfeminine{}" nil "&ordf;" "_a_" "ª" "ª")
  77. ("laquo" "\\guillemotleft{}" nil "&laquo;" "<<" "«" "«")
  78. ("not" "\\textlnot{}" nil "&not;" "[angled dash]" "¬" "¬")
  79. ("shy" "\\-" nil "&shy;" "" "" "")
  80. ("reg" "\\textregistered{}" nil "&reg;" "(r)" "®" "®")
  81. ("macr" "\\textasciimacron{}" nil "&macr;" "[macron]" "¯" "¯")
  82. ("deg" "\\textdegree{}" nil "deg" "degree" "°" "°")
  83. ("pm" "\\textpm{}" nil "&plusmn;" "+-" "±" "±")
  84. ("plusmn" "\\textpm{}" nil "&plusmn;" "+-" "±" "±")
  85. ("sup2" "\\texttwosuperior{}" nil "&sup2;" "^2" "²" "²")
  86. ("sup3" "\\textthreesuperior{}" nil "&sup3;" "^3" "³" "³")
  87. ("acutex" "\\acute x" t "&acute;x" "'x" "'x" "𝑥́")
  88. ("micro" "\\textmu{}" nil "&micro;" "micro" "µ" "µ")
  89. ("para" "\\P{}" nil "&para;" "[pilcrow]" "¶" "¶")
  90. ("middot" "\\textperiodcentered{}" nil "&middot;" "." "·" "·")
  91. ("odot" "\\odot" t "o" "[circled dot]" "[circled dot]" "ʘ")
  92. ("star" "\\star" t "*" "*" "*" "⋆")
  93. ("cedil" "\\c{}" nil "&cedil;" "[cedilla]" "¸" "¸")
  94. ("sup1" "\\textonesuperior{}" nil "&sup1;" "^1" "¹" "¹")
  95. ("ordm" "\\textordmasculine{}" nil "&ordm;" "_o_" "º" "º")
  96. ("raquo" "\\guillemotright{}" nil "&raquo;" ">>" "»" "»")
  97. ("iquest" "?`" nil "&iquest;" "?" "¿" "¿")
  98. ("Agrave" "\\`{A}" nil "&Agrave;" "A" "À" "À")
  99. ("Aacute" "\\'{A}" nil "&Aacute;" "A" "Á" "Á")
  100. ("Acirc" "\\^{A}" nil "&Acirc;" "A" "Â" "Â")
  101. ("Atilde" "\\~{A}" nil "&Atilde;" "A" "Ã" "Ã")
  102. ("Auml" "\\\"{A}" nil "&Auml;" "Ae" "Ä" "Ä")
  103. ("Aring" "\\AA{}" nil "&Aring;" "A" "Å" "Å")
  104. ("AA" "\\AA{}" nil "&Aring;" "A" "Å" "Å")
  105. ("AElig" "\\AE{}" nil "&AElig;" "AE" "Æ" "Æ")
  106. ("Ccedil" "\\c{C}" nil "&Ccedil;" "C" "Ç" "Ç")
  107. ("Egrave" "\\`{E}" nil "&Egrave;" "E" "È" "È")
  108. ("Eacute" "\\'{E}" nil "&Eacute;" "E" "É" "É")
  109. ("Ecirc" "\\^{E}" nil "&Ecirc;" "E" "Ê" "Ê")
  110. ("Euml" "\\\"{E}" nil "&Euml;" "E" "Ë" "Ë")
  111. ("Igrave" "\\`{I}" nil "&Igrave;" "I" "Ì" "Ì")
  112. ("Iacute" "\\'{I}" nil "&Iacute;" "I" "Í" "Í")
  113. ("Icirc" "\\^{I}" nil "&Icirc;" "I" "Î" "Î")
  114. ("Iuml" "\\\"{I}" nil "&Iuml;" "I" "Ï" "Ï")
  115. ("ETH" "\\DH{}" nil "&ETH;" "D" "Ð" "Ð")
  116. ("Ntilde" "\\~{N}" nil "&Ntilde;" "N" "Ñ" "Ñ")
  117. ("Ograve" "\\`{O}" nil "&Ograve;" "O" "Ò" "Ò")
  118. ("Oacute" "\\'{O}" nil "&Oacute;" "O" "Ó" "Ó")
  119. ("Ocirc" "\\^{O}" nil "&Ocirc;" "O" "Ô" "Ô")
  120. ("Otilde" "\\~{O}" nil "&Otilde;" "O" "Õ" "Õ")
  121. ("Ouml" "\\\"{O}" nil "&Ouml;" "Oe" "Ö" "Ö")
  122. ("times" "\\texttimes{}" nil "&times;" "*" "×" "×")
  123. ("Oslash" "\\O" nil "&Oslash;" "O" "Ø" "Ø")
  124. ("Ugrave" "\\`{U}" nil "&Ugrave;" "U" "Ù" "Ù")
  125. ("Uacute" "\\'{U}" nil "&Uacute;" "U" "Ú" "Ú")
  126. ("Ucirc" "\\^{U}" nil "&Ucirc;" "U" "Û" "Û")
  127. ("Uuml" "\\\"{U}" nil "&Uuml;" "Ue" "Ü" "Ü")
  128. ("Yacute" "\\'{Y}" nil "&Yacute;" "Y" "Ý" "Ý")
  129. ("THORN" "\\TH{}" nil "&THORN;" "TH" "Þ" "Þ")
  130. ("szlig" "\\ss{}" nil "&szlig;" "ss" "ß" "ß")
  131. ("agrave" "\\`{a}" nil "&agrave;" "a" "à" "à")
  132. ("aacute" "\\'{a}" nil "&aacute;" "a" "á" "á")
  133. ("acirc" "\\^{a}" nil "&acirc;" "a" "â" "â")
  134. ("atilde" "\\~{a}" nil "&atilde;" "a" "ã" "ã")
  135. ("auml" "\\\"{a}" nil "&auml;" "ae" "ä" "ä")
  136. ("aring" "\\aa{}" nil "&aring;" "a" "å" "å")
  137. ("aelig" "\\ae{}" nil "&aelig;" "ae" "æ" "æ")
  138. ("ccedil" "\\c{c}" nil "&ccedil;" "c" "ç" "ç")
  139. ("checkmark" "\\checkmark" t "&#10003;" "[checkmark]" "[checkmark]" "✓")
  140. ("egrave" "\\`{e}" nil "&egrave;" "e" "è" "è")
  141. ("eacute" "\\'{e}" nil "&eacute;" "e" "é" "é")
  142. ("ecirc" "\\^{e}" nil "&ecirc;" "e" "ê" "ê")
  143. ("euml" "\\\"{e}" nil "&euml;" "e" "ë" "ë")
  144. ("igrave" "\\`{i}" nil "&igrave;" "i" "ì" "ì")
  145. ("iacute" "\\'{i}" nil "&iacute;" "i" "í" "í")
  146. ("icirc" "\\^{i}" nil "&icirc;" "i" "î" "î")
  147. ("iuml" "\\\"{i}" nil "&iuml;" "i" "ï" "ï")
  148. ("eth" "\\dh{}" nil "&eth;" "dh" "ð" "ð")
  149. ("ntilde" "\\~{n}" nil "&ntilde;" "n" "ñ" "ñ")
  150. ("ograve" "\\`{o}" nil "&ograve;" "o" "ò" "ò")
  151. ("oacute" "\\'{o}" nil "&oacute;" "o" "ó" "ó")
  152. ("ocirc" "\\^{o}" nil "&ocirc;" "o" "ô" "ô")
  153. ("otilde" "\\~{o}" nil "&otilde;" "o" "õ" "õ")
  154. ("ouml" "\\\"{o}" nil "&ouml;" "oe" "ö" "ö")
  155. ("oslash" "\\o{}" nil "&oslash;" "o" "ø" "ø")
  156. ("ugrave" "\\`{u}" nil "&ugrave;" "u" "ù" "ù")
  157. ("uacute" "\\'{u}" nil "&uacute;" "u" "ú" "ú")
  158. ("ucirc" "\\^{u}" nil "&ucirc;" "u" "û" "û")
  159. ("uuml" "\\\"{u}" nil "&uuml;" "ue" "ü" "ü")
  160. ("yacute" "\\'{y}" nil "&yacute;" "y" "ý" "ý")
  161. ("thorn" "\\th{}" nil "&thorn;" "th" "þ" "þ")
  162. ("yuml" "\\\"{y}" nil "&yuml;" "y" "ÿ" "ÿ")
  163. ("fnof" "\\textit{f}" nil "&fnof;" "f" "f" "ƒ")
  164. ("Alpha" "A" nil "&Alpha;" "Alpha" "Alpha" "Α")
  165. ("Beta" "B" nil "&Beta;" "Beta" "Beta" "Β")
  166. ("Gamma" "\\Gamma" t "&Gamma;" "Gamma" "Gamma" "Γ")
  167. ("Delta" "\\Delta" t "&Delta;" "Delta" "Gamma" "Δ")
  168. ("Epsilon" "E" nil "&Epsilon;" "Epsilon" "Epsilon" "Ε")
  169. ("Zeta" "Z" nil "&Zeta;" "Zeta" "Zeta" "Ζ")
  170. ("Eta" "H" nil "&Eta;" "Eta" "Eta" "Η")
  171. ("Theta" "\\Theta" t "&Theta;" "Theta" "Theta" "Θ")
  172. ("Iota" "I" nil "&Iota;" "Iota" "Iota" "Ι")
  173. ("Kappa" "K" nil "&Kappa;" "Kappa" "Kappa" "Κ")
  174. ("Lambda" "\\Lambda" t "&Lambda;" "Lambda" "Lambda" "Λ")
  175. ("Mu" "M" nil "&Mu;" "Mu" "Mu" "Μ")
  176. ("Nu" "N" nil "&Nu;" "Nu" "Nu" "Ν")
  177. ("Xi" "\\Xi" t "&Xi;" "Xi" "Xi" "Ξ")
  178. ("Omicron" "O" nil "&Omicron;" "Omicron" "Omicron" "Ο")
  179. ("Pi" "\\Pi" t "&Pi;" "Pi" "Pi" "Π")
  180. ("Rho" "P" nil "&Rho;" "Rho" "Rho" "Ρ")
  181. ("Sigma" "\\Sigma" t "&Sigma;" "Sigma" "Sigma" "Σ")
  182. ("Tau" "T" nil "&Tau;" "Tau" "Tau" "Τ")
  183. ("Upsilon" "\\Upsilon" t "&Upsilon;" "Upsilon" "Upsilon" "Υ")
  184. ("Phi" "\\Phi" t "&Phi;" "Phi" "Phi" "Φ")
  185. ("Chi" "X" nil "&Chi;" "Chi" "Chi" "Χ")
  186. ("Psi" "\\Psi" t "&Psi;" "Psi" "Psi" "Ψ")
  187. ("Omega" "\\Omega" t "&Omega;" "Omega" "Omega" "Ω")
  188. ("alpha" "\\alpha" t "&alpha;" "alpha" "alpha" "α")
  189. ("beta" "\\beta" t "&beta;" "beta" "beta" "β")
  190. ("gamma" "\\gamma" t "&gamma;" "gamma" "gamma" "γ")
  191. ("delta" "\\delta" t "&delta;" "delta" "delta" "δ")
  192. ("epsilon" "\\epsilon" t "&epsilon;" "epsilon" "epsilon" "ε")
  193. ("varepsilon" "\\varepsilon" t "&epsilon;" "varepsilon" "varepsilon" "ε")
  194. ("zeta" "\\zeta" t "&zeta;" "zeta" "zeta" "ζ")
  195. ("eta" "\\eta" t "&eta;" "eta" "eta" "η")
  196. ("theta" "\\theta" t "&theta;" "theta" "theta" "θ")
  197. ("iota" "\\iota" t "&iota;" "iota" "iota" "ι")
  198. ("kappa" "\\kappa" t "&kappa;" "kappa" "kappa" "κ")
  199. ("lambda" "\\lambda" t "&lambda;" "lambda" "lambda" "λ")
  200. ("mu" "\\mu" t "&mu;" "mu" "mu" "μ")
  201. ("nu" "\\nu" t "&nu;" "nu" "nu" "ν")
  202. ("xi" "\\xi" t "&xi;" "xi" "xi" "ξ")
  203. ("omicron" "\\textit{o}" nil "&omicron;" "omicron" "omicron" "ο")
  204. ("pi" "\\pi" t "&pi;" "pi" "pi" "π")
  205. ("rho" "\\rho" t "&rho;" "rho" "rho" "ρ")
  206. ("sigmaf" "\\varsigma" t "&sigmaf;" "sigmaf" "sigmaf" "ς")
  207. ("varsigma" "\\varsigma" t "&sigmaf;" "varsigma" "varsigma" "ς")
  208. ("sigma" "\\sigma" t "&sigma;" "sigma" "sigma" "σ")
  209. ("tau" "\\tau" t "&tau;" "tau" "tau" "τ")
  210. ("upsilon" "\\upsilon" t "&upsilon;" "upsilon" "upsilon" "υ")
  211. ("phi" "\\phi" t "&phi;" "phi" "phi" "φ")
  212. ("chi" "\\chi" t "&chi;" "chi" "chi" "χ")
  213. ("psi" "\\psi" t "&psi;" "psi" "psi" "ψ")
  214. ("omega" "\\omega" t "&omega;" "omega" "omega" "ω")
  215. ("thetasym" "\\vartheta" t "&thetasym;" "theta" "theta" "ϑ")
  216. ("vartheta" "\\vartheta" t "&thetasym;" "theta" "theta" "ϑ")
  217. ("upsih" "\\Upsilon" t "&upsih;" "upsilon" "upsilon" "ϒ")
  218. ("piv" "\\varpi" t "&piv;" "omega-pi" "omega-pi" "ϖ")
  219. ("bull" "\\textbullet{}" nil "&bull;" "*" "*" "•")
  220. ("bullet" "\\textbullet{}" nil "&bull;" "*" "*" "•")
  221. ("hellip" "\\dots{}" nil "&hellip;" "..." "..." "…")
  222. ("dots" "\\dots{}" nil "&hellip;" "..." "..." "…")
  223. ("prime" "\\prime" t "&prime;" "'" "'" "′")
  224. ("Prime" "\\prime{}\\prime" t "&Prime;" "''" "''" "″")
  225. ("oline" "\\overline{~}" t "&oline;" "[overline]" "¯" "‾")
  226. ("frasl" "/" nil "&frasl;" "/" "/" "⁄")
  227. ("weierp" "\\wp" t "&weierp;" "P" "P" "℘")
  228. ("image" "\\Im" t "&image;" "I" "I" "ℑ")
  229. ("real" "\\Re" t "&real;" "R" "R" "ℜ")
  230. ("trade" "\\texttrademark{}" nil "&trade;" "TM" "TM" "™")
  231. ("alefsym" "\\aleph" t "&alefsym;" "aleph" "aleph" "ℵ")
  232. ("larr" "\\leftarrow" t "&larr;" "<-" "<-" "←")
  233. ("leftarrow" "\\leftarrow" t "&larr;" "<-" "<-" "←")
  234. ("gets" "\\gets" t "&larr;" "<-" "<-" "←")
  235. ("uarr" "\\uparrow" t "&uarr;" "[uparrow]" "[uparrow]" "↑")
  236. ("uparrow" "\\uparrow" t "&uarr;" "[uparrow]" "[uparrow]" "↑")
  237. ("rarr" "\\rightarrow" t "&rarr;" "->" "->" "→")
  238. ("to" "\\to" t "&rarr;" "->" "->" "→")
  239. ("rightarrow" "\\rightarrow" t "&rarr;" "->" "->" "→")
  240. ("darr" "\\downarrow" t "&darr;" "[downarrow]" "[downarrow]" "↓")
  241. ("downarrow" "\\downarrow" t "&darr;" "[downarrow]" "[downarrow]" "↓")
  242. ("harr" "\\leftrightarrow" t "&harr;" "<->" "<->" "↔")
  243. ("leftrightarrow" "\\leftrightarrow" t "&harr;" "<->" "<->" "↔")
  244. ("crarr" "\\hookleftarrow" t "&crarr;" "<-'" "<-'" "↵")
  245. ("hookleftarrow" "\\hookleftarrow" t "&crarr;" "<-'" "<-'" "↵")
  246. ("lArr" "\\Leftarrow" t "&lArr;" "<=" "<=" "⇐")
  247. ("Leftarrow" "\\Leftarrow" t "&lArr;" "<=" "<=" "⇐")
  248. ("uArr" "\\Uparrow" t "&uArr;" "[dbluparrow]" "[dbluparrow]" "⇑")
  249. ("Uparrow" "\\Uparrow" t "&uArr;" "[dbluparrow]" "[dbluparrow]" "⇑")
  250. ("rArr" "\\Rightarrow" t "&rArr;" "=>" "=>" "⇒")
  251. ("Rightarrow" "\\Rightarrow" t "&rArr;" "=>" "=>" "⇒")
  252. ("dArr" "\\Downarrow" t "&dArr;" "[dbldownarrow]" "[dbldownarrow]" "⇓")
  253. ("Downarrow" "\\Downarrow" t "&dArr;" "[dbldownarrow]" "[dbldownarrow]" "⇓")
  254. ("hArr" "\\Leftrightarrow" t "&hArr;" "<=>" "<=>" "⇔")
  255. ("Leftrightarrow" "\\Leftrightarrow" t "&hArr;" "<=>" "<=>" "⇔")
  256. ("forall" "\\forall" t "&forall;" "[for all]" "[for all]" "∀")
  257. ("partial" "\\partial" t "&part;" "[partial differential]" "[partial differential]" "∂")
  258. ("exist" "\\exists" t "&exist;" "[there exists]" "[there exists]" "∃")
  259. ("exists" "\\exists" t "&exist;" "[there exists]" "[there exists]" "∃")
  260. ("empty" "\\empty" t "&empty;" "[empty set]" "[empty set]" "∅")
  261. ("emptyset" "\\emptyset" t "&empty;" "[empty set]" "[empty set]" "∅")
  262. ("nabla" "\\nabla" t "&nabla;" "[nabla]" "[nabla]" "∇")
  263. ("isin" "\\in" t "&isin;" "[element of]" "[element of]" "∈")
  264. ("in" "\\in" t "&isin;" "[element of]" "[element of]" "∈")
  265. ("notin" "\\notin" t "&notin;" "[not an element of]" "[not an element of]" "∉")
  266. ("ni" "\\ni" t "&ni;" "[contains as member]" "[contains as member]" "∋")
  267. ("prod" "\\prod" t "&prod;" "[product]" "[n-ary product]" "∏")
  268. ("sum" "\\sum" t "&sum;" "[sum]" "[sum]" "∑")
  269. ; ("minus" "\\minus" t "&minus;" "-" "-" "−")
  270. ("minus" "-" t "&minus;" "-" "-" "−")
  271. ("lowast" "\\ast" t "&lowast;" "*" "*" "∗")
  272. ("ast" "\\ast" t "&lowast;" "*" "*" "*")
  273. ("radic" "\\sqrt{\\,}" t "&radic;" "[square root]" "[square root]" "√")
  274. ("prop" "\\propto" t "&prop;" "[proportional to]" "[proportional to]" "∝")
  275. ("proptp" "\\propto" t "&prop;" "[proportional to]" "[proportional to]" "∝")
  276. ("infin" "\\propto" t "&infin;" "[infinity]" "[infinity]" "∞")
  277. ("infty" "\\infty" t "&infin;" "[infinity]" "[infinity]" "∞")
  278. ("ang" "\\angle" t "&ang;" "[angle]" "[angle]" "∠")
  279. ("angle" "\\angle" t "&ang;" "[angle]" "[angle]" "∠")
  280. ("and" "\\wedge" t "&and;" "[logical and]" "[logical and]" "∧")
  281. ("wedge" "\\wedge" t "&and;" "[logical and]" "[logical and]" "∧")
  282. ("or" "\\vee" t "&or;" "[logical or]" "[logical or]" "∨")
  283. ("vee" "\\vee" t "&or;" "[logical or]" "[logical or]" "∨")
  284. ("cap" "\\cap" t "&cap;" "[intersection]" "[intersection]" "∩")
  285. ("cup" "\\cup" t "&cup;" "[union]" "[union]" "∪")
  286. ("int" "\\int" t "&int;" "[integral]" "[integral]" "∫")
  287. ; ("there4" "\\uptherefore" t "&there4;" "[therefore]" "[therefore]" "∴")
  288. ("there4" "\\therefore" t "&there4;" "[therefore]" "[therefore]" "∴")
  289. ("sim" "\\sim" t "&sim;" "~" "~" "∼")
  290. ("cong" "\\cong" t "&cong;" "[approx. equal to]" "[approx. equal to]" "≅")
  291. ("simeq" "\\simeq" t "&cong;" "[approx. equal to]" "[approx. equal to]" "≅")
  292. ("asymp" "\\asymp" t "&asymp;" "[almost equal to]" "[almost equal to]" "≈")
  293. ("approx" "\\approx" t "&asymp;" "[almost equal to]" "[almost equal to]" "≈")
  294. ("ne" "\\ne" t "&ne;" "[not equal to]" "[not equal to]" "≠")
  295. ("neq" "\\neq" t "&ne;" "[not equal to]" "[not equal to]" "≠")
  296. ("equiv" "\\equiv" t "&equiv;" "[identical to]" "[identical to]" "≡")
  297. ("le" "\\le" t "&le;" "<=" "<=" "≤")
  298. ("ge" "\\ge" t "&ge;" ">=" ">=" "≥")
  299. ("sub" "\\subset" t "&sub;" "[subset of]" "[subset of]" "⊂")
  300. ("subset" "\\subset" t "&sub;" "[subset of]" "[subset of]" "⊂")
  301. ("sup" "\\supset" t "&sup;" "[superset of]" "[superset of]" "⊃")
  302. ("supset" "\\supset" t "&sup;" "[superset of]" "[superset of]" "⊃")
  303. ("nsub" "\\not\\subset" t "&nsub;" "[not a subset of]" "[not a subset of" "⊄")
  304. ("sube" "\\subseteq" t "&sube;" "[subset of or equal to]" "[subset of or equal to]" "⊆")
  305. ("supe" "\\supseteq" t "&supe;" "[superset of or equal to]" "[superset of or equal to]" "⊇")
  306. ("oplus" "\\oplus" t "&oplus;" "[circled plus]" "[circled plus]" "⊕")
  307. ("otimes" "\\otimes" t "&otimes;" "[circled times]" "[circled times]" "⊗")
  308. ("perp" "\\perp" t "&perp;" "[up tack]" "[up tack]" "⊥")
  309. ("sdot" "\\cdot" t "&sdot;" "[dot]" "[dot]" "⋅")
  310. ("cdot" "\\cdot" t "&sdot;" "[dot]" "[dot]" "⋅")
  311. ("lceil" "\\lceil" t "&lceil;" "[left ceiling]" "[left ceiling]" "⌈")
  312. ("rceil" "\\rceil" t "&rceil;" "[right ceiling]" "[right ceiling]" "⌉")
  313. ("lfloor" "\\lfloor" t "&lfloor;" "[left floor]" "[left floor]" "⌊")
  314. ("rfloor" "\\rfloor" t "&rfloor;" "[right floor]" "[right floor]" "⌋")
  315. ("lang" "\\langle" t "&lang;" "<" "<" "⟨")
  316. ("rang" "\\rangle" t "&rang;" ">" ">" "⟩")
  317. ("loz" "\\diamond" t "&loz;" "[lozenge]" "[lozenge]" "◊")
  318. ("Diamond" "\\diamond" t "&diamond;" "[diamond]" "[diamond]" "⋄")
  319. ("spades" "\\spadesuit" t "&spades;" "[spades]" "[spades]" "♠")
  320. ("spadesuit" "\\spadesuit" t "&spades;" "[spades]" "[spades]" "♠")
  321. ("clubs" "\\clubsuit" t "&clubs;" "[clubs]" "[clubs]" "♣")
  322. ("clubsuit" "\\clubsuit" t "&clubs;" "[clubs]" "[clubs]" "♣")
  323. ("hearts" "\\heartsuit" t "&hearts;" "[hearts]" "[hearts]" "♥")
  324. ("heartsuit" "\\heartsuit" t "&heartsuit;" "[hearts]" "[hearts]" "♥")
  325. ("diamondsuit" "\\diamondsuit" t "&diams;" "[diamonds]" "[diamonds]" "♦")
  326. ("diams" "\\diamondsuit" t "&diams;" "[diamonds]" "[diamonds]" "♦")
  327. ("smile" "\\smile" t "&#9786;" ":-)" ":-)" "⌣")
  328. ("blacksmile" "\\blacksmiley{}" nil "&#9787;" ":-)" ":-)" "☻")
  329. ("sad" "\\frownie{}" nil "&#9785;" ":-(" ":-(" "☹")
  330. ("quot" "\\textquotedbl{}" nil "&quot;" "\"" "\"" "\"")
  331. ("amp" "\\&" nil "&amp;" "&" "&" "&")
  332. ("lt" "\\textless{}" nil "&lt;" "<" "<" "<")
  333. ("gt" "\\textgreater{}" nil "&gt;" ">" ">" ">")
  334. ("OElig" "\\OE{}" nil "&OElig;" "OE" "OE" "Œ")
  335. ("oelig" "\\oe{}" nil "&oelig;" "oe" "oe" "œ")
  336. ("Scaron" "\\v{S}" nil "&Scaron;" "S" "S" "Š")
  337. ("scaron" "\\v{s}" nil "&scaron;" "s" "s" "š")
  338. ("Yuml" "\\\"{Y}" nil "&Yuml;" "Y" "Y" "Ÿ")
  339. ("circ" "\\circ" t "&circ;" "^" "^" "ˆ")
  340. ("tilde" "\\~{}" nil "&tilde;" "~" "~" "~")
  341. ("ensp" "\\hspace*{.5em}" nil "&ensp;" " " " " " ")
  342. ("emsp" "\\hspace*{1em}" nil "&emsp;" " " " " " ")
  343. ("thinsp" "\\hspace*{.2em}" nil "&thinsp;" " " " " " ")
  344. ("zwnj" "\\/{}" nil "&zwnj;" "" "" "‌")
  345. ("zwj" "" nil "&zwj;" "" "" "‍")
  346. ("lrm" "" nil "&lrm;" "" "" "‎")
  347. ("rlm" "" nil "&rlm;" "" "" "‏")
  348. ("ndash" "--" nil "&ndash;" "-" "-" "–")
  349. ("mdash" "---" nil "&mdash;" "--" "--" "—")
  350. ("lsquo" "\\textquoteleft{}" nil "&lsquo;" "`" "`" "‘")
  351. ("rsquo" "\\textquoteright{}" nil "&rsquo;" "'" "'" "’")
  352. ("sbquo" "\\quotesinglbase{}" nil "&sbquo;" "," "," "‚")
  353. ("ldquo" "\\textquotedblleft{}" nil "&ldquo;" "\"" "\"" "“")
  354. ("rdquo" "\\textquotedblright{}" nil "&rdquo;" "\"" "\"" "”")
  355. ("bdquo" "\\quotedblbase{}" nil "&bdquo;" "\"" "\"" "„")
  356. ("dagger" "\\textdagger{}" nil "&dagger;" "[dagger]" "[dagger]" "†")
  357. ("Dagger" "\\textdaggerdbl{}" nil "&Dagger;" "[doubledagger]" "[doubledagger]" "‡")
  358. ("permil" "\\textperthousand{}" nil "&permil;" "per thousand" "per thousand" "‰")
  359. ("lsaquo" "\\guilsinglleft{}" nil "&lsaquo;" "<" "<" "‹")
  360. ("rsaquo" "\\guilsinglright{}" nil "&rsaquo;" ">" ">" "›")
  361. ("euro" "\\texteuro{}" nil "&euro;" "EUR" "EUR" "€")
  362. ("EUR" "\\EUR{}" nil "&euro;" "EUR" "EUR" "€")
  363. ("EURdig" "\\EURdig{}" nil "&euro;" "EUR" "EUR" "€")
  364. ("EURhv" "\\EURhv{}" nil "&euro;" "EUR" "EUR" "€")
  365. ("EURcr" "\\EURcr{}" nil "&euro;" "EUR" "EUR" "€")
  366. ("EURtm" "\\EURtm{}" nil "&euro;" "EUR" "EUR" "€")
  367. ("arccos" "\\arccos" t "arccos" "arccos" "arccos" "arccos")
  368. ("arcsin" "\\arcsin" t "arcsin" "arcsin" "arcsin" "arcsin")
  369. ("arctan" "\\arctan" t "arctan" "arctan" "arctan" "arctan")
  370. ("arg" "\\arg" t "arg" "arg" "arg" "arg")
  371. ("cos" "\\cos" t "cos" "cos" "cos" "cos")
  372. ("cosh" "\\cosh" t "cosh" "cosh" "cosh" "cosh")
  373. ("cot" "\\cot" t "cot" "cot" "cot" "cot")
  374. ("coth" "\\coth" t "coth" "coth" "coth" "coth")
  375. ("csc" "\\csc" t "csc" "csc" "csc" "csc")
  376. ("deg" "\\deg" t "&deg;" "deg" "deg" "deg")
  377. ("det" "\\det" t "det" "det" "det" "det")
  378. ("dim" "\\dim" t "dim" "dim" "dim" "dim")
  379. ("exp" "\\exp" t "exp" "exp" "exp" "exp")
  380. ("gcd" "\\gcd" t "gcd" "gcd" "gcd" "gcd")
  381. ("hom" "\\hom" t "hom" "hom" "hom" "hom")
  382. ("inf" "\\inf" t "inf" "inf" "inf" "inf")
  383. ("ker" "\\ker" t "ker" "ker" "ker" "ker")
  384. ("lg" "\\lg" t "lg" "lg" "lg" "lg")
  385. ("lim" "\\lim" t "lim" "lim" "lim" "lim")
  386. ("liminf" "\\liminf" t "liminf" "liminf" "liminf" "liminf")
  387. ("limsup" "\\limsup" t "limsup" "limsup" "limsup" "limsup")
  388. ("ln" "\\ln" t "ln" "ln" "ln" "ln")
  389. ("log" "\\log" t "log" "log" "log" "log")
  390. ("max" "\\max" t "max" "max" "max" "max")
  391. ("min" "\\min" t "min" "min" "min" "min")
  392. ("Pr" "\\Pr" t "Pr" "Pr" "Pr" "Pr")
  393. ("sec" "\\sec" t "sec" "sec" "sec" "sec")
  394. ("sin" "\\sin" t "sin" "sin" "sin" "sin")
  395. ("sinh" "\\sinh" t "sinh" "sinh" "sinh" "sinh")
  396. ("sup" "\\sup" t "&sup;" "sup" "sup" "sup")
  397. ("tan" "\\tan" t "tan" "tan" "tan" "tan")
  398. ("tanh" "\\tanh" t "tanh" "tanh" "tanh" "tanh")
  399. ("frac12" "\\textonehalf{}" nil "&frac12;" "1/2" "½" "½")
  400. ("frac14" "\\textonequarter{}" nil "&frac14;" "1/4" "¼" "¼")
  401. ("frac34" "\\textthreequarters{}" nil "&frac34;" "3/4" "¾" "¾")
  402. ("div" "\\textdiv{}" nil "&divide;" "/" "÷" "÷")
  403. ("acute" "\\textasciiacute{}" nil "&acute;" "'" "´" "´")
  404. ("nsup" "\\not\\supset" t "&nsup;" "[not a superset of]" "[not a superset of]" "⊅")
  405. ("smiley" "\\smiley{}" nil "&#9786;" ":-)" ":-)" "☺")
  406. )
  407. "Default entities used in Org-mode to preduce special characters.
  408. For details see `org-entities-user'.")
  409. (defsubst org-entity-get (name)
  410. "Get the proper association for NAME from the entity lists.
  411. This first checks the user list, then the built-in list."
  412. (or (assoc name org-entities-user)
  413. (assoc name org-entities)))
  414. (defun org-entity-get-representation (name kind)
  415. "Get the correct representation of entity NAME for export type KIND.
  416. Kind can be any of `latex', `html', `ascii', `latin1', or `utf8'."
  417. (let* ((e (org-entity-get name))
  418. (n (cdr (assq kind '((latex . 1) (html . 3) (ascii . 4)
  419. (latin1 . 5) (utf8 . 6)))))
  420. (r (and e n (nth n e))))
  421. (if (and e r
  422. (not org-entities-ascii-explanatory)
  423. (memq kind '(ascii latin1 utf8))
  424. (= (string-to-char r) ?\[))
  425. (concat "\\" name)
  426. r)))
  427. (defsubst org-entity-latex-math-p (name)
  428. "Does entity NAME require math mode in LaTeX?"
  429. (nth 2 (org-entity-get name)))
  430. ;; Helpfunctions to create a table for orgmode.org/worg/org-symbols.org
  431. (defun org-entities-create-table ()
  432. "Create an org-mode table with all entities."
  433. (interactive)
  434. (let ((ll org-entities)
  435. (pos (point))
  436. e latex mathp html latin utf8 name ascii)
  437. (insert "|Name|LaTeX code|LaTeX|HTML code |HTML|ASCII|Latin1|UTF-8\n|-\n")
  438. (while ll
  439. (setq e (pop ll))
  440. (setq name (car e)
  441. latex (nth 1 e)
  442. mathp (nth 2 e)
  443. html (nth 3 e)
  444. ascii (nth 4 e)
  445. latin (nth 5 e)
  446. utf8 (nth 6 e))
  447. (if (equal ascii "|") (setq ascii "\\vert"))
  448. (if (equal latin "|") (setq latin "\\vert"))
  449. (if (equal utf8 "|") (setq utf8 "\\vert"))
  450. (if (equal ascii "=>") (setq ascii "= >"))
  451. (if (equal latin "=>") (setq latin "= >"))
  452. (insert "|" name
  453. "|" (format "=%s=" latex)
  454. "|" (format (if mathp "$%s$" "$\\mbox{%s}$")
  455. latex)
  456. "|" (format "=%s=" html) "|" html
  457. "|" ascii "|" latin "|" utf8
  458. "|\n"))
  459. (goto-char pos)
  460. (org-table-align)))
  461. (defun replace-amp ()
  462. "Postprocess HTML file to unescape the ampersant."
  463. (interactive)
  464. (while (re-search-forward "<td>&amp;\\([^<;]+;\\)" nil t)
  465. (replace-match (concat "<td>&" (match-string 1)) t t)))
  466. (provide 'org-entities)
  467. ;; arch-tag: e6bd163f-7419-4009-9c93-a74623016424
  468. ;;; org-entities.el ends here