org-entities.el 29 KB

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