dotemacs

My Emacs configuration
git clone git://git.entf.net/dotemacs
Log | Files | Refs | LICENSE

org-entities.el (29961B)


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