Skip to content

Latex Undefined Control Sequence Print Bibliography Example

This error appears when LaTeX does not understand one of the commands you have used.

[edit] Common Examples

Typo in a command:

The most common causes of such an error are simple typos. An example of such a typo is shown below, where you accidentally pressed instead of when writing

This will give an error message of

These errors are easily spotted by humans but can cause LaTeX to get confused as to what is being asked.

Forgetting to load a package:

Another cause of such an error is when a specific package is needed use a certain command, but it is accidentally forgotten in the preamble. An example of this would be

In this example, the document will fail to compile as LaTeX doesn't recognize the command. This is not a typo, as is a perfectly fine command. The problem is that you have forgotten to include in the preamble. When this line is included, the error message will disappear as LaTeX now knows how to interpret the command.

Backslash used in wrong place:

Another cause of an Undefined Control Sequence error is a backslash used inappropriately. This can happen particularly when writing file links as shown below.

The issue is that when LaTeX sees a backslash , it interprets what follows as a command. Here, there is no such command as \Users, so you will get an Undefined Control Sequence error. To avoid this, when writing text you should write a backslash as . For writing long file paths and urls, it may sometimes be more convenient to use the package rather than writing every time.

A typo when writing $\alpha$ could be $\Zlpha$

main.tex, line 10

Undefined control sequence.

<<recently read> \Zlpha l.10 A typo when writing $\alpha$ could be $\Zlpha $ The control sequence at the end of the top line of your error message was never \def'ed. If you have misspelled it (e.g., `\hobx'), type `I' and the correct spelling (e.g., `I\hbox'). Otherwise just continue, and I'll forget about whatever was undefined. [1

I want to include a space after the word \LaTeX\xspace but I have forgotten to load the xspace package.
An error will be generated if you write a file path as   C:\Users\Files

First: Issues in text: how to cite properly.

  • Citations as words: Huge pet peeve: Using citations as words. van Leunen: “Brackets are not words. A bracketed number is just a pointer, not a word. Never, ever, use a bracketed number as if it were the name of an author or a work.” (p. 20). So instead of “A similar strategy is described in [15].”), use instead “A similar strategy is discussed by AuthorOne et al. [15]”. The way you can get this right in your head is considering a journal that does citations as superscripts (like the old Graphics Hardware style). It looks really stupid to say “A similar strategy is discussed by 15.” I don't like this particular style for citation, but it does make sure citations aren't used as words.

  • Citing with LaTeX: When writing citations in LaTeX, do them in this form:

    The ~ means non-breaking space (which is what you want—you don't want a linebreak between the text and the citation).

    Also, do

    instead of

    Always alphabetize grouped citations so they appear in numerical order (instead of [8, 6, 10], arrange the citations so it looks like [6, 8, 10]). supposedly puts them in proper order for you automatically (!) and also changes [1,2,3,4,6] to [1–4,6] which is handy.

  • Shortcite: Use when appropriate. is used in sentences like “AuthorOne discusses this point further in her dissertation [AuthorOne 2002].” It looks silly to put AuthorOne's name twice. Instead, use , which makes the sentence “AuthorOne discusses this point further in her dissertation [2002].” Of course this only makes sense if you are using a citation format that lists author name / year (like Siggraph or most dissertation formats).

    I always use in my text even when my bib style doesn't support it, in which case I use the following fix in my LaTeX preamble (this defines if it's not already defined, otherwise it has no effect):

    If you don't have this command, you'll see an error like:

  • Sorting your references: If at all possible, arrange your reference list in alphabetical order by author's last name. Going in cited order is much less useful to readers of your paper. The only reason I've heard that cited-order is useful is in a survey article where nearby (and presumably related) citations from the paper are next to each other in the bibliography. I don't find this argument particularly compelling.

  • Next: issues with bibliographies (your .bib file). Big picture: Don't trust the digital library to give you a perfect .bib file. Both ACM and IEEE (as well as many others) screw up bibliography entries in delightfully creative ways.

  • Names: Make the names in the bibliography match what is printed on the paper. If the paper has as the author, put that in your bibliography. If it has initials, use those. If it has crazy umlauts and accents, use those too. If it has initials, make sure they are separated by spaces: use rather than . The latter leads bibtex to believe the first name is with no middle name/initial. (And then if your bibstyle abbreviates first names, you'll just get the initial without the middle initial, since bibtex doesn't think you have a middle name.)

    For hyphenated names with the second half uncapitalized (Wu-chun Feng, Wen-mei Hwu), put the hyphen and second half in brackets: , .

  • Capitalization in titles: Just like with authors, the capitalization on titles in your bibtex file should match what's on the paper. The bib style should enforce capitalization, not your bibliography—your bib should faithfully represent what's printed on the paper.

    Also, make sure, in your BibTeX file, that you properly bracket words in titles that must be capitalized, like GPU or PDE, or proper names. Example (the “Loop” should always be capitalized since it's a last name):

    You don't have to do this with venues (or anything else), just the title.

    Resist the temptation to double-brace the entire title as a manner of course: . This guarantees your title will always be capitalized. But many bib styles downcase all titles, in which case your title will stick out like a sore thumb. Instead, just put your title in single-braces or quotes and let the bib style do the right thing.

    (What is the right thing? In the US, publishers capitalize most words in titles [title case]; in the UK, publishers use the same capitalization rules as normal sentences [sentence case]. [Wikipedia link.] Markus Kuhn's thoughts on the subject are congruent with mine, that sentence case is preferable from an information-theoretic point of view, but in practice, authors should follow the conventions of their publication venue.)

    If the title is in all-caps, I usually rewrite it in title case.

    [ Capitalisation in BibTeX, from the TeX FAQ ]

  • Venues: Both ACM and IEEE screw up venue names in different ways. Here's how IEEE formatted a recent venue name in a recent paper of mine:

    Never use the ACM or IEEE digital library's citations without fixing them. For some reason the First Society of Computing and the World's Largest Professional Association for the Advancement of Technology have zero interest in making their capitalization correct. For instance, the first paper I ever wrote, according to ACM, has the following title and booktitle:

    when the paper has the major words in the title capitalized, and “workshop” and “hardware” should both be capitalized in the booktitle. I often review papers where citations have been taken directly from ACM with bizarre capitalization particularly in the booktitle. Fix these before you submit a paper.

  • Months: Include the month of publication in your bibliographies (simply for your own records: when you have two papers talking about a similar idea, one in January and one in November of the same year, maintaining the month lets you determine which came first).

    Always use three-letter abbreviations without quotes for months. These are built into bibtex. They allow the bib style to actually know what month it is, so the bib style can enforce a consistent style across all citations (1/2012? Jan. 2012? January 2012? Januar 2012 [foreign language]?).

    Digital libraries often get these wrong (IEEE uses ).

  • Pages: Always include pages if pages are available. Ranges of pages use the en-dash to separate them (that's two dashes): . Some non-printed proceedings only assign a paper number, so for those I typically see (and use) something like , where is the paper number and the paper has pages.

    Also, if the bib source says that your paper starts on page 1, double-check it. Make sure that it doesn't list every paper in the conference/journal starting on page 1 (like the rocket scientists at IPDPS 2009 who decided it would be a good idea to assign neither page numbers nor paper IDs [example]). It's a little embarrassing when you cite two papers in your article and they both start on page 1 of the same conference. (Usually, you should figure out the paper number in the conference and use . If you can't make your page numbers unique, leave them out entirely.)

  • DOIs: DOIs uniquely identify a paper. Even if your style doesn't use them, you should record them in your bibtex file. Store them as the numbers only (DOIs have the format ; store the part after only). Bibliography tools seem to use this format predominantly.

  • URLs: If you're putting a URL into your bibliography, wrap it in (and put in your LaTeX preamble) so it wraps nicely. If you add a DOI with a tag, you don't need to add the DOI as as well.

  • Let's see where digital libraries get these things wrong! Corrections are in blue.


    Problems with IEEE: Did not use the names that were printed on the paper; did not put accents on proper characters; did not separate first initial and middle initial with a space; venue title is strangely wrapped around with the comma; did not capitalize paper title as it was on the paper; did not use bibtex month abbreviations; did not use en-dash to separate out page numbers.


    Problems with ACM: Did not capitalize paper title as it was on the paper; added a URL that's redundant with the DOI; did not store DOI as numbers only. Notable: On this paper, ACM got the venue capitalization correct!

    Also see Dan Wallach's thoughts on the matter.

    John Owens | Last updated .