org-entities.el 26 KB

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