I am getting strange errors in LaTeX:

perhaps you should insert a `~' before "\ref"
missing `\ ' after "i.e."
missing `\ ' after "i.e."

I understand that the first expects me to put a tilde before the reference, so something like this figure~\ref{myfigure}, but why is it necessary? I can compile without the tilde and everything works fine. Besides that, it is annoying to have to write it like this in case I want to reference many figures. For example, I have this statement in my paper:

Figures \ref{figure:normal_rendering} and \ref{figure:silhouette_rendering} illustrates the silhouette rendering process.

With the form proposed I should keep adding figure before any \ref; it sounds weird to read: "Figure 1, figure 2, and figure 3 illustrates the silhouette rendering process" rather then just "Figure 1, 2, and 3 illustrates the silhouette rendering process".

What about the second and third errors? Any help?

  • 2
    I guess you mean warnings rather than errors? Also, have a look at Is a period after an abbreviation the same as an end of sentence period regarding the i.e.\ .
    – Stefan Kottwitz
    Feb 23 '11 at 14:23
  • AFAIK that aren't normal LaTeX errors. (Are they warnings?). Are you loading any special packages for it? The ~ makes sure that the line is not broken between Figure and \ref, which would look bad. You don't need to put Figure in front of every \ref when referencing several figures.
    – Martin Scharrer
    Feb 23 '11 at 14:26
  • It certainly looks like the result of some package, but searching all .sty files of TL2010 for relevant regexps (e.g. "missing.*after") doesn't provide relevant hits. Also, I've never run across a package that might do this, and it seems to require more parsing than one would normally do from within LaTeX. Perhaps it is the OP's editor which gives these messages? (Which are certainly not errors.)
    – Villemoes
    Feb 23 '11 at 19:28
  • 1
    Just for the record, the warning messages in the original post come from lacheck, a LaTeX syntax checker that most likely got called automatically from a TeX-Editor. While they are warnings and can certainly be ignored, they are obviously helpful to achieve properly typeset text as can be seen in the other answers.
    – kjyv
    Jan 27 '14 at 19:34


You definitely want to write for a single figure Figure~\ref{x} (or Fig.\,\ref{x} or whatever) because you don't want the number to split over a line separate from the Figure text.

For multiple strings of figure numbers, such as ‘Figures 1, 4, and 7’, the exact placement of the hardspace is somewhat a matter of taste. I usually write Figures 1 and~2 and Figures 1, 4, and~7 but you might sometimes want to restrict the breaking a little more.

In both these cases, I recommend looking at the refstyle or cleveref package to automate some of this with markup.

‘i.e.’ and other acronyms

After a period in the text, TeX assumes you have finished as sentence and by default puts a larger-than-usual amount of space there. So when you use ‘i.e.’ in a sentence you either need to add a comma after it (my preference) or indicate that the final . is not a sentence-ending period. So, any of:

i.e., blah blah
i.e.\ blah blah
i.e.\@ blah blah

The second two will print identically. I prefer the second in text and the third when defining shorthand commands with \newcommand.

  • What if there is a tilde ~ after the full stop - so for example Fig.~\ref{x}. Does latex assume a full-stop here too and puts a larger amount of space, and you need Fig.\@~\ref{x} or something like that to tell it it's not a full stop? Or does the tilde already tell latex that this isn't a full stop?
    – Ela782
    Jan 20 '20 at 19:02
  • Kind of answering my own comment: tobi.oetiker.ch/lshort/lshort.pdf says "A tilde ~ character generates a space that cannot be enlarged and additionally prohibits a line break."
    – Ela782
    Jan 20 '20 at 19:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.