What's new in TeX, part 1
Development in the world of the TeX document-preparation system is steady, gradual, and solid. This fact reflects the maturity of Donald Knuth's TeX engine, which underlies everything else in the system. TeX has been essentially frozen for about 30 years and is one of the very few large software systems that is generally considered to be bug-free. Development now occurs in those layers that surround the typographic core: formats that supply higher-level control of TeX for the ready production of various classes of documents and packages for drawing, slides, sheet music, poetry, and for tweaking TeX's behavior.
In this two-part series, we will look at recent developments in the world of TeX (including LaTeX and similar systems). Considering the pace of development in the TeX community, the notion of "new" that I have in mind is a time horizon of five years or so, although I might mention things that happened even before then. This first part will touch upon typography, programming TeX, and creating diagrams.
TeX basics
Although TeX is still essentially oriented toward the creation of static, paginated documents—and might seem to be losing some relevance in our online world—it is still widely used, especially by mathematicians and scientists in quantitative fields (physics, computer science, etc.). The core reason for this is the same reason that TeX is also popular with various authors and publishing houses in the humanities—those who publish typographically demanding scholarly editions, perhaps mixing languages that employ a variety of alphabets. TeX's purpose is to achieve the best possible automated typography.
This can be seen not only in its unparalleled rendering of mathematical equations, but in its attention to aesthetics in the setting of prose: TeX contains sophisticated algorithms that adjust line breaking and hyphenation to optimize the appearance of entire paragraphs and pages considered as wholes. This attention to detail becomes critically important in complex documents, where typography becomes part of the expression of ideas.
The official and predominant installation method for TeX is TeX Live, which was traditionally distributed on a DVD and is still available in that form. To get the most recent versions of all its parts, however, you will want to follow the usual procedure and install TeX Live through the network. The versions available through Linux package management systems are usually out of date, but the current release is available from the project site. The release notes for TeX Live 2015 are a list of relatively minor, technical details, so I won't be discussing those changes specifically.
The timeliest and most complete source of documentation for the hundreds of TeX packages will be on your disk after you install TeX Live. Open the file /usr/local/texlive/2015/index.html in your browser for links to manuals and examples in various languages.
For those unfamiliar with TeX, when you process a document with the TeX typesetting system, you do so by invoking one of several TeX engines. The various engines differ in the output format that they produce and in how they implement some of TeX's algorithms—which determines what additional features are available. The original tex engine predates Unicode (so it expected an ASCII file) and produced only DVI (for "device independent") files. DVI was intended to be translated into PostScript or other printer commands with a separate tool. Contemporary TeX engines, though, can produce PDF files (e.g., pdfTeX), can understand Unicode text (e.g., XeTeX), and even incorporate scripting languages (e.g., LuaTeX).
The TeX engines should not be confused with TeX document formats, which are large collections of macros that define a set of higher-level layout commands. The most well-known format is LaTeX; another format (which has become popular for book publishing) is ConTeXt. Formats and engines are orthogonal: the pdftex and pdflatex commands invoke the same engine, but the former will process only plain TeX, whereas the latter supports LaTeX.
Fonts and Typography
You should probably work with the LuaLaTeX or XeLaTeX engines for new projects (or their plain-TeX equivalents, LuaTeX and XeTeX), unless you must use TeX packages that are incompatible with these engines or you require a particular feature that's only available with the traditional, PDF-based engine pdfLaTeX.
The reason for this advice is that LuaLaTeX and XeLaTeX have both feet firmly in Unicode land, and their font handling is far more flexible and straightforward than that of the venerable alternatives. One of the annoying drawbacks of TeX in the past was that it lived in its own font universe, and could only use the typefaces that were designed for it.
Generally, TeX was blind to all the other beautiful fonts that you might have installed on your computer. With XeLaTeX and LuaLaTeX, though, you can now easily use any OpenType or TrueType font on your system. And, as we shall shortly see, the maturing of the fontspec and unicode-math packages in recent years radically improves the font-handling landscape for TeX users.
Here is a minimal LaTeX document that shows how to make arbitrary font changes, selecting from among several OpenType/TrueType fonts—some in the TeX Live directory tree and some in the system font directories:
\documentclass{article} \usepackage{fontspec} \defaultfontfeatures{Scale=MatchLowercase,Ligatures=TeX} \begin{document} {\fontspec{Ubuntu}The }{\fontspec{Fetamont Bold10}quick } {\fontspec{Punk Nova}brown {\bfseries fox }} {\fontspec{Sawasdee}jumps {\itshape{\bfseries over }}} {\fontspec{CMU Serif}{\scshape the }} {\fontspec{Overlock}lazy }{\fontspec{Ubuntu Condensed}dog.} \end{document}
This file is intended to be processed with the lualatex command, which allows us to use the common names of fonts rather than having to know their actual filenames—as is required by all other engines, including XeLaTeX. This convenience is one of several reasons that lualatex should probably be your preferred typesetting command, unless you need to use a package or feature that only works with one of the others.
The defaultfontfeatures command in the third line of the example selects two options for the fontspec package. The Scale=MatchLowercase option scales the various fonts so that their lower-case letter heights are optically equal: fonts with the same nominal point size can appear to be different sizes, so this option makes them blend better when mixing fonts within a line. The Ligatures-TeX option enables the familiar TeX ligatures, such as "``" for an opening quotation mark.
In the code sample, bfseries select the boldface variant of the currently selected (or default) font; itshape and scshape select the italic and small caps variants, respectively. The code sample also shows how these can be combined to produce, in this example, boldface italics.
Here is the result when you process the file with lualatex.
The image was made by cropping the PDF output and converting it to a PNG. You can see where LuaLaTeX has chosen the appropriate font variants in response to the font attribute commands (bfseries, scshape, etc.), some of which are nested. This works because the example uses fonts with these variants available; if the needed variants are not available, those commands will be ignored.
I've actually used this style of ad-hoc font switching when making posters and name tags but, for the more usual kind of document, you will want to select a harmonious set of fonts at the beginning and use them consistently throughout, switching among them with the standard commands for italic, monospace, etc., as required. Here is how you do this with fontspec:
\documentclass{article} \usepackage{fontspec} \defaultfontfeatures{Scale=MatchLowercase,Ligatures=TeX} \setmainfont{Overlock}[BoldFont={* Black}, BoldItalicFont={* Bold Italic}, SmallCapsFont={* SC}] \setmonofont{PT Mono} \begin{document} The {\bfseries quick} {\itshape brown fox {\bfseries jumps over}} {\scshape the {\tt lazy dog.}} \end{document}
Running this through lualatex gives the result in the second figure.
In the options to the setmainfont command (which, unusually, come after the main argument), the asterisks stand for the main font name. This provides a convenient shorthand for selecting font variants. Fontspec is incredibly flexible, allowing you to choose entirely different typefaces for bold, italic, etc., if you want to. You can also choose which font features are activated in every situation; for example, you can decide to use historical ligatures when italics are used, but not in upright text.
LuaLaTeX and XeLaTeX both allow you to use Unicode input without including any additional packages. This lets you replace the traditional TeX commands for accents, and it allows the use of any characters available in the font. This is a Turkish translation of the common English pangram we used in the preceding examples:
{\fontspec{CMU Serif} hızlı kahverengi tilki tembel köpeğin üstünden atlar}
When inserted into our minimal document example, it is typeset as in this figure:
Note, though, that this approach will fail if you choose a font without the glyphs required. For example, attempting to set the above line using the Overlock font will simply skip the "ğ", which is missing from that font.
With the addition of the unicode-math package, Unicode input can even be used in equations. This package also builds its typeset mathematical output using Unicode glyphs, and it allows you to select any math font without loading additional packages:
\documentclass{article} \usepackage{unicode-math} \begin{document} Here is the elementary version of Stokes' Theorem: \medskip XITS (STIX) Math: \setmathfont{xits-math.otf} \[ ∫_Σ ∇ ⨯ 𝐅 ⋅ dΣ = ∮_{∂Σ}𝐅⋅d𝐫 \] \end{document}
The results of running this through luatex can be seen in the figure below. A longer example also showing other variations is available by clicking on the thumbnail.
Using Unicode math input clearly leads to source files that are easier to read, but it may not be to your liking if your system or text editor makes the input of Unicode too cumbersome. You can, of course, freely mix traditional TeX math markup with direct Unicode input.
If you do use Unicode characters for math in your source files, you must take care to use the symbols with the correct meaning, rather than merely the correct appearance. In the example file, we've used the uppercase Greek Sigma (U+03A3) to represent the surface of integration. There is, however, another Unicode character that will appear almost identical in the source file, but which is intended to mean the summation operator (U+2211).
When typesetting equations, TeX treats letters (variables) and operators differently, as it must. So, if you accidentally use the operator sigma, the size and spacing of the symbol will be incorrect, and the equations will look quite wrong.
(Note that if you get an error upon loading unicode-math, you may have to reinstall TeX Live 2015. There was a conflict with another package that was only fixed a few weeks before I write this—perhaps a counterexample to my advice to download a recent version rather than settling for the one in your distribution's repository.)
Programmability
TeX is not only a system of declarative markup tags for text and equations. It is also a Turing-complete programming language, meaning that it can express arbitrary computations. Many popular LaTeX packages perform computations in TeX in order to work their magic, but it is an arcane and tricky language to program in, and quite difficult to read.
LuaTeX (which includes the LuaLaTeX engine) is a project that embeds the Lua language within TeX. It's still officially in beta, but over the last few years has become stable and mature enough that LuaLaTeX is now considered the preferred engine for new projects. It is the focus of future development, and the ConTeXt project has adopted it as its official engine.
Lua is a scripting language designed specifically for embedding, and is therefore small and efficient. It has a familiar, imperative syntax and can be immediately understood with no previous exposure to the language. After a few minutes with the documentation, anyone who knows Python or any similar language can write basic programs in Lua. LuaTeX embeds Lua in such a way that it has access to the internals of TeX, and it can be used to manipulate the boxes and other elements that make up the typeset result. It can also make the results of Lua calculations available to TeX for typesetting. A simple example should make clear how this can be useful:
\documentclass{article} \usepackage{luacode} \begin{document} \pagestyle{empty} \begin{luacode*} function esn (n) return (1 + 1/n)^n end function etn (n) tex.print(string.format('%5d & %1.8f \\\\', n, esn(n))) end \end{luacode*} Convergence to $e$: \begin{tabular}{ll} \rule[-2mm]{0pt}{4mm}$n$ & $(1 + \frac{1}{n})^n$ \\ \hline \luadirect{ for n = 10, 110, 10 do tex.print(etn(n)) end } \hline \end{tabular} \end{document}
In the first part of this document, we have a luacode environment, where we have defined two functions. The first (esn()) maps a number n to a simple expression that yields the number e in the limit as n goes to infinity. The second function (etn()) prints a string that can be embedded within normal TeX source.
The LaTeX code begins next, with a line introducing a table that will show values of n and the convergents approaching e. Within the table, the columns are built with a luadirect command that immediately executes its argument as Lua code, using calls to one of the functions defined earlier. The typeset result is shown in the figure. The ability to perform calculations and typeset the results in a single TeX file, using a language that is simple to program in, opens up a world of new possibilities, especially for authors of mathematical material.
Another strong use case for LuaTeX is in the automated creation of PDF documents from assorted data sources—for example, consider forms of database publishing, such as the printing of catalogs from product databases. In these cases, there is no TeX formatting in the original data, so some form of flexible mapping from data structures to TeX concepts leading to the final PDF is required. The embedded scripting provided by LuaTeX makes this easier than the alternatives.
Graphics
The PGF/TikZ package, a huge project that provides a complete solution to creating all sorts of diagrams within a TeX document, has learned several new tricks in recent years. A recent article introduced TikZ's new network-graph facilities, including the exploitation of LuaTeX to implement the automated layout of graph diagrams. Here, we'll show how to combine a little scripting along the lines illustrated above with TeX's graphics packages:
\documentclass{article} \usepackage{luacode} \usepackage{pgfplots} \begin{document} \begin{luacode*} function esn (n) return (1 + 1/n)^n end function etp (n) tex.print(string.format('(%5d, %1.8f)', n, esn(n))) end \end{luacode*} \begin{tikzpicture} \begin{axis}[xlabel=$n$, ylabel=$(1 + \frac{1}{n})^n$] \addplot coordinates{ \luadirect{ for n = 10, 110, 10 do tex.print(etp(n)) end } }; \addplot[red] coordinates { % (0, \luadirect{tex.print(math.exp(1))}) % (110, \luadirect{tex.print(math.exp(1))}) }; \end{axis} \end{tikzpicture}
In this example we've replaced the second Lua function with one that prints out a pair of coordinates that we can use in a PGFPlots command. The import of pgfplots in the document preamble creates the tikzpicture environment. The axis environment and \addplot command within the tikzpicture environment invoke the pgfplots subsystem, which provides a specialized language for drawing graphs. The syntax it supports is designed to be more convenient than using plain TikZ for this purpose.
The result is shown in the following figure, where the approach of the convergents to the limit, the transcendental number e (shown as a red line), is illustrated.
With the advent of these easy-to-learn tools, it has become possible to undertake a project such as an entire mathematics textbook, with all calculations and graphing done within a single TeX document.
TikZ and PGF recently received a major update to version 3.0. Because of the power and relative ease of use of PGF and TikZ, much of the action in the past few years on the TeX graphics front has taken the form of new TikZ packages.
A few interesting recent additions or major upgrades are Sa-TikZ, for the automated drawing of switching networks; bondgraph, for making "bond graphs" of physical systems; hf-tikz, which allows you to highlight parts of formulas; the randomwalk package, which calculates and prints 2D random walks; tikzorbital, for drawing colorful pictures of atomic and molecular orbitals; tqft, for topological quantum field theory; and forest, for drawing linguistic trees. All of these packages are documented within the TeX Live installation.
The world of TeX has come a long way since I started using it, when we edited our files on a terminal attached to a remote computer, and checked our output by jogging to the computer room to pick up our printouts.
The next installment of this series will delve into the interaction between the traditional world of TeX, which began as a way to typeset documents for printing, and our current environment of electronic documents that adapt to an assortment of reading devices.
Index entries for this article | |
---|---|
GuestArticles | Phillips, Lee |
Posted Sep 17, 2015 1:45 UTC (Thu)
by nkiesel (guest, #11748)
[Link] (2 responses)
function etn (n)
Posted Sep 17, 2015 11:16 UTC (Thu)
by hummassa (subscriber, #307)
[Link]
Actually, a "technical deficit", because the innermost print does the print and probably returns void or empty or something, and the outermost print just becomes a no-op.
Posted Sep 17, 2015 13:29 UTC (Thu)
by leephillips (subscriber, #100450)
[Link]
Posted Sep 17, 2015 3:30 UTC (Thu)
by butlerm (subscriber, #13312)
[Link] (11 responses)
I don't know what the problem is, but TeX fonts looks they were frozen in time about thirty years ago. Adequate from a pragmatic point of view perhaps, but I wonder why TeX can't or doesn't use more modern fonts to produce first rate output instead of what is arguably and unfortunately second rate compared to what is being used for the majority of professionally published full length math and science texts.
Possibly those books are produced using TeX, but whatever they are doing they are doing something so that it doesn't look like the run-of-the-mill TeX produced documents that are so common and so visibly distinguishable from everything else.
Posted Sep 17, 2015 4:40 UTC (Thu)
by xanni (subscriber, #361)
[Link] (1 responses)
Posted Sep 17, 2015 5:08 UTC (Thu)
by butlerm (subscriber, #13312)
[Link]
Posted Sep 17, 2015 16:14 UTC (Thu)
by pr1268 (guest, #24648)
[Link] (4 responses)
Yes, the default TeX serif font ("Computer Modern") is anything but. ;-) But, even without using the specialized TTFs mentioned in the article (and xanni's comment), \usepackage{times} gives your TeX doc a contemporary Times New Roman-like font. I use this by default in my TeX docs. For the record, I think LaTeX is difficult to learn and master, but the PDFs it creates are absolutely gorgeous! (IMO.) At least there's a plethora of online documentation; if you want to create a fancy TeX document, and you're not too sure how to do it, then be sure to have a good Internet connection! :-)
Posted Sep 17, 2015 17:17 UTC (Thu)
by dskoll (subscriber, #1630)
[Link] (3 responses)
Posted Sep 18, 2015 8:15 UTC (Fri)
by eru (subscriber, #2753)
[Link] (1 responses)
Using these also results in far smaller PDF:s, because embedded fonts are not needed so much.
Posted Sep 18, 2015 10:56 UTC (Fri)
by jnareb (subscriber, #46500)
[Link]
Posted Sep 21, 2015 5:22 UTC (Mon)
by pr1268 (guest, #24648)
[Link]
Thanks! I learned a new feature today about LaTeX I didn't know previously. But now, my \mathcal 'Ƶ' (as in "z ∈ Ƶ") inside equations and embedded math mode looks like a twisted pound sterling character £. Sigh... As for Computer Modern, in retrospect, it doesn't look all that bad, even if it appears "old". I do like consistency, so mathptmx FTW. Now to try Lee's suggestions on modern fonts...
Posted Sep 17, 2015 18:40 UTC (Thu)
by anselm (subscriber, #2796)
[Link] (2 responses)
With LaTeX, it is trivial to use fonts other than Computer Modern, and it has been for nearly the last 25 years or so. If your system comes with the standard PostScript fonts (Times, Helvetica, Palatino and friends), these are usable “out of the box” based on very simple commands. Other fonts may need some work to generate the required TeX support files, but it is quite doable and there are tools that help with this. Modern TeX implementations (such as XeTeX or LuaTeX) can use OpenType fonts directly, again based on very simple commands (which the article illustrates).
Incidentally, Computer Modern is not a bad design as fonts go. Its main problem is that it was designed to look good in phototypeset output (IIRC, Knuth used to use an Alphatype CRS at Stanford, which has a resolution of 5000+ dpi), and the clunky, comparatively low-res, laser and inkjet printers that everyone uses today hardly do the fonts justice. The other problem is that Knuth's font technology was really years ahead of its time, but was passed on the inside track by less capable but more popular – and more accessible, to people who aren't genius computer science professors – approaches (like PostScript).
Frankly, if you believe that all TeX-produced documents look the same, then you must not have looked at LaTeX in a while. It is now quite straightforward to get LaTeX to produce output that is radically different from the standard look, based on popular and well-documented extension packages that modify, e.g., the page layout or the appearance of chapter/section/… titles. I wrote a book on LaTeX that appeared in the O'Reilly “Hacks” series (German only, unfortunately), and getting LaTeX to produce the series layout wasn't that difficult (the details are in the book).
Posted Sep 21, 2015 6:07 UTC (Mon)
by pr1268 (guest, #24648)
[Link] (1 responses)
Thanks for the info; you've now got me google-ing for the Alphatype CRS. (Not much found; I did see its claimed resolution of 5333 dpi—WOW!). This interview with David Fuchs (regarding the earliest days of TeX) was interesting, as was this posting on Tex Stackexchange (how did they view their pretty TeX output on a dumb VT100 terminal console? [they didn't.]).
Posted Sep 21, 2015 12:58 UTC (Mon)
by anselm (subscriber, #2796)
[Link]
In the early days of TeX, the “preview” device of choice was a Xerox Dover (early laser printer). This was mostly good for checking that everything appeared in roughly the correct place on the paper but otherwise the output looked quite terrible, to a point where people would print deliberately enlarged output and reduce it on a normal photocopier to make it look nicer. While very expensive and – as basically a modified 1970s photocopier – bodily huge (think large chest freezer), the Dover did have the advantage of being very, very fast indeed (60 pages per minute or so, off a large roll of paper that it would cut into individual sheets).
The first TeX implementation I had (on the Atari ST) didn't have a proper DVI previewer, either – it came with a program that basically “printed” pages to the screen, so you were able to look at your document one page after the other but there was no going back to earlier pages (you had to restart the “printer”). Eventually I wrote my own, more reasonable, DVI previewer for the Atari, which in the end supported multiple windows, facing pages, hyperlinks, and that sort of thing. After I had started using Linux I wrote another one, based on Tcl/Tk, but at some point I went over to using PDF for LaTeX output exclusively, and even though the project was still interesting there was no longer an itch to scratch.
Posted Sep 21, 2015 11:51 UTC (Mon)
by marcel.oliver (subscriber, #5441)
[Link]
When doing mainly plain text, there are actually a lot of good and more "modern" options, whatever that means. However, when it comes to typsetting math, it is very hard to compete with CM for two reasons: First, CM is incredibly well done for writing mathematics, as you can see in comparisons like
As second issue when writing professional mathematics is the availability of special symbols beyond the core symbol set, where a lot of the available ones are visually compatible with CM and stick out when used with other math fonts. Here other fonts have caught up in recent years, but the set of CM-compatible symbol fonts is still larger and more readily available than anything else.
So I think a lot of the "professionally produced math and science books" will fall into the category "text with math" rather than "mathematical writing". I probably would not use CM for an introductory Calculus textbook (although this could also be done well!), but if you look at the mathematical research literature, there is a lot of very good publishing in CM, and it seems to me the trend is more toward CM than away from it.
A lot of what you may perceive as a difference between professional and amateur publishing is due to poor document classes, I believe. (And of course poor copy-editing.) Especially if you go beyond relatively dense scientific papers, there are few really good document classes. The LaTeX default is relatively good in that it produces easy-to-read documents, but to my eye fails on aesthetic criteria. Then there is a large number of mutually incompatible publisher classes, some of which are quite good, but most have warts and limitations, and also follow their own conventions for frontmatter items and such so that it's hard to switch document class. So in comparison, the situation with fonts is actually not so bad...
Posted Sep 17, 2015 3:55 UTC (Thu)
by dune73 (guest, #17225)
[Link] (1 responses)
Posted Sep 17, 2015 15:34 UTC (Thu)
by prauld (subscriber, #39414)
[Link]
Posted Sep 17, 2015 16:12 UTC (Thu)
by jnareb (subscriber, #46500)
[Link]
There is also a good community of people at Q&A site TeX & LaTeX StackExchange (http://tex.stackexchange.com/). You can often get good answers to your questions and troubles with (La)TeX there.
One example of such question
Posted Sep 17, 2015 16:19 UTC (Thu)
by tnoo (subscriber, #20427)
[Link] (3 responses)
A big step forward would be some kind of clean template system (like for example Django) which can be run through a document generator which provides all the logic.
Posted Sep 17, 2015 17:55 UTC (Thu)
by jnareb (subscriber, #46500)
[Link]
The solution is to have all (or most) code in a package, or in preamble, and use defined commands (similar to self-closing HTML tags) and defined environments (similar to open then close HTML tags) in the document. See e.g. http://tex.stackexchange.com/a/267581/5886
Well, the true solution is to search CTAN (Comprehensive TeX Archive Network), then ask on TeX.StackExchange... ;-)
Posted Sep 17, 2015 19:57 UTC (Thu)
by thomas.poulsen (subscriber, #22480)
[Link] (1 responses)
Posted Sep 17, 2015 20:59 UTC (Thu)
by jnareb (subscriber, #46500)
[Link]
Isn't it more like IPython workbooks?
For example http://nbviewer.ipython.org/github/rlabbe/Kalman-and-Baye...
Posted Sep 17, 2015 22:01 UTC (Thu)
by jnareb (subscriber, #46500)
[Link]
Posted Sep 18, 2015 5:42 UTC (Fri)
by rsidd (subscriber, #2582)
[Link] (15 responses)
Posted Sep 18, 2015 7:34 UTC (Fri)
by jezuch (subscriber, #52988)
[Link]
Well, I'm a lazy bastard so I went with LyX :)
Posted Sep 18, 2015 14:10 UTC (Fri)
by jsanders (subscriber, #69784)
[Link] (1 responses)
Posted Sep 18, 2015 16:33 UTC (Fri)
by rsidd (subscriber, #2582)
[Link]
Posted Sep 18, 2015 16:15 UTC (Fri)
by leephillips (subscriber, #100450)
[Link] (3 responses)
Posted Sep 18, 2015 16:35 UTC (Fri)
by rsidd (subscriber, #2582)
[Link] (2 responses)
Posted Sep 25, 2015 17:06 UTC (Fri)
by Wol (subscriber, #4433)
[Link] (1 responses)
gd&r
Cheers,
Posted Sep 26, 2015 5:54 UTC (Sat)
by jem (subscriber, #24231)
[Link]
As an Emacs fan it bothers me that Emacs is accused of being bloated. "Kitchen sink", and all that. Unlike some other editors, Emacs is modular. Extensions are loaded on demand. If you are not interested in vi emulation, or have no need for Python mode, just pretend they are not there.
Posted Sep 18, 2015 16:58 UTC (Fri)
by lsl (subscriber, #86508)
[Link] (2 responses)
A well-written, mnemonic XCompose file goes a long way for that and the result is usable in all X programs. For example:
<Compose> NN: ℕ (double-struck capital n, works for other letters too)
Then there's prefixes for reaching other alphabets, like * for greek, so that *p is π and *P is Π, with Σ being *S. The latter being distinct from the summation operator ∑ (su). Add a bunch of logical operators, set operators and more obvious things like ≤, ± or ≠.
The initial problem is coming up with one that works for you. I started with Plan 9's /lib/keyboard, as I knew it already and it has nice mnemonics for math symbols (all things mentioned above come from there). Also I think the format is easier to edit than XCompose. Plan 9 from User Space (the Unix port of the Plan 9 tools) has a program (mklatinkbd) to convert from Plan 9 keyboard files to XCompose ones.
Posted Sep 18, 2015 17:44 UTC (Fri)
by rsidd (subscriber, #2582)
[Link] (1 responses)
Posted Sep 18, 2015 18:12 UTC (Fri)
by lsl (subscriber, #86508)
[Link]
https://swtch.com/plan9port/man/man7/keyboard.html
The manpage could use an update: it still talks of 16 bit runes/codepoints. The actual code was updated to use 21 bit runes, though.
For plan9port itself see https://swtch.com/plan9port. Note that it recently migrated to Github, so you should ignore all references to Mercurial and/or Google Code and instead use https://github.com/9fans/plan9port (or maybe your distro-packaged version, if it exists).
Posted Dec 30, 2020 23:16 UTC (Wed)
by ceplm (subscriber, #41334)
[Link]
Posted Dec 31, 2020 15:00 UTC (Thu)
by jem (subscriber, #24231)
[Link]
An online alternative is mathcha.io. It is a simple word processing application, with a wysiwyg math editor that is easy to learn and productive once you have got the hang of it. I wouldn't recommend writing a large document using only Mathcha, but you can export the selection to LaTeX, with the following disclaimer:
"Note: Latex below is just for reference, it does not guarantee to be full compatible (or compiled) in Latex Document."
A Mathcha document can also be saved online (if you log in with a Google, Facebook, Twitter, or Github account), or saved locally as a zipped HTML or (proprietary) Mathcha file. Links to online documents can easily be shared. I have mainly used Mathcha to help a friend do his math and physics homework by sharing short documents.
Posted Dec 31, 2020 17:18 UTC (Thu)
by peniblec (subscriber, #111147)
[Link] (2 responses)
I know that this comment is 5 years old now, but since it has been resurrected by jem, and I figure a fair share of LWN readers might be Emacs users:
Emacs has many ways to enter arbitrary Unicode symbols:
Posted Dec 31, 2020 19:19 UTC (Thu)
by jem (subscriber, #24231)
[Link] (1 responses)
I realized the article was old only after posting my reply. I wouldn't have replied if I had known this. But it wasn't me who dug up the ancient article, it showed up in my unread comments because of user cpelm commented on it yesterday.
Posted Dec 31, 2020 23:24 UTC (Thu)
by peniblec (subscriber, #111147)
[Link]
Posted Sep 22, 2015 16:42 UTC (Tue)
by crhodes (subscriber, #28923)
[Link] (2 responses)
You don't need to know the filename of the font to use OpenType fonts with XeLaTeX: simply drop them into ~/.fonts, make sure that fc-list is working, and fontspec will find them just as it does with lualatex. (Or else I'm misunderstanding what is meant).
Posted Sep 22, 2015 17:49 UTC (Tue)
by leephillips (subscriber, #100450)
[Link] (1 responses)
Posted Sep 22, 2015 19:48 UTC (Tue)
by crhodes (subscriber, #28923)
[Link]
Posted Sep 24, 2015 7:15 UTC (Thu)
by callegar (guest, #16148)
[Link] (1 responses)
One observation:
> and [TeX] might seem to be losing some relevance in our online world
Possibly not, maybe the contrary, because of the emergence of may cloud based TeX systems for collaborative writing, such as Overleaf - also known as writelatex (https://www.overleaf.com/), ShareLatex (https://www.sharelatex.com/) and more.
IMHO, a very interesting aspect is that being the TeX source a code-like document, it is naturally better suited for revision control than source formats for most WYSIWYG document preparation systems. For instance, you can put a LaTeX document in git and git will automatically be able to provide status information about what 'components' (e.g. pdf images to embed) have changed or to provide diff of the 'textual' parts of the document.
For the latter options to work well, it is better to stick to the 'old time' convention of using hard word wrap in the source file, rather than making huge lines as many recent TeX IDEs like TeXStudio do, though.
Posted Sep 24, 2015 21:45 UTC (Thu)
by mathstuf (subscriber, #69389)
[Link]
Doing a line per sentence (or at least breaking after every sentence) can help a lot more. Doing hard wrap with reflowing makes a single word change into a paragraph diff.
Posted Sep 24, 2015 7:46 UTC (Thu)
by callegar (guest, #16148)
[Link] (1 responses)
The article seems to strongly advocate for them.
> You should probably work with the LuaLaTeX or XeLaTeX engines for new projects (or their plain-TeX equivalents, LuaTeX and XeTeX), unless you must use TeX packages that are incompatible with these engines or you require a particular feature that's only available with the traditional, PDF-based engine pdfLaTeX.
However, IMHO, there are still some important issues with them:
- LuaTeX is *extremely slow* compared to anything else. Unless its speed is improved, using it for large documents is uncomfortable. Using it on not-so-recent hardware (something where TeX has traditionally been shining, not being resource hungry at all) is a significant pain. Furthermore, due to its poor speed, I cannot see the cloud based systems adopting it, given that they tend to recompile in the background (and thus very often).
- Neither LuaTeX nor XeTeX have good support for microtypography (yet), namely the features supported by the microtype package. Specifically, font expansion does not work with XeTeX and tracking does not work neither in LuaTeX nor in XeTeX. Without these features, the quality of the typesetting is deteriorated (particularly if you need to typeset with short lines, as in documents with many columns or in certain types of figure captions, or if you need to typeset something in margin).
- While the TeX engines themselves may support unicode, unicode support in fonts and in packages is still rather poor at cases.
- With the newer engines I had some significant problems when embedding PDF images (with graphicx) or pages (with pdfpages). In a few cases, I had to revert to pdftex, otherwise I was getting blank images or even invalid PDF documents.
Posted Sep 24, 2015 22:25 UTC (Thu)
by leephillips (subscriber, #100450)
[Link]
LuaTeX and XeTeX don't yet have all the microtypography available with classic pdfLaTeX, but my impression is that this situation is gradually improving.
Posted Sep 27, 2015 16:01 UTC (Sun)
by bernat (subscriber, #51658)
[Link]
What are the feature described in this article not available in the version shipped in Debian Jessie (late 2014 version of TexLive) for example?
Posted Dec 30, 2020 17:08 UTC (Wed)
by ecki (guest, #143908)
[Link]
Use of \tt is no longer supported. It should be changed to \ttfamily.
What's new in TeX, part 1
return string.format('%5d & %1.8f \\\\', n, esn(n))
end
What's new in TeX, part 1
What's new in TeX, part 1
What's new in TeX, part 1
What's new in TeX, part 1
What's new in TeX, part 1
'Computer Modern' ain't
I don't know what the problem is, but TeX fonts looks they were frozen in time about thirty years ago.
\usepackage{times} is a good solution. I also like to use \usepackage{mathptmx} so that equations are set in Times-Roman rather than Computer Modern.
'Computer Modern' ain't
\usepackage{times} is a good solution. I also like to use \usepackage{mathptmx} so that equations are set in Times-Roman rather than Computer Modern.
'Computer Modern' ain't
'Computer Modern' ain't
Actually the new way is (supposedly) to use
\usepackage{times} is a good solution. I also like to use \usepackage{mathptmx} so that equations are set in Times-Roman rather than Computer Modern.
Using these also results in far smaller PDFs, because embedded fonts are not needed so much.
% New TX (URW Nimbus Roman) - nie ma zainstalowanego
\usepackage{newtxtext} % roman text font provided by a Times clone
\usepackage{newtxmath} % math italic letters from a Times Italic clone
There is also the problem of creating a PDF in such way that copy'n'paste works correctly even in the presence of characters outside US-ASCII set, in UTF-8 encoding, and ligatures. This is not the problem for LuaLaTeX and XeLaTeX; for pdfLaTeX I ended up using:
\usepackage{tgtermes} % use TeX Gyre Termes, a font family that extends URW Nimbus Roman
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc} % write document using UTF-8 encoding
\input glyphtounicode
\pdfgentounicode=1
Which is admittedly not very newbie-friendly...
Learned something new
I also like to use \usepackage{mathptmx} so that equations are set in Times-Roman rather than Computer Modern.
What's new in TeX, part 1
What's new in TeX, part 1
What's new in TeX, part 1
I only half agree with this comment. I remember that I considered CM "oldfashioned" when I first started to use TeX about 25 years ago and tried various other font options from time to time. Most of these experiments I abandoned rather quickly.
What's new in TeX, part 1
I think to some extent it comes down to having an italics font which is visually very distinct from the upright shape so that the visual parsing of mathematics is easy on the eye. Then big symbols like sums, integrals, and big parentheses are sufficiently large without being very black, so they don't stick out from the page but rather blend in well with the entire formula. Finally, the font metrics are done well and produce well-balanced output.
What's new in TeX, part 1
What's new in TeX, part 1
TeXamples and TeX & LaTeX StackExchange
* "Fill style that looks like hand-drawn / hand-filled with crayon" (http://tex.stackexchange.com/questions/78044/fill-style-t...)
Inline computations
Inline computations
The R language (aka GNU S) has had this for over 10 years in the Sweave system by Friedrich Leisch. It implements Knuth's idea of literate programming, where code and text are developed together in one file.
A source file with text in LaTeX and code blocks in R is processed through Sweave, where the code blocks are evaluated, and the results (eg graphics) are included in the resulting document.
The knitr package is a more recent implementation of the same ideas.
Inline computations
Inline computations
Online (La)TeX editors
What's new in TeX, part 1
What's new in TeX, part 1
What's new in TeX, part 1
What's new in TeX, part 1
What's new in TeX, part 1
What's new in TeX, part 1
What's new in TeX, part 1
Wol
What's new in TeX, part 1
What's new in TeX, part 1
<Compose> mo: ∈ (element/member of)
<Compose> pd: ∂ (partial differential)
<Compose> fa: ∀ (for all)
<Compose> te: ∃ (you can guess it I think)
What's new in TeX, part 1
What's new in TeX, part 1
What's new in TeX, part 1
What's new in TeX, part 1
Entering Unicode math symbols easily
Also, the unicode equations are fascinating, but what's a good editor on linux that makes entering unicode math symbols easy? There's no question the source is more readable this way, but entering familiar LaTeX code still seems faster unless there's a really good unicode editor around.
C-x 8 RET
prompts for a character name (or its hex codepoint): I frequently use it for emojis; e.g.
C-x 8 RET face TAB
C-x 8 RET thumbs TAB
C-x 8 C-h
enumerates a bunch of shorcuts for specific characters; e.g.
C-x 8 <
yields «C-x 8 a >
yields →C-\ iso-transl RET
) allows the user to type those characters without the C-x 8
prefix;C-\ tex RET
); I frequently use it for greek characters; e.g.
Entering Unicode math symbols easily
Apologies! I must have glossed over ceplm's comment yesterday; I got nerd-snipped today by the text you quoted :)
Entering Unicode math symbols easily
What's new in TeX, part 1
What's new in TeX, part 1
What's new in TeX, part 1
What's new in TeX, part 1
What's new in TeX, part 1
What's new in TeX, part 1
One frequent issue is that it is often complex to tell the newer TeX engine how to pick the right font file. For instance, you may use `fontspec` to say 'I want font XXX' and then discover that unless you give to fontspect the exact filename of the font, the engine picks some version of the font on your system that misses some gliphs. Another frequent issue is that it is cumbersome to set up sensible font/gliphs substitutions for fonts that may lack certain gliphs. For instance, say that you want to use font "XXXX" and that "XXXX" lacks greek support. Telling LaTeX which font should be substituted for the occasional greek letters in case they are missing (and just for them) is not trivial. Similarly, say that the font misses the "Ohm" symbol. Telling LaTeX that in this case it can default to a greek Omega also seems non trivial.
What's new in TeX, part 1
Outdated packages in distributions
What's new in TeX, part 1