News for hackers. Stuff that matters.
Re:Word processors are ditching equation editors in favour o... by na85 on Saturday June 15, 2019 @04:16PM (#20191879)
My biggest issue with (la)tex is how hard it is to find up to date best practices. There are fifty ways to accomplish your desired outcome but it seems like every blog post or stack exchange answer conflicts with everything else and it turns out half of what you're doing is deprecated.

I'd pay good money for a "modern idiomatic latex"-type of tutorial.

Re:Word processors are ditching equation editors in favour o... by impendia on Saturday June 15, 2019 @04:37PM (#20191994)
As a frequent LaTeX editor (professional mathematician) -- what are you attempting to accomplish? And what do you mean by a "best practice"?

My usual operandi is: poke around or Google for a solution, until I figure out one of the fifty ways that achieves my desired outcome. I then declare my problem solved. If my solution is deprecated (by whom?), then whoever deprecated it may tsk-tsk to their heart's content.

Most mathematicians I know are not all that fussy with how they write their LaTeX documents, the same way programmers can be extremely fussy with their code. If there are "best practices" out there, then they aren't widely known or followed.

That said, here's something that may interest you. On the arXiv (arxiv.org), at least in math and probably in other disciplines as well, the LaTeX code is available for nearly any paper you want. Pick your favorite paper, and then click "Download other formats" on the right.

If nothing else, you can see what professional researchers are using in practice.

Re:Word processors are ditching equation editors in favour o... by sampo on Saturday June 15, 2019 @04:49PM (#20192060)
For example, there are two "dialects" for writing equations: vanilla LaTeX, and the amsmath package. Also, graphicx is not the only package for including images in to a document (I just forgot what the other options are).
Re:Word processors are ditching equation editors in favour o... by na85 on Saturday June 15, 2019 @05:46PM (#20192370)
>As a frequent LaTeX editor (professional mathematician) -- what are you attempting to accomplish? And what do you mean by a "best practice"?

Well in the simplest case how about something like \bf versus \bfseries versus \textbf?

Google that and you'll find thousands of blog posts, each telling you which is the One True Way™ but not expanding on the why.

Finding actual answers is really hard for latex.

Re:Word processors are ditching equation editors in favour o... by impendia on Saturday June 15, 2019 @06:23PM (#20192555)
> Well in the simplest case how about something like \bf versus \bfseries versus \textbf?

Use any of them.

> thousands of blog posts, each telling you which is the One True Way™

When I don't know how to do something in LaTeX, here is my flowchart for figuring out how:

1. Google

2. Look at any of the thousands of blog posts

3. Try the proposed solution, while ignoring any "One True Way" crap

4. Are the results what I wanted? If yes then done; if no go to Step 1.

Re:Word processors are ditching equation editors in favour o... by kmm on Saturday June 15, 2019 @08:52PM (#20193153)
That sounds like a recipe for mysterious breakages and subtle inconsistencies. And most importantly you can never develop a feel for the language if there are no clear idiomatic ways to solve some problems. There needn't be one true way, but there has to be some consistency.
Re:Word processors are ditching equation editors in favour o... by impendia on Saturday June 15, 2019 @10:52PM (#20193562)
I would say this is true of a programming language, but not really of LaTeX.

Now LaTeX technically is a programming language, it's Turing complete. But in practice for most users it's not.

Sure, there might be subtle inconsistencies. There might be some bit of mathematical notation that looks slightly different in one part of your document than another. I guess some people would be bothered by this, I'm not one of them.

It is true that it's possible to become a LaTeX power user, and write all sorts of sophisticated macros. In that case, yeah, you want to get the foundations right. But if you're just doing something simple (e.g. writing up a math paper), then mysterious breakages aren't an issue; there's not really anything to break.

When I worked as a programmer in industry, I was quite anal retentive about how I coded, and getting a feel for the languages I used. They were the tools with which I did my work. But LaTeX, for me anyway, is merely the tool with which I typeset my work. An outstanding tool, perfect for the job -- but not one I choose to invest time in mastering.

Re:Word processors are ditching equation editors in favour o... by cpach on Sunday June 16, 2019 @04:37AM (#20194516)
To me, this sounds like a very reasonable approach.
Re:Word processors are ditching equation editors in favour o... by cozzyd on Saturday June 15, 2019 @05:27PM (#20192281)
Yes, which is why my arxiv target in my Makefiles strips comments in addition to putting all files in the same dir etc.
Re:Word processors are ditching equation editors in favour o... by impendia on Saturday June 15, 2019 @06:46PM (#20192665)
Indeed, reading through the comments can be quite entertaining at times. I think that many authors don't realize they can be read....
Re:Word processors are ditching equation editors in favour o... by chongli on Saturday June 15, 2019 @04:31PM (#20191964)
Hear, hear! I have been slowly evolving the way I structure my LaTeX documents and I still feel like it leaves much to be desired.

It has often been repeated that we should all aim toward separation of content and presentation and LaTeX has been highly touted in this area, yet I find it very difficult to achieve in practice. Far too often, I find some package-provided environment lacking and I need to manually add some extra space or what have you. Now my document has become tainted due to the introduction of explicit styling in the content file. It's now baked in at that location and is very difficult to update later.

How do I avoid doing this? It's not enough to say "go back and redefine that command/environment to make it work the way you want." LaTeX is a leaky abstraction.

Re:Word processors are ditching equation editors in favour o... by AnimalMuppet on Saturday June 15, 2019 @04:43PM (#20192025)
Just get Lyx. It's a graphical front end for LaTeX, so you never actually write LaTeX. You don't have to worry about what's idiomatic at all, because you aren't writing it. You're just writing a document.
Re:Word processors are ditching equation editors in favour o... by sackintor on Saturday June 15, 2019 @05:42PM (#20192344)
The best bit about LyX is using it to format LaTeX tables nicely.

When writing my thesis I used LyX but found myself creating more and more ERT (what LyX calls raw LaTeX code). I eventually just started using a text editor. However, I still do tables in LyX and copy them over -- such a pain to insert a column otherwise...

Re:Word processors are ditching equation editors in favour o... by na85 on Saturday June 15, 2019 @05:51PM (#20192394)
That's kind of an indictment of latex in and of itself; the best way to use latex is to not use it?

At that point why not just use .docx?

Re:Word processors are ditching equation editors in favour o... by souterrain on Saturday June 15, 2019 @06:56PM (#20192704)
Repeatability.

Complex formatting, such as figure captions and figure placement, in Word documents suddenly break for no apparent reason. Troubleshooting a “broken” Word doc is akin to fixing a typewriter while one is blindfolded.

Re:Word processors are ditching equation editors in favour o... by sjy on Sunday June 16, 2019 @12:02AM (#20193779)
Wouldn't it be nice if Word actually provided some kind of UI for working with the underlying XML, like the old WordPerfect 'show codes' feature?
Re:Word processors are ditching equation editors in favour o... by pletnes on Saturday June 15, 2019 @06:05PM (#20192476)
In my experience, journals sometimes use old versions of packages, so you often don’t want to use the «modern way». Examples: lualatex is often not available, biblatex is not supported, etc
Re:Word processors are ditching equation editors in favour o... by rightbyte on Saturday June 15, 2019 @04:31PM (#20191965)
Deprecated? Like, has Latex been updated since the www became a thing? The last standard was set 1994.
Re:Word processors are ditching equation editors in favour o... by sampo on Saturday June 15, 2019 @04:54PM (#20192086)
> Deprecated?

Yes. In 1994, you would `latex document` and then `dvips document` to get your document.ps. Then in the 00s almost everyone would use `pdflatex document`. And these days, pdflatex is going out of fashion, but I am unsure what the current to go tool is.

Re:Word processors are ditching equation editors in favour o... by silly_giraffe on Saturday June 15, 2019 @05:37PM (#20192319)
While still an early project, I am keeping my eye on the Tectonic(https://github.com/tectonic-typesetting/tectonic) project. A re-write of the core Xetex engine in Rust with a focus on many quality of life improvements - useful error messages, UTF8 always, less line noise during build, eliminating the intermediate files, etc.
Re:Word processors are ditching equation editors in favour o... by radarsat1 on Saturday June 15, 2019 @05:02PM (#20192127)
I recommend `latexmk -pdf <mainfile.tex>`

(This just runs latex and bibtex in the right order and the right number of times..)

Re:Word processors are ditching equation editors in favour o... by red_trumpet on Saturday June 15, 2019 @05:18PM (#20192211)
Used in that way, it still uses pdflatex, which sucks if you have Unicode symbols (even Umlauts äöü are complicated...). Though latexmk can easily be configured to use xelatex with the -xelatex flag.
Re:Word processors are ditching equation editors in favour o... by ulucs on Saturday June 15, 2019 @05:24PM (#20192256)
inputenc utf8 and fontenc T1 usually solves all my umlaut (and ğ) related problems
Re:Word processors are ditching equation editors in favour o... by cperciva on Saturday June 15, 2019 @05:07PM (#20192154)
the right number of times

Unless the authors managed to solve the halting problem, I guarantee that latexmk doesn't always run them the right number of times. ;-)

Re:Word processors are ditching equation editors in favour o... by rocqua on Saturday June 15, 2019 @08:07PM (#20192989)
It runs until you produce the same output twice in a row, or you exceed a maximum number of runs. This defaults to 5, but is user select able.

You can disable the maximum number of runs, in which case it really does run the right number of times.

Re:Word processors are ditching equation editors in favour o... by garmaine on Sunday June 16, 2019 @12:14AM (#20193812)
The snark was that you can create an infinite chain of varying output.
Re:Word processors are ditching equation editors in favour o... by red_trumpet on Saturday June 15, 2019 @05:15PM (#20192189)
I think the favorites are xelatex and lualatex. I normally use xelatex, because it handles Unicode well and can use otf or ttf fonts. Not sure about lualatex, but I heard it's nice to have Lua as a Scripting Backend.
Re:Word processors are ditching equation editors in favour o... by piadodjanho on Saturday June 15, 2019 @07:16PM (#20192794)
XeLaTex uses the same text shaping engine Firefox uses, that's why it looks so much better than the default latex.
Re:Word processors are ditching equation editors in favour o... by ufo on Saturday June 15, 2019 @07:09PM (#20192756)
Lualatex also has good unicode and support through fontspec.
Re:Word processors are ditching equation editors in favour o... by dual_basis on Sunday June 16, 2019 @08:18AM (#20195118)
Overleaf's documentation is quite good.