Live data from Hacker News

The Art of LaTeX: Common mistakes and advice for typesetting proofs

fanpu.io

91–100 of 149 posts

Re: The Art of LaTeX: Common mistakes and advice for typesetting proofs

#91
post #48
post #41

Earlier quoted context omitted.

The way I see it, this only proves my point. As you write: '...None of them have become the standard...' and this is at the center of the argument. TeX may not be ideal but it strikes the correct balance to become and stay standard for so many years. One can do pretty much anything in bare Postscript (and I am ashamed to admit, I have) or even 'handmade' PDF but it does not make it a good alternative to TeX. I have e…

I disagree. I think Latex will soon become legacy like Cobol. HTML and CSS basically do a lot more than Latex does - except for maths things - and are far more widely known, and far more forgiving. Also importantly, they support hyperlinks, animations, and inline interactive scripts. It seems that HTML and CSS with the appropriate CSS styles and shorthands (like Markdown) could eat up everything that Latex does and m…

The “except for math” part is doing a lot I think. There’s a huge amount of work needed to get rendered math to look as good as latex’s and I’m not sure CSS (as an example) is expressive enough to get this done

Re: The Art of LaTeX: Common mistakes and advice for typesetting proofs

#92

Most of this is good advice, but I don't see the \mathbbm vs. \mathbb distinction as anything other than subjective taste. Also, I use things like \newcommand{\abs}[1]{\left| #1 \right|} in the preamble. This way, I can use \abs{...} without any asterisks, and it automatically adjusts its size. In the 1% situations where I don't want it to adjust the size, I write the delimiters manually. Making maths look good in La…

This is the first time I have seen such a complaint against bibtex. Yes bib files are finicky to write correctly, and bibtex can be a pain to use. But bibliographies are never "imprecise, missing important info or plain wrong." I've written 100s of pieces with latex+bibtex, papers, websites, reports, books. bibtex always makes citations and bib entries look like what I or the publisher need. If something is missing,…

I have seen very few fully correct bibliographies written with bibtex in the wild. Not everything wrong with bibtex is a bug; the big problem is that bibtex is not adapted to its modern usage. A non-comprehensive list of problems:

1. Does anyone run bibtex directly from the command line? No, it's an extra step and the syntax is hard to memorize (should it run on the tex or the bib, and with or without the extension?). Instead, everyone eventually uses some form of script that does "pdflatex; bibtex; pdflatex; pdflatex" or something like this. Nice and slick; unfortunately it means that all warnings get hidden from view. A common mistake (particularly when copypasting) is accidentally having two AUTHOR fields in a bibitem, which causes the second to be ignored. No way you'll notice until you look carefully at the bibliography or read the bibtex log. It doesn't help that many of the warnings are false alarms.

2. Writing bibitems is probably as painless as it could be, but still painful enough that most people have "wandering" bib files that move from project to project. Unfortunately, this creates lots of problems:

2A. A book gets a reedition, or an arXiv preprint gets updated. You just update the reference, right? Wrong, of course, because your old references now lead to the wrong pages, sections, theorems.

2B. There are bibliography styles that print DOI fields but not URLs. There are ones that print URLs but not DOIs. There are some that print both, which is redundant. With a wandering bib file, which ones do you cater to? No way to do right by them all.

2C. With grey literature, a URL is often necessary, but many bibliography styles don't print URLs. So you end up including it in a NOTE field, which of course gets it duplicated in those styles that do print URLs.

3. Too many foot-guns.

3A. Bibtex (or most styles) automatically removes capitalization in titles ("Generalizations of dyck words"). Why? Why??? Yes, you can fix it by putting the {C}apital letters in braces. But why should you?

3B. You cannot use the packages or macros from your tex file in your bib file, as it's a separate file. Of course... but that makes you wonder why it should be a separate file to begin with.

3C. Yes, you heard it right: no package, in particular no unicode support.

3D. Basically every bibtex tutorial tells you to not trust bibitem-generating services, even the most official ones (IEEE, ACM). But no one has the time to do this on their own, and it stands to reason that there should be a common source at least for everything that is published and indexed. We got ORCID and DOI; is this that much harder?

Re: The Art of LaTeX: Common mistakes and advice for typesetting proofs

#93

Earlier quoted context omitted.

Both mathbbm and mathbb are wrong for number sets. These fonts look like the blackboard hack that you use to simulate boldface using chalk. On a computer you don't have this problem and you can simply use mathbf (actual boldface).

It might have originated as a hack, but now it's a font in its own right. Why not use it? It's quite common to see \mathbb{R} used for the actual set of reals, while \mathbf{R} means a totally ordered field (i.e., an abstract object behaving somewhat like \mathbb{R}). The distinction is deliberate and the notation is good.

> Why not use it?

Better question: why use it, when you can use the real thing?

Mathematicians concerned by typography universally use real boldface. For example: Terrence Tao's blog, Donald Knuth, Paul Halmos (author of "how to write mathematics"), and the famous journal "Publications Mathématiques de l'IHÉS" which is the undisputed gold standard in mathematical typography. They use real boldface for the number sets N, Z, Q, T, R, C.

I've never seen a boldface R to mean a set different than the real numbers. Maybe this is some fringe custom in model theory, but in mainstream mathematics it has a clear and standard meaning. Can you point me to a paper where they use a boldface R with such a meaning (i.e., different than the reals). I'm sure that this usage would always be accompanied by a clarification to avoid any confusion.

Re: The Art of LaTeX: Common mistakes and advice for typesetting proofs

#94

Earlier quoted context omitted.

This is the first time I have seen such a complaint against bibtex. Yes bib files are finicky to write correctly, and bibtex can be a pain to use. But bibliographies are never "imprecise, missing important info or plain wrong." I've written 100s of pieces with latex+bibtex, papers, websites, reports, books. bibtex always makes citations and bib entries look like what I or the publisher need. If something is missing,…

I have seen very few fully correct bibliographies written with bibtex in the wild. Not everything wrong with bibtex is a bug; the big problem is that bibtex is not adapted to its modern usage. A non-comprehensive list of problems: 1. Does anyone run bibtex directly from the command line? No, it's an extra step and the syntax is hard to memorize (should it run on the tex or the bib, and with or without the extension?)…

I agree with much of what you say. I certainly find bibtex frustrating. On your specific points

1. I might be the only one, but I do sometimes, for the reasons you say. To debug it. But yes, debugging bibtex files is a a real pain.

2. yes, but that is hardly bibtex's fault, would be the same with any system.

2A. (same response as 2)

2B Yes, and so have both fields in the bibtex files. Its the publisher who decided what they want, DOI, ULR or both or neither. Not bibtex's fault

2C dont know what "gray literature" is, sorry.

3. YES!

3A, Think you always will need something like that regardless of bibliography system. The publisher dictates only first word in title is capitalised, how then do you tell it to capitalize USA or Mary? {} is as good as any alternative.

3B. yes. I never had any need for that. do you mean \usepackage[utf8]{inputenc}

3C. yes, to be safe, one needs these weird latex formatting for foreign characters.

3D. Yes. Well I have the time. When I get a bibtex entry from some external source, It usually needs tweaking. And usually fastest is just to write it manually. But its a a trivial amount of effort

Re: The Art of LaTeX: Common mistakes and advice for typesetting proofs

#95
post #87
post #82

Earlier quoted context omitted.

> It is telling that no real alternatives have emerged during the 40+ years of TeX's existence. But what does it tell you that such an ugliness remains and the way to fix it is relatively unknown? It surely can't be a pro-TeX tell!

It tells me that beauty is in the eyes of the beholder, i.e. what one may perceive as ugliness, countless others will view as beauty or, at least functionality. I personally think that the ugliest design in existence is Python but I admit my opinion is not common. Moreover, I use Python myself, since syntax is not the only important thing in a language (the ecosystem is Python's undisputable strength). It is also unc…

"here are WYSIWYG editors for TeX as well." not there are not. Apart from TeXmacs I know of no editor which give you on the screen the same result you get on the paper. LyX has not such a feature. If an approximation is ok, then fine, but I do not think you can call it WYSIWYG. Is something else. And it requires a lot of work to do it correctly. You should at least appreciate the technical merits, even if you prefer to use LaTeX for its ecosystem. But as a user of both I see the clear merits of TeXmacs in terms of quality of my work (mathematician), I can focus more on what I'm doing, instead on deciphering the mess of the LaTeX formulas and try to find where to put a correction. I can give online lectures with it, discuss on zoom while scribbling on a TeXmacs document, much of the work I was doing on paper I do now directly on the computer. To me there is a clear difference in the user experience between TeXmacs and LaTeX and I will never go back to write LaTeX if I can help it (I do it sometimes, if my coauthors are using it and do not want to try otherwise).

Re: The Art of LaTeX: Common mistakes and advice for typesetting proofs

#96

Earlier quoted context omitted.

It might have originated as a hack, but now it's a font in its own right. Why not use it? It's quite common to see \mathbb{R} used for the actual set of reals, while \mathbf{R} means a totally ordered field (i.e., an abstract object behaving somewhat like \mathbb{R}). The distinction is deliberate and the notation is good.

> Why not use it? Better question: why use it, when you can use the real thing? Mathematicians concerned by typography universally use real boldface. For example: Terrence Tao's blog, Donald Knuth, Paul Halmos (author of "how to write mathematics"), and the famous journal "Publications Mathématiques de l'IHÉS" which is the undisputed gold standard in mathematical typography. They use real boldface for the number sets…

Huh, it appears a lot less frequent than I thought. I had misremembered some \mathrm{R}'s as \mathbf{R}'s.

That said, I still feel that I've seen every \mathbf letter used for something other than a standard number set somewhere. But probably not in the mainstream.

Re: The Art of LaTeX: Common mistakes and advice for typesetting proofs

#97

Earlier quoted context omitted.

It might have originated as a hack, but now it's a font in its own right. Why not use it? It's quite common to see \mathbb{R} used for the actual set of reals, while \mathbf{R} means a totally ordered field (i.e., an abstract object behaving somewhat like \mathbb{R}). The distinction is deliberate and the notation is good.

> Why not use it? Better question: why use it, when you can use the real thing? Mathematicians concerned by typography universally use real boldface. For example: Terrence Tao's blog, Donald Knuth, Paul Halmos (author of "how to write mathematics"), and the famous journal "Publications Mathématiques de l'IHÉS" which is the undisputed gold standard in mathematical typography. They use real boldface for the number sets…

True boldface has a much darker type color than blackboard bold, thus drawing your eyes to it. But usually, the occurrences of, say, the real numbers are not the most interesting or important part on the page and they thus don’t deserve that emphasis.

(Also, admittedly, I like the look of these letters.)

Re: The Art of LaTeX: Common mistakes and advice for typesetting proofs

#98
In the spacing section, the author's suggestion to use absolute spacing operator (e.g \;) is actually not recommended. a better way is to make `dx` a math operator (`d` is an operator isn't it?).

Some other suggestion is not actually recommended in the official documentation of amsmath as I recall.

Hope this helps.

Re: The Art of LaTeX: Common mistakes and advice for typesetting proofs

#99
One bit I would add: don't use xspace package. If you defined a macro with 0 argumemts like

  \newcommand\kek[0]{kak}
You must always put {} after it's invocation like "\kek{}". If you do "\kek", that may eat the following space in some cases. Doing "\kek\ " or "\kek\xspace" is bad and harmful.

Re: The Art of LaTeX: Common mistakes and advice for typesetting proofs

#100

Most of this is good advice, but I don't see the \mathbbm vs. \mathbb distinction as anything other than subjective taste. Also, I use things like \newcommand{\abs}[1]{\left| #1 \right|} in the preamble. This way, I can use \abs{...} without any asterisks, and it automatically adjusts its size. In the 1% situations where I don't want it to adjust the size, I write the delimiters manually. Making maths look good in La…

  \DeclarePairedDelimiter\abs{\lvert}{\rvert}
Isn't this better than newcommand? This makes both \abs{x} and \abs*{x} valid.
Post reply on HN