News for hackers. Stuff that matters.
Re:I hate LaTeX, I love LaTeX by dash2 on Tuesday May 24, 2022 @08:53AM (#31491359)
Jesus H Carnegie. I JUST WANT TO WRITE AN ACADEMIC ARTICLE.

I mean, look at this abhorrence. And look at what you open up in a TeX file, which again is meant to represent English prose.

   % Options for packages loaded elsewhere
    \PassOptionsToPackage{unicode}{hyperref}
    \PassOptionsToPackage{hyphens}{url}
    %
    \documentclass[
    ]{article}
    \usepackage{amsmath,amssymb}
    \usepackage{lmodern}
    \usepackage{iftex}
    \ifPDFTeX
    ... and more and more of this dross ...
I want to get stuck into the article. At least show me my abstract. But no. It's just more and more backslashes.

It's just vile. And the people who use it have Stockholm syndrome, and they pass it on to their PhD students who spend nights before their presentation at 2am, trying to align a table and crying. Then they have Stockholm syndrome too, and they tell you "it's pronounced LARTECH" and give themselves a little pat on the back.

And here's an equation:

    \sigma _{I}^{2}=a^{2}s^{2}+\left( 1-a\right)^{2}S^{2}+2a\left( 1-a\right)\sigma.

How are you supposed to manipulate that? I can open up a WYSIWYG editor and literally do maths by just copy-pasting parts from one side to another. But this, I can't even read, let alone intuit.

TeX. It's the worst.

Re:I hate LaTeX, I love LaTeX by quietbritishjim on Tuesday May 24, 2022 @09:12AM (#31491587)
Out of all the problems of TeX/LaTeX, the worst I found is that subscripts and superscripts visually dominate the line noise when they ought to be less visible than the main content. I think your example helps to illustrate that by the equations I tended to typeset where way worse for that problem. (But I only dipped my toe in properly programming it like OP, which I realise is even worse.)

This is really solved by the graphical equation editor in LyX. I wrote my master's thesis and PhD thesis using it, having previously written an undergrad thesis in raw LaTeX. When I switched, I was part way through writing up notes for a masters course and ended up rewriting them in LyX (sadly its LaTeX import is terrible). I found that I was able to write notes faster by a factor of 3! And I honestly was no LaTeX novice, it just really is less efficient. I shudder to imagine how long I would've spent on my PhD thesis without LyX.

The mistake people make with LyX is assuming it is for beginners trying to avoid LaTeX (and it does partly market itself that way). I consider it the opposite: it's best suited to those who already fully understand LaTeX. You still need to dip into it occasionally to edit the preamble or stick in the odd little snippet of manual LaTeX (that's ERT in LyX terminology). And while typesetting errors are much rarer with LyX (it's much harder to forget a closing brace when you don't put them in in the first place), when they do occur it's because something has gone really wrong so you better know what's going on.

Re:I hate LaTeX, I love LaTeX by Pinus on Tuesday May 24, 2022 @09:09AM (#31491557)
I agree that TeX sources are often damn near impossible to read. That stuff is... ugly. But at least it's there. You can see it. You can manipulate it. You can understand it (though it sometimes takes more time flipping through the TeXbook than any sane person is willing to spend). In comparison, WYSIWYGgery is like boxing with an invisible opponent. Where do I click, what magic check box three levels deep in dialogs do I need to check? Why does that word come out in a different font? How do I move the cursor across the italic/roman boundary? Why is there extra space here, but not there? How can I interact with things that I cannot see?
Re:I hate LaTeX, I love LaTeX by FabHK on Tuesday May 24, 2022 @09:43AM (#31491999)
Related: TeX sources can be put under source control, with meaningful diffs.
Re:I hate LaTeX, I love LaTeX by cuteboy19 on Tuesday May 24, 2022 @10:57AM (#31492963)
Word has version control built in and you can see diffs easily. (No git is not the only VCS)
Re:I hate LaTeX, I love LaTeX by camel-cdr on Tuesday May 24, 2022 @09:14AM (#31491618)
> \sigma _{I}^{2}=a^{2}s^{2}+\left( 1-a\right)^{2}S^{2}+2a\left( 1-a\right)\sigma.

I'd write the above expression as the following:

\sigma_I^2 = a^2 s^2 + (1-a)^2 S^2 + 2a(1-a) \sigma

The only thing you need to know to understand it conceptually is `_ -> move next character down`, `^ -> move next character up`.

Re:I hate LaTeX, I love LaTeX by dash2 on Wednesday May 25, 2022 @06:37AM (#31502601)
Right, sure. This is indeed copy-pasted from LyX, which is a saviour. Manually written, TeX can be better. But as soon as anything gets complicated, you're gonna be stuck again. The problem is not understanding something conceptually. It's intuiting it. I want my brain to be working on the maths. I don't want to use valuable brain cycles understanding the notation!
Re:I hate LaTeX, I love LaTeX by foobarian on Tuesday May 24, 2022 @08:56AM (#31491386)
I am with you for all* of it. The Stockholm syndrome bit is oh so true. But I take exception with the math, Latex math is its only redeeming quality (with Adobe FrameMaker coming in a distant second).
Re:I hate LaTeX, I love LaTeX by pacbard on Tuesday May 24, 2022 @11:52AM (#31493667)
I agree that LaTeX has not the best syntax, but that is a better alternative?

I mostly write in Word and I can tell you that it is not that much better than LaTeX. Sure, the editor is WYSIWYG so you can see right away the title, abstract, text, etc.

The problems I have with Word are mostly solved in LaTeX. For example, references are automatically managed in LaTeX. In Word, that's mostly a manual process (I know there are integrations with Zotero/Mendeley/whatever, but those are a little wonky on a long paper---I have never used the built-in citation manager). I sometimes feel bad for the editors that have to check all my reference lists. They usually find 1-2 papers that are either missing or included and no longer cited.

Tables are also a problem in Word, especially if your collaborators use an older version that breaks the formatting (Moving between Google Docs -> Word -> Google Docs also breaks a lot of things). I can't tell you how many times I had to reformat tables that a collaborator broke. Making complex tables is also wack sometimes, like adding a simple sub-rule between cells requires some column hacks in Word.

Table/figure numbering is also another thing that I loathe in Word. Manually renumbering is a pain and the automatic numbering always breaks for me in a way or another (maybe still thanks to my collaborators).

All those things work pretty well in LaTeX with some backslash commands.

What Word really shines is track changes and commenting. I don't know if there is a LaTeX editor where you can track changes and comments like in Word (I know that Overleaf has something that kind of works).

Powerpoint vs. Beamer is a whole different ball of wax. Both have pros and cons. But with presentations with a lot of equations, beamer is definitely better but, as you point out, it doesn't play well when you want to put an equation in a specific spot in the slide. In powerpoint, you can just click and drag and you are done.

Re:I hate LaTeX, I love LaTeX by dash2 on Wednesday May 25, 2022 @06:43AM (#31502641)
Ah, Beamer.

You know how people make animations in Beamer?

They write the same picture on multiple slides and then flip through the slides really fast. Like drawing flipbook pictures as a kid.

This, with computers thousands of times more powerful than what took us to the moon.

Re:I hate LaTeX, I love LaTeX by IshKebab on Tuesday May 24, 2022 @09:06AM (#31491517)
I agree. LyX is a much better alternative to LaTeX. It's a sort of GUI front-end to it, but it lets you do all the normal editing in normal WYSWYG way (but without the "is the space bold? why is the font of this blank line different?" you get with Word). Most importantly it has a really amazing equation editor.
Re:I hate LaTeX, I love LaTeX by funnym0nk3y on Tuesday May 24, 2022 @09:13AM (#31491596)
Honestly, do you have any idea how to improve the math mess? I did use both Word and LaTeX für equations, the latter is much faster for me. So WYSIWYM seems to have its usecase. But I agree, reading that equation is just awful. My idea would be tooling to partially render tha equation, e.g. rendering sections the cursor is not in.
Re:I hate LaTeX, I love LaTeX by officehero on Tuesday May 24, 2022 @10:14AM (#31492388)
I use word with embedded latex and I'd say it's almost as fast to write once you get the tweaks and hot keys going (eg. learn to never use the horrible "equation editor"). You make up in overall speed by readibility. Write an equation, render and its just there, write next equation, render, etc.
Re:I hate LaTeX, I love LaTeX by dash2 on Wednesday May 25, 2022 @06:39AM (#31502617)
There's this:

http://asciimath.org/

I wish someone would integrate this into pandoc so I could use it in rmarkdown.

Re:I hate LaTeX, I love LaTeX by iflp on Tuesday May 24, 2022 @09:03AM (#31491478)
The equation example is artificial. In practice there will be no curly brackets around these single-token sub/superscripts, nor should the \left / \right present in this example. With properly added whitespaces this equation becomes quite legible.

For more complex equations people use line breaks and indentations, and/or macros.

Re:I hate LaTeX, I love LaTeX by jasomill on Tuesday May 24, 2022 @04:04PM (#31496927)
As an example taken at random from my undergrad days, see

https://jasomill.at/metric.pdf

produced with

    \begin{align*}
      f^*(dx& \otimes dx + dy \otimes dy + dz \otimes dz)\\
      =&\ f^*(dx \otimes dx) + f^*(dy \otimes dy) + f^*(dz \otimes dz)\\
      =&\ d(f^*x) \otimes d(f^*x) + d(f^*y) \otimes d(f^*y) + d(f^*z) \otimes d(f^*z)\\
      =&\ d(x \circ f) \otimes d(x \circ f) + d(y \circ f) \otimes d(y \circ f) + d(z \circ f) \otimes d(z \circ f)\\
      =&\ df^1 \otimes df^1 + df^2 \otimes df^2 + df^3 \otimes df^3\\
      =&\ \left(\pdFOneU du + \pdFOneV dv\right) \otimes \left(\pdFOneU du + \pdFOneV dv\right)\\
      +&\ \left(\pdFTwoU du + \pdFTwoV dv\right) \otimes \left(\pdFTwoU du + \pdFTwoV dv\right)\\
      +&\ \left(\pdFThreeU du + \pdFThreeV dv\right) \otimes \left(\pdFThreeU du + \pdFThreeV dv\right)\\
      =&\ \left(\gOneOne\right) du \otimes du\\
      +&\ \left(\gOneTwo\right) \left(du \otimes dv + dv \otimes du\right)\\
      +&\ \left(\gTwoTwo\right) dv \otimes dv.
    \end{align*}
(note that, using my editor defaults, none of this equation's lines are truncated or wrapped)

The \g... and \pdF... are trivial ad hoc macros defined in the document. Producing the same document by repeatedly copy/pasting the tensor components and partial derivatives would have been considerably more time-consuming and error-prone.

Also notable is the align environment: type \\ for a manual line break and & at each point that is to be aligned.

I just tried to reproduce this with the "WYSIWYG" equation editor in Word, and I can't figure out how to do it — right-clicking on plus and equal signs gives an "Align at this Character" option, but this appears to be a special case, as the option doesn't appear when clicking on anything else in the example.

In particular, had the first line involved (implied) multiplication instead of addition, there apparently wouldn't be any acceptable point to declare alignment!?!

I'm also not sure what it means to align "at" a character, as characters have width, and characters to be aligned aren't necessarily the same width. Does it align the left sides? The right sides? The center?

Moreover, the default key bindings in the Word equation editor are counterintuitive: the usual binding for "manual line break" instead splits the equation in two and there doesn't appear to be any default binding for the "Insert Manual Break" equation editor command at all.

Sure, LaTeX has a learning curve, but it's not at all obvious to me that Word is any better in this respect.

Re:I hate LaTeX, I love LaTeX by dash2 on Wednesday May 25, 2022 @06:41AM (#31502626)
To be clear, the above is meant to be an example in favour of TeX? You look at that and think "well, it's obvious what's going on here"?
Re:I hate LaTeX, I love LaTeX by kzrdude on Tuesday May 24, 2022 @09:06AM (#31491516)
I want to use latex while using your attitude! It has to be simple and the syntax out of the way, almost like Markdown
Re:I hate LaTeX, I love LaTeX by blackhaz on Tuesday May 24, 2022 @09:04AM (#31491497)
That equation is easily workable with the code as is, and that options block is also fine. My bigger concern is someone coming in without enough experience and trying to disrupt the whole academia. Yes, the learning curve is steep - can anyone even say they finally know TeX? Aligning stuff and other things may take time. But if you're writing papers, the output quality is amazing and, what is important, consistent - light years ahead of WYSIWYG editors. I'd rather edit my equations manually in TeX rather than, say, popular office suites. And why would anyone want to do presentations in TeX anyways? It's like using a spaceship to shop for groceries.
Re:I hate LaTeX, I love LaTeX by bowsamic on Tuesday May 24, 2022 @08:57AM (#31491393)
As a physics postdoc I have to say that is quite a simple equation
Re:I hate LaTeX, I love LaTeX by dash2 on Wednesday May 25, 2022 @06:42AM (#31502630)
That's my point! The equation is simple. The markup makes it complicated. Now imagine a complex equation.