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