LaTeX Cookbook – Collection of LaTeX Recipes
latex-cookbook.net
latex-cookbook.net
There is beamer for presentation that is a pain to work with. Sometimes the most that I can understand from an error message is the slide in which the error has occurred. Sometimes I even have to incrementally delete the text and compile the remaining text to identify the slide location. Sometimes I can’t even abort the program with Carl+C or D or X after the error has occurred, and I have to close the terminal (maybe IDEs are better, but that’s another can of worms). It’s also super slow. I am really in pain working with it quite often.
A lot of times, producing the intended behavior in latex requires complex hack of internals (see Stack Exchange answers) because the feature is not natively supported.
It seems software engineers don’t care about LaTeX (and don’t use it to know about its problems). Academics are also not expert in software to fix it. The pace of development thus has been slow.
Most academics want to take plots they make in Matlab or whatever and put them into the template supplied by a journal and get an elegant looking document with well typeset equations and a bibTeX bibliography.
I would totally be fine with LaTeX being replaced, but I hope to god that I'm not forced to us MS Word all the time.
Feel free to check this information's trustworthiness from any top-N engineering conference proceeding. Any year of your choice. It is easy to verify by looking at metadata for the PDF engine that made the document.
"We do not provide LaTeX templates as this generates technical issues with the IEEE process. If you nevertheless decide to use LaTeX,...", seems like a slight discouragement.
IEEE does not provide checking or process their sources because they pay only the token amount to keep IEEE banner. (IEEE recognition for local events and their commission/fees is a scam, but that's not what we are here for. These institutions pay a base charge of ~$3000 USD to get their paper indexed in IEEE Explore. It also gives name rights to use IEEE in conference name. For several other conferences, they also take 25% of the attendee's registration fee).
Source: Personally, in programme committee of two recognized international conferences: [International Conference on Image processing (ICIP) & International conference on Pattern recognition (ICPR). You can look up the validity of a conference on Google scholar metrics)]
[1] https://scholar.google.com/citations?view_op=top_venues
[2] https://scholar.google.com/citations?view_op=top_venues&hl=e...
If you would like to support the ongoing work happening with TeX, LaTeX, and friends, please consider joining a user group. You can join the TeX Users Group at https://tug.org/join.html, or there is a link to instead make a donation at the same page. TUG does a lot; see https://tug.org/activities.html, including supporting the LaTeX3 project and the development of LuaTeX over the years, as well as work on accessibility.
If you prefer, there are many other users groups centered on location and lanugage. See https://tug.org/usergroups.html.
It always gives me the impression of beiing better structured, and it doesnt have module architecture (so no conflicts). Unfortunately when a couple of years ago I tried to install it on windows the installation was extremely painful, and the documentation I found lacking (unfortunately).
They keep on adding things, experimenting things, sometimes removing things, changing engines. If they think of a feature or someone asks for it, they implement it right away as a fix. They are very nice and helpful, but the problem is that those small features and fixes are not sufficiently thought out to maintain consistency. They are just there to get things done on the moment.
The documentation is mostly at introduction level, whether it is named that way or not. It is almost never exhaustive, it is often not up to date. Often, the options are not described, you just have their name: no idea about what they do, let alone how they interact.
Because things interact there too, and as with LaTeX, it doesn't always interact well, despite the more integrated approach that ConTeXt proposes.
It (more and more?) shares some of the problems of LaTeX. LaTeX has many different packages for the same thing (let's say tables) and none of those is complete? Same thing in ConTeXt nowadays, there are several table environments, and none of them is a pure improvement upon the others. So a package/environment adds a feature compared to an existing one, but it doesn't include all the features of existing ones. So you often end up with the same category of problem:
-- I want to do A => use this package/environment! -- I want to do B => use that package/environment! -- I want to do A and B => you're out of luck!
Yes, I am a bit, no, a lot pissed at the moment:
a. by my constant or growing struggles to get some stuff done on ConTeXt and LaTeX, stuff which doesn't look from outerspace and seems it should be handled out of the box, without needing to get dirty with low-level macros just to get stuff to behave consistently (because often said stuff actually works in some cases);
b. by the lack of robustness those tools are still showing, despite decades of massive time and energy investment by people who have a much better understanding of these shenanigans than I have. This is emphasised by my recent attempt to come back to LaTeX and the subsequent finding that I am hitting the same kind of exhausting inconsistencies I was hitting 10 years ago.
I am so depressed about the situation that I think that it must be impossible to build something robust upon TeX as a programming language. TeX the composition algorithm is probably fine, but building something based on this fragile, clunky macro language is probably destined to end up being fragile and clunky, in spite of the original intent. The automation of composition is already a difficult subject with a great many moving, interacting pieces; having to deal with such a rough language on top of this...
In my experience, whenever Ctrl+C doesn't work, LaTeX can be terminated by pressing the X key and then Enter. (Look for the "Type X to quit or <RETURN> to proceed" in the error message.)
Why expect every one of the million features users might want be "natively supported"?! What you describe as "a complex hack of internals" is usually in practice a 30 second visit to Stack Exchange and a cut and paste. Although I haven't needed to do that in a long time. I was amazed when I started (it did take about 3 months of intense learning in the beginning) that every package I needed or wanted was already on my computer, and usually the author was on TeX stack exchange answering questions!
The speed problem is mentioned in the Beamer’s paragraph. It’s true to some extent for latex too, but becomes problematic with beamer (lots of figures with Tikz and pgfplots etc). And I have to use beamer, because the source documents are in latex.
When you consider collaborative writing, Overleaf is slow even with base latex.
If you use it heavily, you will see its issues. Part of the problem is that it’s not consistent. In Python, when I type print(“LaTeX”) the answer is always the same. In latex if I type, \hspace*{5mm} it depends on many things. This becomes specially problematic when the effect you are trying to produce is not covered by a common template; the language is not fully rule-based either so that you systematically produce it yourself. You have to try various things.
Not OP, but having similar problems as OP. One of the reasons I use(d) it in the terminal is because I use make which also generates figures for me. I also don't like having to learn X different GUIs for Y different programming languages and prefer using vim and make if possible.
CorrectHorseBat: "I use make which also generates figures for me" - I'm curious how that works! Sounds very interesting.
Not generating clear error messages, or apparently requiring a gui as the easy way is definitely Latex's (and the tooling around it) fault in my eyes. Latex files are text, just give me a decent compiler and let me use my own editor. If that is too hard there's something wrong.
Also to me all the syntax is unnecessary cryptic, working with "variables" is a pain, nice modulatisarion is non-existent and probably a few more things I forgot.
>I'm curious how that works! Sounds very interesting.
Nothing really fancy. I have python scripts that generates figures which are included in my pdf. I use make to stitch everything together.
- Compilation feels almost non-deterministic at times. You should not have to recompile your document 2 or 3 times to get the final behavior, yet that's pretty standard practice. References / bibliographies don't work the first time through, and often you compile the bibliography separately, which is just crazy to me.
- Compilation errors are really non-helpful. In programming, if I omit one side of a bracket or parentheses somewhere, I'll almost certainly get an error with a reference to the line number right at or below the issue. GOOD LUCK finding a missing bracket in a LaTeX document based on the error messages when compilation fails.
- Lots of pretty simple behavior that really should be standardized and built in requires additional packages. The real problem comes when combining multiple packages... It's like how medications interact. It's almost hopelessly intractable to try and predict how multiple packages will interact with each other, so the way you do a simple thing in one document may change in another document depending on the combination of packages.
- >What you describe as "a complex hack of internals" is usually in practice a 30 second visit to Stack Exchange and a cut and paste.
I'm with the person you were replying to on this. There's a lot of really hacky stuff to get a result that really should have been built in. Like, a built in quote or excerpt for example, should just be a standard style like: /begin{quote} Quote \end{quote}. But instead you have to do it as a \parbox[center]{hope-you-guessed-a-good-width-mm}{Quote}.
- It's a small thing, but the way you do quotes is pretty silly. Not a fan of `` '' instead of "". If that's really how I have to do it without including additioanl packages, why not at least have a built-in like: \lquote and \rquote ?
I am normally a person that is deeply opposed to language updates, unnecessary feature updates, new frameworks, etc. But in the case of LaTeX, it's one of the most obvious examples I can think of where it's desperately needed.
You are right but I think is not trivial to solve because contrary to programming languages LaTeX is interleaved with natural language and so almost everything is possible. Maybe the best approximation is to have heuristics. For example start with a valid document, introduce errors and train a neural network to identify the problem. Overkill?
TeX being "interleaved with natural language" is not at all at the heart of the problem IMO. Every HTML document does so, too. The real problem lies much deeper. TeX uses recursive rewrites of the code that is the document to achieve what it does, without properly keeping track of where it is and what it does. There is no technical necessity for doing so, but the technique introduces huge complexity costs. On a somewhat related note, TeX's syntax at its very heart is also not trivial to parse short of executing (compiling) a given document (i.e. TeX's syntax itself is Turing-complete). This has been done only because the author got carried away by the coolness factor of it. Already a few years after TeX came out, Leslie Lamport implemented LaTeX on top of TeX to make TeX more approachable to less dedicated / insanely gifted users; he chose to dial back on this very aspect—the inscrutable syntax—and proposed a much more regular syntax as a convention.
To say that "HTML is not Turing-complete, therefore CSS as a separate language is required" is not even wrong and I leave it to the readers to fill out the blanks.
To say that "HTML is not Turing-complete, therefore JavaScript as a separate language is required" is more or less correct although to be fair we've seen many, many features such as animation being absorbed by declarative CSS that had to be implemented in imperative JS so in that regard the need for JS has diminished.
I can say with certainty that a full fledged programming language (i.e. Turing-completeness + usability) is absolutely necessary for a viable solution of document production. And while one can and people do produce TeX and HTML output programmatically, this does not obviate the need for a typesetting engine that can tell you where you are and what the circumstances are while typesetting the document. JavaScript has grown many abilities in this direction, but TeX in comparison is, after almost 45 years in development, still lacking and CLUMSY AS HELL for crying out loud.
Nothing is easy, simple or straightforward in TeX. Numbers are difficult, units are difficult, command syntax is difficult, namespaces are difficult (because there are none), variable names are difficult, conditions are difficult (there are like hundreds of specialized \if s), knowing in which column you are is difficult, fonts are difficult, character encoding is difficult, keeping constant line heights is difficult, positioning floats is difficult, the processing model is difficult, the very syntax is difficult.
I've said it before and I will say it again: TeX is a computational typesetting system, but it turns out it's quite bad at dealing with numbers, strings, and conditions, the basic building blocks of computational typesetting.
TeX is an utterly broken system because every single aspect is a convoluted mess.
It does get a lot of praise for its incorporation of the Knuth-Plass line breaking algorithm, and rightly so. However this beast, too, is hard to handle unless you just go with the defaults. It will happily give you overshooting lines because Knuth decided to have a word jutting out the right margin was a better solution than unsightly spaced words or letters. Most printers would disagree and just bite that bullet where necessary.
Yes, TeX will issue a warning in such cases but this is almost insubstantial because TeX keeps warning you about many, many things in the same output stream as its informative messages. That stream is almost impossible to parse for humans and machines alike. To make it even harder TeX's console output is hardwired to wrap at column 80. Even TeX's error messages are a convoluted mess.
/rant
And to come back to your original question, yes, I do have the strong suspicion that the separation of styling (CSS), content (HTML) and programming proper (JS) into three distinct compartments with differing syntaxes is close to the local optimum that we as people in this time and age can and want to deal with. If anything the syntax of JS and CSS could perhaps be unified (CSS is 90% JavaScript's object literal syntax; it adds selectors, allows hyphens in property names, and has quite a few notational amenities on the right hand side; other than that, it's like object notation). One can also imagine to express CSS in HTML which would be a bit clumsy but still somewhat usable. However, to unify markup syntax with imperative syntax is almost sure to fail. JSP (remember those?) and embedded PHP are two examples for how we do not want things to be. JSX looks a bit more viable. Svelte does this very interesting thing where they have a single file define the markup, the styling, and the behavior in a single file with three distinct parts; to me that looks like the future.
Then pandoc was released, and markdown let me be more expressive with content than dithering with minutia of layout. In that vein, I feel LaTeX is awesome but requires a comprehensive understanding of all of it to be fully expressive. I just want to type my papers quickly, ya know? So Markdown gives me what I need, and if a coauthor needs LaTeX pandoc can suitably provide.
I keep my resume in TeX, for what its worth. I suppose I keep my half-written data science book in it too :)
A little bit of trying TeXmacs and you could like it!
The build experience is magnitudes better than LaTeX or latexmk.
I'd be happy to argue this in detail, but I see that others have already hit many of the big points. (Some more: The typesetting is suboptimal, even if you improve it with the microtype package; the default symbols for real and imaginary part (\Re and \Im) are horrible; the cleverref package should be built in; the geometry package should be built in; the artificial distinction between equation and align environments is because the engine can't space properly around aligns, so this should be fixed and they should be a single command; \left and \right for delimiters often make really bad choices; the default font is the only good option if you need matching mathematical characters, and it grates on you after years of use; I could go on for hours...)
The more interesting question to me is: What should be done about this? LaTeX seems too embedded in the scientific community for there to be a clean break to a new technology (see, e.g. arxiv.org). Also, I'm not sure an entirely new markup language would be desirable, since the core LaTeX language is actually not so bad – it's the transformation of the markup to the final document where the problems occur. What we need is a new backend or shim layer that keeps the basic language but allows for more aesthetically pleasing rendering and better control of the layout.
The main asset of Lamport's LaTeX is its high quality formatting for printed artifacts. Most of that in turn comes from Knuth's TeX, which is a much lower level language. One can do (and many definitely have done) markup to TeX languages, but they never expose as much control as LaTeX does, so aren't very popular. Madoko (https://www.madoko.net/) does pretty good, however, so maybe try that? Otherwise, there are plenty of commercial and expensive typesetting systems out there, but besides the cost, I don't think they are even as user friendly or flexible as LaTeX.
I disagree that "The main asset of Lamport's LaTeX is its high quality formatting for printed artifacts." The main asset for the scientific community is that it lets them (relatively) easily write research papers that are dense with figures and mathematics. (And these are typically viewed online, via arXiv.)
Unless you are distilling to PDF, this is not viable. But I assume you mean PDF output, then you need a screen form factor that is paper-like, like an iPad or some other letter/A4 style tablet.
You can manipulate math for on-screen documents as well (MathML), but (a) it isn't very viable to use them for both formats and (b) people who pursue math publications mostly love the focus of paper formats (even if they view them on a screen as above).
Why do I need this? Concretely, I go to the arXiv. I look at the paper a bit on my laptop. Then I print it and read it away from my laptop. The printed version has the same pagination and layout as the screen version.
You can totally do that, and that is the most common case. However, if you had a letter-sized device perfect for viewing PDF papers, it wouldn't be "weird" anymore, the pagination and layout would just feel like a good fit.
iPad is closer to A5 than letter/A4, but most things that are intended for letter/A4 are probably tolerable on it for most users.
iPad Pro is almost exactly US letter size.
* Carefully sets out header with a tasteful collection of packages.
* Sets all tables thoughtfully using \booktabs, never dreaming of using vertical borders.
* Uses wysiwym everywhere, \emph for emphasis not \it etc.
* Gets an incomprehensible error because he copied a single Unicode character.
* Throws TeX document out of the window, opens text editor, types out markdown.
The last bullet point in dash2's comment specifically says "markdown". Why would you bring up MS Word?
Markdown is vastly under-powered for a lot of things people need to do. Word is a hot mess for the same. Etc. etc.
There are still huge conceptual leaps to be made in the notion of a computer as a document creator and content rendering, and Smalltalk provides some clues in that direction, though I doubt we'll see it in my lifetime, considering the weight of the last twenty-five years will make it difficult to change course.
The relevance of the above flight of fantasy to your point is that LaTeX, for all its awkwardness, is absolutely a local maxima in document creation, and I love seeing its results appear from the markup, knowing that it's following the numbers precisely, as if by magic, and print them out and marvel at the quality of the fonts close-up, and we need more such systems with which to create and render content, before denting the DOM+CSS hegemony in the manner I described above.
Also, those are naturally usable offline, are durable and have no interactive annoyances.
MHTML (aka .eml) is usable offline too (except for some reason by Firefox ?!?), while PDFs are horrible on screens smaller than the width of a page.
I'm not sure what interactive annoyances on scientific websites you're talking about - the most problematic ones these days are those with the assumption of a working Java or Flash plugin (and if they start to be plagued by irrelevant scripts it's much easier so far to block JavaScript in a browser than in a pdf reader), meanwhile many pdf readers don't even have any animation support, which is about content rather than presentation ! (As a metaphor : would you support a format unable to show pictures ?)
I added DVI rendering to NCSA Mosaic in 1994. Didn't go down well with anyone. Probably a good thing overall, but I still think it was a nice idea (multiple different renderers).
Please open any of the publications in https://www.texmacs.org/joris/main/publs.html (pdf versions) and then get your own opinion on whether anything else is crisp ;-)
I saw "France" at the top of the document and I quickly scrolled the document thinking, "Looks crisp French to me."
Then it dawned on me.....
It’s really like a style of clothing: a sort of old man’s suit that looks normal in academic institutions but in most other settings you do look like you’ve just come from that institution.
The typesetting is much better than anything in common (non-design-professional) use though.
On the flip side of the coin, I would say don't attempt to customize it. LaTeX out of the box is essentially what you need for an easy to read document.
There is no LaTeX graphic designer out there. I would agree to a little defeat and say the poster example on that website looked bad. If customizability is something people are looking for LaTeX is not the ideal choice because the learning curve for advance use can be incredibly steep, you may not have a good eye for good graphics if you are using LaTex in the first place and you might compromise early and say good enough.
Seriously, TeX is a bad maths language [http://xahlee.info/cmaci/notation/TeX_pestilence.html], surrounded by a terrible document markup language, wrapped in tooling straight from the 1980s, plus a community only too willing to tell you how your question is wrong.
Have you looked into Groff >> https://tex.stackexchange.com/questions/527864/latex-vs-grof...
I have heard atleast one people say that, the math syntax is much more elegant in groff as opposed to LaTex.
Been there, experienced that. Like this one poor guy who dared to ask at the TeX.StackOverflow help desk—"what can I do to get this and that vertical line in my table", only to get lectured by one acolyte, "Oh noes, don't, vertical lines bad, only horizontal lines in tables, proven to be the only way to go". Which totally throws centuries of finely typeset mathematical, astronomical and nautical tables out of the window while not answering the question.
To be fair, there are quite a few people on the TeXSO that go to incredible lengths to give extensive answers—expositions really—to hairy questions ('hairy' being a technical term here which translates to 'daily' in the context of TeX).
Everything is in a giant namespace. Package management is a mess and packages often conflict.
No numeric characters in method names. If you want to use numbers, you can only hack it using names like \WidthXV.
No functions in the modern sense. Everything is just macro expansion.
Turing complete but hard to write any useful code. I have seen more code written in Brainfuck than LaTeX.
I find the mathematical typesetting functionality of LaTeX to be incredible, but anything else (tables, columns, etc.) to be an absolute nightmare.
Pandoc allows for Lua filter to pre-process an AST generated from raw Markdown, and can then convert to 'traditional' LaTeX - why can't we utilise the best of both worlds?
For example, I used Pandoc to create Beamer slides in Markdown, with nice `div` syntax and maths typesetting - the advantage was I could focus on the semantics (and have a directly readable document) without any LaTeX fluff that was purely aesthetic.
That said, The Lamport book I used heavily in my undergrad still has a place on my bookshelf.
I am a peer-reviewer and an editor on a few academic journals. In my field, a mix of authors use [Xe](La)TeX and Word. There's a definite quality bias towards the TeX articles -- not because of the typesetting per se but rather because it's indicative of a lot of time spent carefully preparing a document to a standard. I'm sure others in similar fields have similar experiences.
I'm the proud owner of the entire 6 vol Computers and Typesetting series (of which the former title is vol A), and have worked through sizable portions of those. I also read mot of the 680 pages of Knuth's Digital Typography monograph. I also owned one LaTeX book at some point. I admire the depth of Knuth's knowledge (typographic and otherwise), the sheer diligence, his quest for quality, all of that. Those lion doodles though, the author's urge to land another witty remark, come up with another finely crafted reference, and how he's prone to hint at stuff instead of writing a proper documentation are not aspects of his work that I enjoy.
LaTeX, for simple articles and light math, is trivial to use and problem-free. The complexities arise when you try to do fancier stuff. How much fancy stuff do you allow in monsterwriter? Does it support multiple language conventions on the same article? Can I generate monsterwriter articles programatically in an easy way? Can I prepare a pdf presentation with animations like in beamer? A poster in arbitrarily large paper size?
Just my thoughts.