org-entities.el 26 KB

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