Hacker News new | ask | show | jobs
by generationP 1265 days ago
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 LaTeX is pretty well-understood these days; authors who don't are usually just being lazy. The big undocumented mess with LaTeX is making bibliographies work correctly. The "standard" bibtex workflow is broken in many ways, and I have never seen a tutorial on how to fix it. With bibliographies being such a minuscule part of a mathematical paper, I'm not surprised that no one cares, but the result is lots of references that are imprecise, missing important info or plain wrong.

5 comments

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, then one is using the wrong style.
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?

By these standards, are any citation managers adapted to modern use?

I’m definitely open to the idea that we should change how we refer to other findings, but EndNote, Zotero, and the like also can’t save you from new editions, overly-strict rules about reference formatting, and bad publisher-provided information.

If you can deviate slightly from a particular reference format, it’s fairly easy to emit either a DOI or a URL (but not both): https://tex.stackexchange.com/questions/154864/biblatex-use-... One of the linked answers even suppresses DOI-like URLs.

The alternative is to just write the bibliography by hand. This means possibly having to make changes before final publication to adapt to the journal's style. But it is faster in my experience than getting things into bibtex pre-emptively, particularly as the latter doesn't reliably prevent problems at publication time. And it is sufficiently transparent that you don't have to deal with sneaky silent errors.
I have never found a silent error. If bibtex is not happy, it complains loudly. I use the style files given by the publishers and it always comes out OK. Never had a publisher complain about the bibliography when using their styles, and they do check, and complain about a lot of things.

You must have really bad luck with bibtex.

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

For 1, I just use latexmk. I honestly assumed that was standard but I guess not? It comes with TeXLive anyway. For the rest, I use Zotero with betterbibtex and with both that and LaTeX in general I use the more recent biblatex instead of bibtex.

This won't fix everything you've mentioned, but I feel like I generally have a lot fewer issues than what your comment would suggest.

If they make it into the wild, who cares if they are fully correct? The rules for a “fully correct” bibliography are too strict anyway. DOI or URL? Who cares? The reader is just going to search for the title anyway. As long as it doesn’t bounce off the publisher it is fine (which, it must not be bouncing off the publishers if it makes it into the wild).
Googling the title works for reasonably new papers. Not so good for textbooks, old papers (titles used to be a lot less expressive 50 years ago), conference proceedings (often not indexed by article anywhere, and the name of the volume can be ambiguous), grey literature like lecture notes (a URL would allow you to use the Wayback Machine).

Also, don't count on authors to get the title right.

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.

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.)

In his papers Terence Tao is inconsistent [1][2][3], maybe because of formatting requirements? But boy is real boldface ugly [3] and sticks out like some tomato ketchup on a white wedding dress.

[1] https://arxiv.org/pdf/1611.07441.pdf

[2] https://annals.math.princeton.edu/wp-content/uploads/annals-...

[3] https://arxiv.org/pdf/math/0512114.pdf

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.

Who is Terrence Tao? Do you mean Terence Tao?

(if we are nitpicking about typography...)

Heh.

Sorry about that. A common typo. The keys are like right next to each other.

That would be going against the near-universal custom of using actual mathbb. They don't look like a hack to mathematicians because they are used everywhere and most people like them. Mathbf is rare and I don't recommend it.
How about using the Unicode characters ℕ, ℤ, ℚ, ℝ, ℂ, etc.?
Interesting explanation on how it developed historically. I've seen mathbf used in some books, but I guess old conventions are hard to change.
Use `DeclarePairedDelimiter` from `mathtools`.

The rule of TeX is that anything that is written in TeX is instantly old. Because people don't read what Knuth had in mind. TeX was the prototype not the production grade product. Still people refuse to get the message.

Well, Knuth still writes all his stuff using "plain" TeX. For example, the source of the TeXbook and the METAFONTbook are both TeX, not LaTeX or whatnot. Granted, he did create TeX, so he's probably more comfortable with it.
Pure TeXnicians are a thing. Besides, what do you expect him to use? it's his creation.

The point is he created TeX for himself and expected others to supercede it with a proper implementation. Didn't happen though.

  \DeclarePairedDelimiter\abs{\lvert}{\rvert}
Isn't this better than newcommand? This makes both \abs{x} and \abs*{x} valid.
I use Zotero with the better bibtex addon. Works great. When I first started using zotero, I imported my existing bibtex library, so all my existing bibtex keys all worked. I use zotero as my library for everything and add bibtex keys to things I cite.

https://retorque.re/zotero-better-bibtex/