LaTeX — the age-old typesetting system — makes me angry. Not because it's bad. To clarify, not because there's something better. But because there should be.

When writing a document using LaTeX, if you are prone to procrastination it can be very difficult to focus on the task at hand, because there are so many yaks to shave. Here's a few points of advice.

• format the document source for legible reading. Yes, it's the input to the typesetter, and yes, the output of the typesetter needs to be legible. But it's worth making the input easy to read, too. Because…

• avoid rebuilding your rendered document too often. It's slow, it takes you out of the activity of writing, and it throws up lots of opportunities to get distracted by some rendering nit that you didn't realise would happen.

• Unless you are very good at manoeuvring around long documents, liberally split them up. I think it's fine to have sections in their own source files.

• Machine-assisted moving around documents is good. If you use (neo)vim, you can tweak exuberant-ctags to generate more useful tags for LaTeX documents than what you get OOTB, including jumping to \label{}s and the BibTeX source of \cite{}s. See this stackoverflow post.

• If you use syntax highlighting in your editor, take a long, hard look at what it's drawing attention to. It's not your text, that's for sure. Is it worth having it on? Consider turning it off. Or (yak shaving beware!) tweak it to de-emphasise things, instead of emphasising them. One small example for (neo)vim, to change tokens recognised as being "todo" to match the styling used for comments (which is normally de-emphasised):

hi def link texTodo Comment


In a nutshell, I think it's wise to move much document reviewing work back into the editor rather than the rendered document, at least in the early stages of a section. And to do that, you need the document to be as legible as possible in the editor. The important stuff is the text you write, not the TeX macros you've sprinkled around to format it.

A few tips I benefit from in terms of source formatting:

• I stick a line of 78 '%' characters between each section and sub-section. This helps to visually break them up and finding them in a scroll-past is quicker.

• I indent as much of the content as I can in each chapter/section/subsection (however deep I go in sections) to tie them to the section they belong to and see at a glance how deep I am in subsections, just like with source code. The exception is environments that I can't due to other tool limitations: I have code excerpts demarked by \begin{code}/\end{code} which are executed by Haskell's GHCi interpreter, and the indentation can interfere with Haskell's indentation rules.

• For large documents (like a thesis), I have little helper "standalone" .tex files whose purpose is to let me build just one chapter or section at a time.

• I'm fairly sure I'll settle on a serif font for my final document. But I have found that a sans-serif font is easier on my eyes on-screen. YMMV.

Of course, you need to review the rendered document too! I like to bounce that to a tablet with a pen/stylus/pencil and review it in a different environment to where I write. I then end up with a long list of scrawled notes, and a third distinct activity, back at the writing desk, is to systematically go through them and apply some GTD-style thinking to them: can I fix it in a few seconds? Do it straight away. Delegate it? Unlikely… Defer it? transfer the review note into another system of record (such as LaTeX \\todo{…}).

And finally

• Don't stop to write a blog post about it.

comment 1

In Emacs we have TeX-fold-mode, which does a pretty good job ad hiding the markup. I think this may be something you could benift from as well?

I completely agree on the traps that LaTeX offers when one wants to focus on writing. However, a well configured environment can help in avoiding these traps.

Comment by ,
comment 2

I think there is better. Basser Lout (https://github.com/william8000/lout), which unfortunately seems to be unknown, unused and perhaps even unmaintained. However, since I came across it, I have never bothered to touch Latex again.

Comment by ,
comment 2
Thanks for your comment. Interestingly, it was due to Vim's support for folds whilst editing latex that I switched from emacs to vim, 19 years ago: At that point I don't think emacs supported it, but perhaps it did and I was just unaware. I've stuck with vim ever since, but strangely I don't tend to use folds any more.
,
comment 4
Is LyX suitable for you? I sympathise with everything you’ve written, and have resolved to give LyX a serious go for my next writing project.
Comment by ,
comment 4

Have you considered using LyX? Generates the TeX for you, you don't even need to look at it, can skip to PDF output right away.

Comment by ,
comment 6

Unless you very often build the various chapters/section on their own, \include with \includeonly is usually enough to cope with that.
Obviously, if wanted one could even automate this with some Makefile scripting before calling latexmk