3

I would like to know how many LaTeX characters, including all the special math symbols, can be represented by Unicode. Would I be right to say, that nowadyas, LaTeX's strangths over Unicode are mainly its ability to draw diagrams, which cannot be created with Unicode alone?

Also, if for example I need to typeset something like "integral from a to b" with subscripts and suprescripts, or even "e to the power of (x to the power of y)", then can I do this with Unicode or do I just need LaTeX in order to generate the smaller superscripts and subscripts?

Also, to what extent can I combine LaTeX with Unicode math characters and would the typesetting be the same if I use LaTeX notation to generate math characters rather than Unicode characters serving the same purpose?

Thanks.

  • 2
    as for using unicode fonts and unicode input with luatex or xetex (unicode TeX variants) There are good answers already I'll find one and post here – David Carlisle Feb 7 '15 at 16:15
  • 2
  • 1
    But as I say Unicode is just a list of characters, you need a typesetting system, unicode says nothing about how to set matrices or fractions, it's like asking for plain english text whether you need latex or ascii, they just are not comparable. – David Carlisle Feb 7 '15 at 16:39
  • 1
    @Mico yes sure, but enter into what :-) – David Carlisle Feb 7 '15 at 17:16
  • 2
    @DavidCarlisle - I'm guessing the OP is thinking of entering 𝜉 and Γ directly into a LaTeX docuemnt, rather than having to type \xi and \Gamma. At least, that's what I'm guessing the posting's third paragraph is all about. – Mico Feb 7 '15 at 17:28
10

partial, and probably unsatisfactory, answer.

unicode alone can't do everything. for example, if you want an integral from x=1 to \infty, unicode has the codes, but it isn't by itself able to position sub/superscripts or limits. so at a minimum, some sort of markup and composition facility is required.

markup could as well be mathml as latex, but that's up to whoever is preparing the document.

as for whether "all" latex characters/symbols are covered by unicode, the effort made for the benefit of stipub (see http://www.ams.org/STIX for the history of the stix project) attempted to get as many such symbols as possible accepted into unicode. if a symbol was requested by one of the stipub organizations, then it went onto the list, and by and large the unicode technical committee received that request as an acceptable level of documentation. for some edge cases (some symbols in the stmaryrd collection or in tipa, for example) which were not on the main stipub lists, additional documentation -- in the form of articles or books published by recognized technical publishers -- was required, and in its absence, no action was taken. (if someone can provide a suitable citation for any "missing" symbol, the effort to add new symbols is ongoing.)

what did happen is that the unicode technical committee accepted the proposition that math notation is effectively a "language", and as such, symbols in common use should be encoded just as letters for "minor" human languages, alive or dead, are encoded. this is what is required for mathematicians and other scientists to communicate on the web.

i am not aware that a complete list of symbols, with their visual representation and associated unicode (and, potentially, a "tex name") exists yet. i hope that this information can be added to the "comprehensive symbols list" (texdoc comprehensive), but that is a massive undertaking (in which i am willing to participate, but haven't yet contacted the author to that effect). and some glitches in the stix fonts, which were the outcome of the stix project, remain to be ironed out, in particular the location of quite a few "unicodes" in the private use area.

regarding direct use of unicodes or the "native" symbols vs. "tex names", ability to do so depends on the engine in use. it's probably not possible with pdflatex, but should be relatively straightforward with xelatex provided suitable fonts are available.

  • 1
    For one that's not that I know of on the list, see the standard state symbol used in chemistry. – Joseph Wright Feb 7 '15 at 21:58
  • 1
    At the end of Symbol.java there are some mappings from LaTeX commands to Unicode and Ding.java has the mappings from pifont's \ding command to Unicode. I also made a start on wasysym but it's not finished. – Nicola Talbot Feb 7 '15 at 22:18
  • 1
    If you hover over the top of each cell in these tables it shows the unicode slot and the unicode name and any xml entity names, I could give tex names as well, if that would make sense, the tex data is in the xml source file for those tables. – David Carlisle Feb 8 '15 at 0:02
  • 1
    @JohnSonderson ℝ (U+211D) and ℤ (U+2124) are in the "Letterlike Symbols" block. – Nicola Talbot Feb 8 '15 at 15:52
  • 1
    @JohnSonderson the common number sets NPCRQ etc were already in unicode, and when the full alphabets were added, the rule that no existing characters are duplicated won. A bit unfortunate but that's what happens when you deal with legacy data – David Carlisle Feb 8 '15 at 15:54
5

Many of the applications I write have some connection to LaTeX. Either they create files that LaTeX inputs or they parse LaTeX code, so I've had to produce some mappings between Unicode and LaTeX commands.

flowframtk is a graphical application that can export to .tex (or .sty or .cls) and Unicode characters entered into the graphical environment can be mapped to LaTeX commands. If you install flowframtk, run the application and then quit it, you should find a directory containing the application settings (~/.flowframtk/ on Unix-like systems or flowframtk-settings on Windows). This directory should include (amongst other files) the text-mode (textmappings.prop) and math-mode (mathmappings.prop) mappings. The files are tab-separated with three columns. The first has the Unicode code point, the second the closest LaTeX equivalent and the third the package(s) required. The files are too large to reproduce here. (The text mode mappings has 200 lines and the math mode mappings has 795 lines.)

The texparser library is designed to parse LaTeX files, but also contains mappings from LaTeX to Unicode, although these are contained within the Java source code.

  • So, given your comments, would I be correct to say that unicode-math is not a package designed primarily for end users, but rather a package designed for tools which make use of it to more easily convert back and forth between one format and another? – John Sonderson Feb 8 '15 at 14:59
  • 1
    @JohnSonderson I don't know. I've never used unicode-math, but I can see that it would be useful for people who are accustomed to typing Unicode characters. (Personally, I find it easier to type, say, \mathbb{Z} rather than ℤ.) My TeXparser library is designed to work with (PDF)LaTeX rather than XeLaTeX/LuaLaTeX as that's the format required for the articles I have to process, and if flowframtk didn't have the mappings, it would put off people who specifically want to use PDFLaTeX rather than XeLaTeX/LuaLaTeX. – Nicola Talbot Feb 8 '15 at 16:05
  • Yes, besides the fact that both having to remember by heart as well as having to type more numbers and less letters makes entering Unicode characters impractical (unless someone can answer this post with a viable answer. So, yes, AFAIK entering non-Unicode is better, also because some text editors cannot properly render all Unicode text (at least not with most fonts I'm aware of including some default ones). – John Sonderson Feb 8 '15 at 16:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.