org-entities.el 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599
  1. ;;; org-entities.el --- Support for Special Entities -*- lexical-binding: t; -*-
  2. ;; Copyright (C) 2010-2018 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 <https://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. (defgroup org-entities nil
  27. "Options concerning entities in Org mode."
  28. :tag "Org Entities"
  29. :group 'org)
  30. (defun org-entities--user-safe-p (v)
  31. "Non-nil if V is a safe value for `org-entities-user'."
  32. (pcase v
  33. (`nil t)
  34. (`(,(and (pred stringp)
  35. (pred (string-match-p "\\`[a-zA-Z][a-zA-Z0-9]*\\'")))
  36. ,(pred stringp) ,(pred booleanp) ,(pred stringp)
  37. ,(pred stringp) ,(pred stringp) ,(pred stringp))
  38. t)
  39. (_ nil)))
  40. (defcustom org-entities-user nil
  41. "User-defined entities used in Org to produce special characters.
  42. Each entry in this list is a list of strings. It associates the name
  43. of the entity that can be inserted into an Org file as \\name with the
  44. appropriate replacements for the different export backends. The order
  45. of the fields is the following
  46. name As a string, without the leading backslash.
  47. LaTeX replacement In ready LaTeX, no further processing will take place.
  48. LaTeX mathp Either t or nil. When t this entity needs to be in
  49. math mode.
  50. HTML replacement In ready HTML, no further processing will take place.
  51. Usually this will be an &...; entity.
  52. ASCII replacement Plain ASCII, no extensions.
  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
  56. packages to be loaded, add these packages to `org-latex-packages-alist'."
  57. :group 'org-entities
  58. :version "24.1"
  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. :safe #'org-entities--user-safe-p)
  69. (defconst org-entities
  70. (append
  71. '("* Letters"
  72. "** Latin"
  73. ("Agrave" "\\`{A}" nil "&Agrave;" "A" "À" "À")
  74. ("agrave" "\\`{a}" nil "&agrave;" "a" "à" "à")
  75. ("Aacute" "\\'{A}" nil "&Aacute;" "A" "Á" "Á")
  76. ("aacute" "\\'{a}" nil "&aacute;" "a" "á" "á")
  77. ("Acirc" "\\^{A}" nil "&Acirc;" "A" "Â" "Â")
  78. ("acirc" "\\^{a}" nil "&acirc;" "a" "â" "â")
  79. ("Amacr" "\\bar{A}" nil "&Amacr;" "A" "Ã" "Ã")
  80. ("amacr" "\\bar{a}" nil "&amacr;" "a" "ã" "ã")
  81. ("Atilde" "\\~{A}" nil "&Atilde;" "A" "Ã" "Ã")
  82. ("atilde" "\\~{a}" nil "&atilde;" "a" "ã" "ã")
  83. ("Auml" "\\\"{A}" nil "&Auml;" "Ae" "Ä" "Ä")
  84. ("auml" "\\\"{a}" nil "&auml;" "ae" "ä" "ä")
  85. ("Aring" "\\AA{}" nil "&Aring;" "A" "Å" "Å")
  86. ("AA" "\\AA{}" nil "&Aring;" "A" "Å" "Å")
  87. ("aring" "\\aa{}" nil "&aring;" "a" "å" "å")
  88. ("AElig" "\\AE{}" nil "&AElig;" "AE" "Æ" "Æ")
  89. ("aelig" "\\ae{}" nil "&aelig;" "ae" "æ" "æ")
  90. ("Ccedil" "\\c{C}" nil "&Ccedil;" "C" "Ç" "Ç")
  91. ("ccedil" "\\c{c}" nil "&ccedil;" "c" "ç" "ç")
  92. ("Egrave" "\\`{E}" nil "&Egrave;" "E" "È" "È")
  93. ("egrave" "\\`{e}" nil "&egrave;" "e" "è" "è")
  94. ("Eacute" "\\'{E}" nil "&Eacute;" "E" "É" "É")
  95. ("eacute" "\\'{e}" nil "&eacute;" "e" "é" "é")
  96. ("Ecirc" "\\^{E}" nil "&Ecirc;" "E" "Ê" "Ê")
  97. ("ecirc" "\\^{e}" nil "&ecirc;" "e" "ê" "ê")
  98. ("Euml" "\\\"{E}" nil "&Euml;" "E" "Ë" "Ë")
  99. ("euml" "\\\"{e}" nil "&euml;" "e" "ë" "ë")
  100. ("Igrave" "\\`{I}" nil "&Igrave;" "I" "Ì" "Ì")
  101. ("igrave" "\\`{i}" nil "&igrave;" "i" "ì" "ì")
  102. ("Iacute" "\\'{I}" nil "&Iacute;" "I" "Í" "Í")
  103. ("iacute" "\\'{i}" nil "&iacute;" "i" "í" "í")
  104. ("Icirc" "\\^{I}" nil "&Icirc;" "I" "Î" "Î")
  105. ("icirc" "\\^{i}" nil "&icirc;" "i" "î" "î")
  106. ("Iuml" "\\\"{I}" nil "&Iuml;" "I" "Ï" "Ï")
  107. ("iuml" "\\\"{i}" nil "&iuml;" "i" "ï" "ï")
  108. ("Ntilde" "\\~{N}" nil "&Ntilde;" "N" "Ñ" "Ñ")
  109. ("ntilde" "\\~{n}" nil "&ntilde;" "n" "ñ" "ñ")
  110. ("Ograve" "\\`{O}" nil "&Ograve;" "O" "Ò" "Ò")
  111. ("ograve" "\\`{o}" nil "&ograve;" "o" "ò" "ò")
  112. ("Oacute" "\\'{O}" nil "&Oacute;" "O" "Ó" "Ó")
  113. ("oacute" "\\'{o}" nil "&oacute;" "o" "ó" "ó")
  114. ("Ocirc" "\\^{O}" nil "&Ocirc;" "O" "Ô" "Ô")
  115. ("ocirc" "\\^{o}" nil "&ocirc;" "o" "ô" "ô")
  116. ("Otilde" "\\~{O}" nil "&Otilde;" "O" "Õ" "Õ")
  117. ("otilde" "\\~{o}" nil "&otilde;" "o" "õ" "õ")
  118. ("Ouml" "\\\"{O}" nil "&Ouml;" "Oe" "Ö" "Ö")
  119. ("ouml" "\\\"{o}" nil "&ouml;" "oe" "ö" "ö")
  120. ("Oslash" "\\O" nil "&Oslash;" "O" "Ø" "Ø")
  121. ("oslash" "\\o{}" nil "&oslash;" "o" "ø" "ø")
  122. ("OElig" "\\OE{}" nil "&OElig;" "OE" "OE" "Œ")
  123. ("oelig" "\\oe{}" nil "&oelig;" "oe" "oe" "œ")
  124. ("Scaron" "\\v{S}" nil "&Scaron;" "S" "S" "Š")
  125. ("scaron" "\\v{s}" nil "&scaron;" "s" "s" "š")
  126. ("szlig" "\\ss{}" nil "&szlig;" "ss" "ß" "ß")
  127. ("Ugrave" "\\`{U}" nil "&Ugrave;" "U" "Ù" "Ù")
  128. ("ugrave" "\\`{u}" nil "&ugrave;" "u" "ù" "ù")
  129. ("Uacute" "\\'{U}" nil "&Uacute;" "U" "Ú" "Ú")
  130. ("uacute" "\\'{u}" nil "&uacute;" "u" "ú" "ú")
  131. ("Ucirc" "\\^{U}" nil "&Ucirc;" "U" "Û" "Û")
  132. ("ucirc" "\\^{u}" nil "&ucirc;" "u" "û" "û")
  133. ("Uuml" "\\\"{U}" nil "&Uuml;" "Ue" "Ü" "Ü")
  134. ("uuml" "\\\"{u}" nil "&uuml;" "ue" "ü" "ü")
  135. ("Yacute" "\\'{Y}" nil "&Yacute;" "Y" "Ý" "Ý")
  136. ("yacute" "\\'{y}" nil "&yacute;" "y" "ý" "ý")
  137. ("Yuml" "\\\"{Y}" nil "&Yuml;" "Y" "Y" "Ÿ")
  138. ("yuml" "\\\"{y}" nil "&yuml;" "y" "ÿ" "ÿ")
  139. "** Latin (special face)"
  140. ("fnof" "\\textit{f}" nil "&fnof;" "f" "f" "ƒ")
  141. ("real" "\\Re" t "&real;" "R" "R" "ℜ")
  142. ("image" "\\Im" t "&image;" "I" "I" "ℑ")
  143. ("weierp" "\\wp" t "&weierp;" "P" "P" "℘")
  144. ("ell" "\\ell" t "&ell;" "ell" "ell" "ℓ")
  145. ("imath" "\\imath" t "&imath;" "[dotless i]" "dotless i" "ı")
  146. ("jmath" "\\jmath" t "&jmath;" "[dotless j]" "dotless j" "ȷ")
  147. "** Greek"
  148. ("Alpha" "A" nil "&Alpha;" "Alpha" "Alpha" "Α")
  149. ("alpha" "\\alpha" t "&alpha;" "alpha" "alpha" "α")
  150. ("Beta" "B" nil "&Beta;" "Beta" "Beta" "Β")
  151. ("beta" "\\beta" t "&beta;" "beta" "beta" "β")
  152. ("Gamma" "\\Gamma" t "&Gamma;" "Gamma" "Gamma" "Γ")
  153. ("gamma" "\\gamma" t "&gamma;" "gamma" "gamma" "γ")
  154. ("Delta" "\\Delta" t "&Delta;" "Delta" "Delta" "Δ")
  155. ("delta" "\\delta" t "&delta;" "delta" "delta" "δ")
  156. ("Epsilon" "E" nil "&Epsilon;" "Epsilon" "Epsilon" "Ε")
  157. ("epsilon" "\\epsilon" t "&epsilon;" "epsilon" "epsilon" "ε")
  158. ("varepsilon" "\\varepsilon" t "&epsilon;" "varepsilon" "varepsilon" "ε")
  159. ("Zeta" "Z" nil "&Zeta;" "Zeta" "Zeta" "Ζ")
  160. ("zeta" "\\zeta" t "&zeta;" "zeta" "zeta" "ζ")
  161. ("Eta" "H" nil "&Eta;" "Eta" "Eta" "Η")
  162. ("eta" "\\eta" t "&eta;" "eta" "eta" "η")
  163. ("Theta" "\\Theta" t "&Theta;" "Theta" "Theta" "Θ")
  164. ("theta" "\\theta" t "&theta;" "theta" "theta" "θ")
  165. ("thetasym" "\\vartheta" t "&thetasym;" "theta" "theta" "ϑ")
  166. ("vartheta" "\\vartheta" t "&thetasym;" "theta" "theta" "ϑ")
  167. ("Iota" "I" nil "&Iota;" "Iota" "Iota" "Ι")
  168. ("iota" "\\iota" t "&iota;" "iota" "iota" "ι")
  169. ("Kappa" "K" nil "&Kappa;" "Kappa" "Kappa" "Κ")
  170. ("kappa" "\\kappa" t "&kappa;" "kappa" "kappa" "κ")
  171. ("Lambda" "\\Lambda" t "&Lambda;" "Lambda" "Lambda" "Λ")
  172. ("lambda" "\\lambda" t "&lambda;" "lambda" "lambda" "λ")
  173. ("Mu" "M" nil "&Mu;" "Mu" "Mu" "Μ")
  174. ("mu" "\\mu" t "&mu;" "mu" "mu" "μ")
  175. ("nu" "\\nu" t "&nu;" "nu" "nu" "ν")
  176. ("Nu" "N" nil "&Nu;" "Nu" "Nu" "Ν")
  177. ("Xi" "\\Xi" t "&Xi;" "Xi" "Xi" "Ξ")
  178. ("xi" "\\xi" t "&xi;" "xi" "xi" "ξ")
  179. ("Omicron" "O" nil "&Omicron;" "Omicron" "Omicron" "Ο")
  180. ("omicron" "\\textit{o}" nil "&omicron;" "omicron" "omicron" "ο")
  181. ("Pi" "\\Pi" t "&Pi;" "Pi" "Pi" "Π")
  182. ("pi" "\\pi" t "&pi;" "pi" "pi" "π")
  183. ("Rho" "P" nil "&Rho;" "Rho" "Rho" "Ρ")
  184. ("rho" "\\rho" t "&rho;" "rho" "rho" "ρ")
  185. ("Sigma" "\\Sigma" t "&Sigma;" "Sigma" "Sigma" "Σ")
  186. ("sigma" "\\sigma" t "&sigma;" "sigma" "sigma" "σ")
  187. ("sigmaf" "\\varsigma" t "&sigmaf;" "sigmaf" "sigmaf" "ς")
  188. ("varsigma" "\\varsigma" t "&sigmaf;" "varsigma" "varsigma" "ς")
  189. ("Tau" "T" nil "&Tau;" "Tau" "Tau" "Τ")
  190. ("Upsilon" "\\Upsilon" t "&Upsilon;" "Upsilon" "Upsilon" "Υ")
  191. ("upsih" "\\Upsilon" t "&upsih;" "upsilon" "upsilon" "ϒ")
  192. ("upsilon" "\\upsilon" t "&upsilon;" "upsilon" "upsilon" "υ")
  193. ("Phi" "\\Phi" t "&Phi;" "Phi" "Phi" "Φ")
  194. ("phi" "\\phi" t "&phi;" "phi" "phi" "ɸ")
  195. ("varphi" "\\varphi" t "&varphi;" "varphi" "varphi" "φ")
  196. ("Chi" "X" nil "&Chi;" "Chi" "Chi" "Χ")
  197. ("chi" "\\chi" t "&chi;" "chi" "chi" "χ")
  198. ("acutex" "\\acute x" t "&acute;x" "'x" "'x" "𝑥́")
  199. ("Psi" "\\Psi" t "&Psi;" "Psi" "Psi" "Ψ")
  200. ("psi" "\\psi" t "&psi;" "psi" "psi" "ψ")
  201. ("tau" "\\tau" t "&tau;" "tau" "tau" "τ")
  202. ("Omega" "\\Omega" t "&Omega;" "Omega" "Omega" "Ω")
  203. ("omega" "\\omega" t "&omega;" "omega" "omega" "ω")
  204. ("piv" "\\varpi" t "&piv;" "omega-pi" "omega-pi" "ϖ")
  205. ("varpi" "\\varpi" t "&piv;" "omega-pi" "omega-pi" "ϖ")
  206. ("partial" "\\partial" t "&part;" "[partial differential]" "[partial differential]" "∂")
  207. "** Hebrew"
  208. ("alefsym" "\\aleph" t "&alefsym;" "aleph" "aleph" "ℵ")
  209. ("aleph" "\\aleph" t "&aleph;" "aleph" "aleph" "ℵ")
  210. ("gimel" "\\gimel" t "&gimel;" "gimel" "gimel" "ℷ")
  211. ("beth" "\\beth" t "&beth;" "beth" "beth" "ב")
  212. ("dalet" "\\daleth" t "&daleth;" "dalet" "dalet" "ד")
  213. "** Dead languages"
  214. ("ETH" "\\DH{}" nil "&ETH;" "D" "Ð" "Ð")
  215. ("eth" "\\dh{}" nil "&eth;" "dh" "ð" "ð")
  216. ("THORN" "\\TH{}" nil "&THORN;" "TH" "Þ" "Þ")
  217. ("thorn" "\\th{}" nil "&thorn;" "th" "þ" "þ")
  218. "* Punctuation"
  219. "** Dots and Marks"
  220. ("dots" "\\dots{}" nil "&hellip;" "..." "..." "…")
  221. ("cdots" "\\cdots{}" t "&ctdot;" "..." "..." "⋯")
  222. ("hellip" "\\dots{}" nil "&hellip;" "..." "..." "…")
  223. ("middot" "\\textperiodcentered{}" nil "&middot;" "." "·" "·")
  224. ("iexcl" "!`" nil "&iexcl;" "!" "¡" "¡")
  225. ("iquest" "?`" nil "&iquest;" "?" "¿" "¿")
  226. "** Dash-like"
  227. ("shy" "\\-" nil "&shy;" "" "" "")
  228. ("ndash" "--" nil "&ndash;" "-" "-" "–")
  229. ("mdash" "---" nil "&mdash;" "--" "--" "—")
  230. "** Quotations"
  231. ("quot" "\\textquotedbl{}" nil "&quot;" "\"" "\"" "\"")
  232. ("acute" "\\textasciiacute{}" nil "&acute;" "'" "´" "´")
  233. ("ldquo" "\\textquotedblleft{}" nil "&ldquo;" "\"" "\"" "“")
  234. ("rdquo" "\\textquotedblright{}" nil "&rdquo;" "\"" "\"" "”")
  235. ("bdquo" "\\quotedblbase{}" nil "&bdquo;" "\"" "\"" "„")
  236. ("lsquo" "\\textquoteleft{}" nil "&lsquo;" "`" "`" "‘")
  237. ("rsquo" "\\textquoteright{}" nil "&rsquo;" "'" "'" "’")
  238. ("sbquo" "\\quotesinglbase{}" nil "&sbquo;" "," "," "‚")
  239. ("laquo" "\\guillemotleft{}" nil "&laquo;" "<<" "«" "«")
  240. ("raquo" "\\guillemotright{}" nil "&raquo;" ">>" "»" "»")
  241. ("lsaquo" "\\guilsinglleft{}" nil "&lsaquo;" "<" "<" "‹")
  242. ("rsaquo" "\\guilsinglright{}" nil "&rsaquo;" ">" ">" "›")
  243. "* Other"
  244. "** Misc. (often used)"
  245. ("circ" "\\^{}" nil "&circ;" "^" "^" "∘")
  246. ("vert" "\\vert{}" t "&vert;" "|" "|" "|")
  247. ("vbar" "|" nil "|" "|" "|" "|")
  248. ("brvbar" "\\textbrokenbar{}" nil "&brvbar;" "|" "¦" "¦")
  249. ("S" "\\S" nil "&sect;" "paragraph" "§" "§")
  250. ("sect" "\\S" nil "&sect;" "paragraph" "§" "§")
  251. ("amp" "\\&" nil "&amp;" "&" "&" "&")
  252. ("lt" "\\textless{}" nil "&lt;" "<" "<" "<")
  253. ("gt" "\\textgreater{}" nil "&gt;" ">" ">" ">")
  254. ("tilde" "\\textasciitilde{}" nil "~" "~" "~" "~")
  255. ("slash" "/" nil "/" "/" "/" "/")
  256. ("plus" "+" nil "+" "+" "+" "+")
  257. ("under" "\\_" nil "_" "_" "_" "_")
  258. ("equal" "=" nil "=" "=" "=" "=")
  259. ("asciicirc" "\\textasciicircum{}" nil "^" "^" "^" "^")
  260. ("dagger" "\\textdagger{}" nil "&dagger;" "[dagger]" "[dagger]" "†")
  261. ("dag" "\\dag{}" nil "&dagger;" "[dagger]" "[dagger]" "†")
  262. ("Dagger" "\\textdaggerdbl{}" nil "&Dagger;" "[doubledagger]" "[doubledagger]" "‡")
  263. ("ddag" "\\ddag{}" nil "&Dagger;" "[doubledagger]" "[doubledagger]" "‡")
  264. "** Whitespace"
  265. ("nbsp" "~" nil "&nbsp;" " " "\x00A0" "\x00A0")
  266. ("ensp" "\\hspace*{.5em}" nil "&ensp;" " " " " " ")
  267. ("emsp" "\\hspace*{1em}" nil "&emsp;" " " " " " ")
  268. ("thinsp" "\\hspace*{.2em}" nil "&thinsp;" " " " " " ")
  269. "** Currency"
  270. ("curren" "\\textcurrency{}" nil "&curren;" "curr." "¤" "¤")
  271. ("cent" "\\textcent{}" nil "&cent;" "cent" "¢" "¢")
  272. ("pound" "\\pounds{}" nil "&pound;" "pound" "£" "£")
  273. ("yen" "\\textyen{}" nil "&yen;" "yen" "¥" "¥")
  274. ("euro" "\\texteuro{}" nil "&euro;" "EUR" "EUR" "€")
  275. ("EUR" "\\texteuro{}" nil "&euro;" "EUR" "EUR" "€")
  276. ("dollar" "\\$" nil "$" "$" "$" "$")
  277. ("USD" "\\$" nil "$" "$" "$" "$")
  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. (dolist (n (number-sequence 1 20) (nreverse space-entities))
  487. (let ((spaces (make-string n ?\s)))
  488. (push (list (setq entity (concat entity " "))
  489. (format "\\hspace*{%sem}" (* n .5))
  490. nil
  491. (setq html-spaces (concat "&ensp;" html-spaces))
  492. spaces
  493. spaces
  494. (make-string n ?\x2002))
  495. space-entities)))))
  496. "Default entities used in Org mode to produce special characters.
  497. For details see `org-entities-user'.")
  498. (defsubst org-entity-get (name)
  499. "Get the proper association for NAME from the entity lists.
  500. This first checks the user list, then the built-in list."
  501. (or (assoc name org-entities-user)
  502. (assoc name org-entities)))
  503. ;; Helpfunctions to create a table for orgmode.org/worg/org-symbols.org
  504. (defun org-entities-create-table ()
  505. "Create an Org mode table with all entities."
  506. (interactive)
  507. (let ((pos (point)))
  508. (insert "|Name|LaTeX code|LaTeX|HTML code |HTML|ASCII|Latin1|UTF-8\n|-\n")
  509. (dolist (e org-entities)
  510. (pcase e
  511. (`(,name ,latex ,mathp ,html ,ascii ,latin ,utf8)
  512. (if (equal ascii "|") (setq ascii "\\vert"))
  513. (if (equal latin "|") (setq latin "\\vert"))
  514. (if (equal utf8 "|") (setq utf8 "\\vert"))
  515. (if (equal ascii "=>") (setq ascii "= >"))
  516. (if (equal latin "=>") (setq latin "= >"))
  517. (insert "|" name
  518. "|" (format "=%s=" latex)
  519. "|" (format (if mathp "$%s$" "$\\mbox{%s}$") latex)
  520. "|" (format "=%s=" html) "|" html
  521. "|" ascii "|" latin "|" utf8
  522. "|\n"))))
  523. (goto-char pos)
  524. (org-table-align)))
  525. (defvar org-pretty-entities) ;; declare defcustom from org
  526. (defun org-entities-help ()
  527. "Create a Help buffer with all available entities."
  528. (interactive)
  529. (with-output-to-temp-buffer "*Org Entity Help*"
  530. (princ "Org mode entities\n=================\n\n")
  531. (let ((ll (append '("* User-defined additions (variable org-entities-user)")
  532. org-entities-user
  533. org-entities))
  534. (lastwasstring t)
  535. (head (concat
  536. "\n"
  537. " Symbol Org entity LaTeX code HTML code\n"
  538. " -----------------------------------------------------------\n")))
  539. (dolist (e ll)
  540. (pcase e
  541. (`(,name ,latex ,_ ,html ,_ ,_ ,utf8)
  542. (when lastwasstring
  543. (princ head)
  544. (setq lastwasstring nil))
  545. (princ (format " %-8s \\%-16s %-22s %-13s\n"
  546. utf8 name latex html)))
  547. ((pred stringp)
  548. (princ e)
  549. (princ "\n")
  550. (setq lastwasstring t))))))
  551. (with-current-buffer "*Org Entity Help*"
  552. (org-mode)
  553. (when org-pretty-entities
  554. (org-toggle-pretty-entities)))
  555. (select-window (get-buffer-window "*Org Entity Help*")))
  556. (provide 'org-entities)
  557. ;; Local variables:
  558. ;; coding: utf-8
  559. ;; End:
  560. ;;; org-entities.el ends here