Skip to main content

Personal opinions on LaTeX

I’m editing a paper (12 months and counting!) and I’ve had a few thoughts about LaTeX that I thought I’d write down. I don’t even care if this makes me a neckbeard, that’s the mood I’m in currently.

The hyperref package makes your references clickable when you compile to PDF. I can’t think of a reason not to use it.

I dislike people who set their editors to have a fixed maximum line-width! Word-wrap works fine, and means the window is full no matter how big it is. Also, newlines can be used to separate thoughts more clearly.

Avoid eqnarray.

Comments

Comments

The fixed maximum line-width method has really got me hooked. I know it’s not the right thing to do, but I’m hooked and I’ll tell you why.

First, I use emacs, and it lets me re-flow any paragraph to 72 character width using Meta-Q. I press Meta-Q a lot. It’s like a nervous tic. It’s like a little injection of feel-good juice every time.

The thing is, I like text inside environments to be indented. When I press Meta-Q, emacs figures out how many levels deep I am, and indents the whole paragraph accordingly. If I’m using emacs’s word wrap, then only the first line will be indented, and the wrapped lines will wrap all the way to the left. Perhaps this is emacs’s fault, but I don’t know of an editor that improves upon this.

Another issue is that sometimes the editing window is just too wide. Then the text stretches on for ages before it gets wrapped. Of course, normally you can just shrink your editor to the desired width. But sometimes this has undesired consequences such as squeezing toolbars.

Lastly, having your paragraphs on multiple lines sometimes makes editing easier. Because you can cut and paste lines, you might be able to rearrange phrases in a paragraph easily, and then finish things off with a Meta-Q.

So on reflection, it seems like a lot of my addiction and problems stem from the fact that I use emacs. But I just wanted to write (mostly for myself) the arguments for hard wrapping.

(PS: The moral of your link regarding eqnarray: just use align! That was a great discovery for me.)

Yes, my supervisor uses emacs too, so maybe its word-wrap is particularly bad. I use vim, but I’ll try to avoid that argument.

I like having a wide editor. Certainly wider than 72 columns.

The only point of yours I really agree with is that it’s useful to separate phrases onto their own lines. But it would be a huge coincidence if cogent thoughts always fitted into 72 characters (using twitter shows we have trouble even with 140), so I don’t like the hard limit.

Of course, you have a great point in that even two hard-wrappers could disagree about where to hard-wrap, and this would be just as challenging as the disagreement between hard and soft-wrappers (if not more). (!)

(To your last comment, of course cogent thoughts can take up multiple lines, and you can still cut and paste them quickly in groups.)

One advantage to a hard-wrap is that it makes version control more manageable. Of course, I don’t actually take the time to do this and I can never get coauthors to agree to anything other than emailing files back and forth.

If you have one giant paragraph with no hard-wraps, it occupies one line in the .tex file. If you use diff (or whatever), it will look for changes by line number. If you make multiple changes to a paragraph, it is much more difficult to see what they are. On the other hand, if you have only a few words on a line, it makes understanding the differences much easier.

Ahh, that’s a good point about diff. But still, just separating thoughts onto their own lines and not having a hard column-limit is what’s really important there.