org-entities.el 24 KB

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