Procrastiblog

February 20, 2007

Comments in BibTeX

Filed under: LaTeX, Tech — Chris @ 11:52 pm

Be warned: there is a @Comment directive in BibTeX, but it doesn’t appear to do anything.

UPDATE: @Comment works as expected so long as you use it outside any other directive. E.g., the following will not work,

@InProceedings{ key,
  title = {\BibTeX comments considered harmful},
  author = {Christopher L. Conway},
  booktitle = {Procrastiblog Symposium on \LaTeX Arcana},
  year = 2007,
  @Comment{ This never actually happened. }
}

whereas the following is fine,

@InProceedings{ key,
 title = {\BibTeX comments considered harmful},
 author = {Christopher L. Conway},
 booktitle = {Procrastiblog Symposium on \LaTeX Arcana},
 year = 2007,
}

@Comment{ The above never actually happened. }
Advertisement

2 Comments

  1. The other odd thing about a bibtex comment is that it cannot contain an “@”.

    Comment by James — March 10, 2008 @ 5:43 pm

  2. Hi James,

    > The other odd thing about a bibtex
    > comment is that it cannot contain an “@”.

    I also noticed that bibtex cannot escape the ‘at sign’ – but I found one particular syntax, with which you can include @ in comments without bibtex crashing, which is:

    @@{t=t}
    

    … which is simply a cheat – where the second @ is added so it means ‘command’ to bibtex; and any two characters can be used for the ‘t=t’, as that simply makes bibtex acknowledge the entry syntax..

    Then you can write:

    @Comment {remove the corresponding \@@{t=t} from a command}
    

    … however, arguably, it’s not the most user friendly thing in the world 🙂

    Cheers!

    Comment by sdaau — December 28, 2010 @ 1:18 pm


RSS feed for comments on this post.

Sorry, the comment form is closed at this time.

Blog at WordPress.com.

%d bloggers like this: