r/LaTeX•
decatron

What would a modern version of LaTeX look like?

I love LaTeX, and as a physicist I use it a lot. But it's now over 30 years old and sometimes feels a bit crufty (especially BibTeX). I'm no computer scientist, but surely we developed a lot of techniques meanwhile, and the author of pandoc, John MacFarlane, mentioned that he dreams of a modern version of LaTeX. What would that look like? What would you improve?

Posted Mar 19, 2014, 8:29 AM UTC

4575
davebees•

Better error messages would be nice. Like

file ended while scanning use of \OT1\

is not very helpful.

Also the way it generates a load of .aux files is a bit messy

48
unfoundable•

Speaking of which, is there a way to disable the .aux, .log et al files when compiling and only produce a pdf?

13
rm-rf_•

Just add a line at the end of your make file to remove aux and log files. rm -f *.log and rm -f *.aux if you like to live dangerously.

7
big-blue•

But please note that this will significantly increase the time needed to recompile a file, however small the change might've been.

6
[deleted]•

[deleted]

3
JimH10•

TeX uses some of those to keep track of information, such as cross references. You can run a script that cleans them up, if you want. One widely-recommended scripting program for LaTeX compilation is latexmk .

3
standard_error•

There's a huge number of packages available now, many of them doing one small thing. I would love to see more consolidation, either into Latex itself, or into larger, more comprehensive packages. I like things like tikz, siunitx, and biblatex. I'm not so happy about the patchwork of packages I have to use to get nice tables. For my dissertation last year, I used booktabs, multirow, longtable, tabularx, threeparttable, tabulary, and siunitx just for getting my tables right. I really think a single comprehensive tables-package is needed.

24
bfootdav•

I think a lot of us have this same dream and is the point of ConTeXt, to a large extent, as well as things like KOMA and Memoir. But are our lives made any easier by those excellent efforts? I'm not sure since you have to learn yet another layer of abstraction.

And yet I still feel like there should be something, some kind of organizing effort to bring it all together. I mean there are some totally killer packages out there that no one knows about but if you knew they existed they would be a standard part of your process.

It's all very complicated and I really don't know how to go about making it better.

8
BadWombat•

I'm just curious so do you have any specific suggestions for

totally killer packages out there that no one knows about but if you knew they existed they would be a standard part of your process

2
JimH10•

The problem is that everyone has different needs. So killer for me is not killer for you.

3
[deleted]•

That's all part of the unix philosophy. Do one thing, but do it well. Granted, it should be easier to find those packages.

5
standard_error•

True. But I would like it if the definition of "do one thing" could be expanded from "table notes" to "tables"...

7
PatronBernard•

Allowing the mixing of image types in one document without too much fuss.

21
onyxleopard•

You mean like you can with the \includegraphics command from the graphics bundle?

5
[deleted]•

I think there are packages for that (unless you count that as fuss).

2
JimH10•

What image types do you mean?

1
JimH10•

I'd have the ability to output to other formats, notably HTML. I'd also make the programming language more sane (although luaTeX may be that solution already, but I've not explored that).

14
[deleted]•

Pandoc can convert simple .tex files into html.

3
usernamenottaken•

Pandoc's parsing of LaTeX is pretty limited though. It works really well for simple documents, but most documents will use a couple of features that Pandoc doesn't support. You really need to reimplement all of TeX to support LaTeX documents properly.

5
JimH10•

Someone who would arrange so TeX output html, as pdftex was done to arrange so TeX outputs pdf, would be a hero.

1
djaclsdk•

I just wish more journals would accept LuaTeX and/or XeTeX things.

13
PhDBaracus•

The only feature I miss is native Unicode support. I'm annoyed about having to manually change non-ASCII characters and documents crashing when I miss them. With bibliographies it's even worse. I could import a bunch of foreign names from Zotero and the special characters could cause all sorts of problems.

10
decatronOP•

I'm annoyed about having to manually change non-ASCII characters and documents crashing when I miss them

Doesn't \usepackage[utf8]{inputenc} fix that?

23
PhDBaracus•

Threre's a package for that?! I'll have to try it ASAP!

11
decatronOP•

... I don't understand how you survived until now.

29
djaclsdk•

Many TeX users who don't know good places to search for Tex related information or places to ask TeX related questions, mate. If I ever write a book on LaTeX, it'll consist of just two pages: one page has "Go to UK TeX FAQ" and another page has "Visit LaTeX Stack Exchange".

6
KrunoS•

It still doesn't work for bibliographies. You have to still type '{} or whatever you may need. It was my bane for 3 months as i needed to put out reports in spanish and with ACS style bibliography.

2
celebril•

Or just use a modern TeX engine like LuaTeX or XeTeX, which supports full Unicode.

Also, for bibliography, BibLaTeX with the Biber backend supports full Unicode as well. No more \ae and stuff.

2
Djatha•

XeLaTeX and luaLaTeX handle unicode fine-ish out of the box. Just run xelatex instead of pdflatex.

11
dClauzel•

I completely agree. I have been using XeLaTeX for about 6 years, instead of LaTeX, for scientific publications and course support.

The switch is very easy, and the gains are wonderful: native unicode support even in bibliographies (with biblatex and biber), direct use of system fonts, advanced typography (microkerning, ligatures, etc.), and so.

When you produce your first document with the font Garamond Premier Pro, it looks so gorgeous that you want to lick your screen ;)

7
[deleted]•

[deleted]

0
djaclsdk•

A modern version of LaTeX would have to fill the current needs better than the current LaTeX does. What are some current needs then?

I know TeX is originally invented for purposes of typesetting. Then LaTeX came. Now this is being used for more than just typesetting, and some purposes that may not be what TeX was first made for. For example, math note taking. Storing your notes that may include math expressions. I take some math notes in LaTeX format, but I will be the first one to admit that this is really not what TeX was made for. That is, in some sense, I am using a wrong tool. So why do I and why do we use continue to use LaTeX for notes? For me, because I see no other alternative, and because it just works.

So let's embrace this arguably misuse of LaTeX, and then now what can we demand? For one, I'd like to see some semantic features. I want a version of LaTeX that let me write math expression with their semantic meanings included. Something like MathML but less verbose. Something that a tool like pandoc can export to and import from easily without losing too much information.

9
looksfamiliar•

I like markdown, with latex equations, processed through pandoc.

2
onyxleopard•

On OS X there is a nice hybrid LaTeX/Markdown editor: Archimedes.

3
bluerobotcat•

Shameless plug. I have recently been working on something like a modern LaTeX: Termcat. This project is still in the 'prototype' stage but I hope that perhaps it can inspire someone who's interested in working in this domain.

One thing I did with Termcat was focus on a simpler syntax. This syntax is heavily influenced by Markdown. I also made entering mathematical equations 'modeless'. Having to demarcate the start and end of a mathematical equation in LaTeX always struck me as weird since the start and end of a math expression can often be deduced from context. E.g. upon encountering an infix binary operator, you know that (usually) to the left and right of the operator there will be a mathematical expression.

Another thing I did is base everything on HTML and CSS. I also made it easy to insert JavaScript code. The idea is that this way libraries such as D3 can be leveraged. By basing it on HTML it should also be easy to output ePub documents. And if PDFs are required then PrinceXML should offer a way out.

I have a tutorial and a live demo if anyone's interested.

5
flying-sheep•

Nice cat on the demo page ;)

Are you a FAUista?

1
bluerobotcat•

:) What's a FAUista?

The cat is originally an anarcho-syndicalist symbol. I have run into it in random places in Europe and the US though. For instance, a colleague of mine had a tee with a print of this cat, and I've seen an antique shop and and a bagel shop use it as their logo.

1
flying-sheep•

The FAU is an anarchosyndicalist trade union, and FAUistas are the members.

That cat is their logo, as well as the one of related unions.

2
tjl•

There doesn't seem to be any support for numbering equations or cross-referencing, or bibliographies. Even for simple LaTeX documents (e.g., a paper), I still need to refer to figures, equations, and tables. Numbering is necessary over and above any linking since it's a lot easier to scroll and see the equation referenced if it's only a half-page or so away. LaTeX takes care of all the numbering for you.

I can't see that there's any way to number figures or give them captions without a lot of manual work.

1
bluerobotcat•

Yup. It's very much a work in progress.

Addendum: Thanks for your feedback. My current thinking is that I shouldn't spend my time on things like bibliography packages right now since it's very difficult to get this right, at least if you want to do justice to all disciplines (biblatex is the best bibliography package that I know of, but it's not for the faint of heart). However, I will add some plumbing to make it easier to add things like this.

1
lazyplayboy•

An installation that is smaller than most operating systems would be nice.

Several gigabytes of disk space is insane, and a significant issue in the world of SSD.

5
JimH10•

What is SSD?

1
Actualacc•

Solid State Disk. In simple terms, it's a type of hard drive that is usually small but runs quickly.

Mine is only 120 GB and it holds an operating system, a game and other nonsense so that LaTeX takes up quite a bit of my free space.

2
coryknapp•

Yeah, what the hell is going on with that? Does anyone know why it's so large?

1
celebril•

It's mainly because of the installer's tendency to install everything.

The source files of the binaries, all the fonts, the fancy and huge PDF files for documentation...

The main English documentation PDF for minitoc alone is 27 MB. These things add up quickly, especially when TeXlive likes to install documentation for every language available.

1
davidmn•

I've found jabref to be a great solution to sorting bibtex stuff.

I'm not sure what would be changed, what I like about LaTeX is the giant body of knowledge behind it. If I want to do something I'm almost guaranteed to find someone who's already worked out how to do it.

3
TotallyNotKen•

Not just better error messages, but better messages in general. If I say I want a figure "here," and it gets moved, print a message about why it was moved. If I say no page break, and you break the page, print a message about why that page break was added.

I'm in IT, somehow it got out that I use LaTeX, people bring me questions, and it's annoying when there's nothing to go on except "the figure doesn't appear on the page where I said to put it." People end up doing trial-and-error by deleting things to see if the figure moved because it wouldn't fit, except that wasn't it, so maybe if I specify the figure before the paragraph then they'll be on the same page, but that didn't work, so now we'll try something else.

It just seems to me unforgivable to not do what the document specifies without giving really good feedback about why.

3
cmd-t•

Like others said, native unicode support, a simpler syntax for complex macros, easier package installation (with correct versions, like a Gemfile or requirements.txt for bundler and pip in ruby and python).

2
djaclsdk•

Is MathML a good substitute?

2
cowgod42•

Some kind of XML-like incorporation, kind of like BibTeX, but not restricted to bibliographies.

For example, suppose in the middle of your document, you want to make a detailed list of talks you have given. Each one has a title, a place, and a date. Say you want to put the title in italics and the date in bold or something, and sepate the by periods or commas or some combination. You could manually format each one, but it is easy to make mistakes. It would be better to be able to just write:

\begin{My_Custom_Format_Block}
    % Format defined in the header or something
    \begin{entry}
        \title{Title 1}
        \place{Place 1}
        \date{Date 1}
    \end{entry}

    \begin{entry}
        \title{Title 2}
        \place{Place 2}
        \date{Date 2}
    \end{entry}
\end{My_Custom_Format_Block}

Also, it would be nice if align didn't complain about blank lines.

2
JimH10•

Am I missing something? Why can't a person do this with \newenvironment ?

3
usernamenottaken•

This guy is attempting a replacement, although it has a long way to go before it's usable: http://www.mos6581.org/introducing-rinohtype

It's written in Python and uses restructured text as the input format. It supports OpenType fonts and unicode input (same as XeLaTeX).

2
[deleted]•

[deleted]

1
rockee•

Track changes for easy collaboration (like word; not like meld).

2
duetosymmetry•

git or hg or ... any modern RCS.

4
orlock•

From my wish list:

  • Upgraded so that languages, colour, tables, images, font management, etc. are fully integrated into what is going on, rather than weird bolt-ons.
  • The ability to lay out a page and have cross-page movement with as much attention to optimal design as goes into the layout of a paragraph. eg. figures should be automatically placed so that they're readily accessible from the referring text, even if that means moving them a page or so forward.
  • A plugin architecture that allows people to write code for extensions in a modern language. The macro facilities are pretty amazing, given the amount of extension TeX is capable of, but they present a real barrier to someone who just wants to make a small extension.
  • A declarative language for things like styles, page layout, etc. Preferably not one with as many arcane hacks as CSS. Something that edges up to being Turing complete, without straying so far across the line to make it un-analysable would be good, since it means that tools that work in the design space, rather than the programming space, would be easy to produce.
  • A choice of input formats. There's no particular reason that LaTeX needs to be tied to the LaTeX input format.
1
adiM•

Have a look at ConTeXt. It meets all your requirements

1
orlock•

Looking at tutorial and manual, I'm liking ConTeXt.

But I don't see where, for example, figures might move forward a page automatically to give an optimal cross-page layout. The nearest I can see is the opposite placement. Similarly, I'm not seeing how I could elegantly set up a page design that, say had pull quotes and aside boxes in it.

I also may be misunderstanding the design of modules but I can't see them embedding into the engine in the way I would expect, say a Haskell plugin, in my hypothetical perfect typesetting system.

1
adiM•

Could you give (visual) examples of what you mean by cross-page layout and pull quotes with aside boxes.

1
orlock•

Cross-page layout:

This one is a bit hard to explain with a visual example, since its a behaviour. Some examples

(a) I have a figure connected to a piece of text. When placing the figure, it may be necessary for optimal placement to move the figure a page or two before the accompanying text, so that it's readily accessible to the reader. In this case, the typesetting engine should float the figure towards the front and re-layout preceding pages to accommodate it. Or not, as the situation dictates.

(b) I have some paragraphs where optimal paragraph layout on one page means that the next page is pretty ordinary, with large gaps between only a few paragraphs. If that could be solved by being a little bit sloppy with the previous page, then it should do so.

What I'm asking for is the same sort of global minimisation of badness that happens with paragraph layout. With the typesetting engine doing the dirty work, rather than me manually fiddling with the input document to get the layout I want.

Pull quote: http://www.magazinedesigning.com/pull-quotes/

Aside box: or sidebar, although the ones I'm thinking of, for example from New Scientist, often don't keep to the side or the entire page layout changes to accommodate them. http://wiki.csswg.org/_media/spec/magazine1.png -- from http://wiki.csswg.org/spec/page-view

It's possible to do pull quotes and aside boxes in LaTeX but its very messy and its hard to actually describe what you want without a considerable amount of coding and debugging. Hence my desire for a declarative language.

2
JimH10•

allows people to write code for extensions in a modern language.

luaTeX; see http://www.luatex.org/ .

There's no particular reason that LaTeX needs to be tied to the LaTeX input format.

That's a very odd thing to say. There are of course all kinds of other input formats that can be coaxed to come out in LaTeX. For two popular examples, pandoc will convert markdown into LaTeX, and gnuplot will convert its input langugae into laTeX picture output. There are many lesser-known projects; just to name one, TeXML at http://getfo.org/texml/. So, a lack of these things is not a problem.

1
orlock•

Just saying what I would want for a modern version.

For plugins, I was thinking of going a little bit beyond scripting to being able to hook directly into the underlying algorithms, adding new elements to the paragraph layout system, for example, so that it becomes aware of aspects of the input. I think luaTeX does this, via the callback mechanism?

For input language, I see the main elements of TeX/LaTeX as text, layout elements, graphics, etc. tha get fed into an optimisation engine. I can convert, for example, an XML document into LaTeX input using XSLT. But in some ways, I'd like to keep the semantics of the input all the way down to the bottom (see the plugin comment above) so if I have a parser which generates the appropriate elements, why not go straight to the engine, instead of working through an intermediate language that is oriented more towards a human author.

2
shogun333•

Asciidoc with the features of LaTeX. The fact that you have asciidoc, RestructuredText/Sphinx, Troff, Perldoc, orgmode, and probably a whole bunch of others I can't remember right now is so stupid. Some of these are niche languages, but regardless, in many cases you could have created a single, simpler language, with perhaps extensions for specific applications. Instead, there is this big patchwork. If you chose any one of these languages and made it as popular as all of them combined it would be a much, much better solution to typesetting than LaTeX. As it is, LaTeX is this necessary evil. IMO, it only still exists because of how bad/underdeveloped alternatives are, not because it is anything particularly amazing.

That being said, I'm a terrible programmer and couldn't ever come anywhere near close to implementing something like LaTeX or any of these other languages. I probably have no business complaining.

1
albertopepe•

In this blog post from a few days ago, I propose that a modern version of LaTeX would look (or function) more like CSS: https://authorea.com/users/3/articles/4675/_show_article

As the post says, LaTeX was never intended for the web, it was intended for the printed page. And that is one huge roadblock when trying to bringing scientific writing to the web.

1
celebril•

LuaTeX/LuaLaTeX is the modern version of TeX/LaTeX. Full supported for Unicode, OpenType, and advanced Lua scripting hooks that can control the guts of TeX.

BibLaTeX (with Biber) is the modern version of BibTeX, with a complete overhaul of the way bibliography is managed — full Unicode support, huge database support, loads on new data types, many really nice and convenient options, loads of bibliographic and citation styles, etc.

1