Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Possible Duplicate:
Citations with no bibliography at the end

I have a document with a very tight space restriction and I've found that it is easier to compact my references by copying them from a compiled PDF into the document. However this obviously gives two copies of the bibliography in the document. Is there any way in which to compile the references for a document, so that the citations are numbered correctly etc. but not actually print the references?

share|improve this question
add comment

marked as duplicate by egreg, Seamus, lockstep, Stefan Kottwitz Jan 13 '12 at 15:18

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2 Answers

run your document as usual and then run it one time with a commented %\blibliography{...}

share|improve this answer
2  
...since this will still use the saved .aux file containing the correct references to produce the document. Compiling twice will use the updated (now void of \bibitems) .aux resulting in undefined citations. –  Werner Oct 27 '11 at 18:38
    
please read, what I wrote! –  Herbert Oct 27 '11 at 18:42
1  
...I did, and elaborated. –  Werner Oct 27 '11 at 18:44
    
it is obvious that I get no citations when running twice! –  Herbert Oct 27 '11 at 18:46
    
You provided an elegant and straight-forward solution to the problem. –  Werner Oct 27 '11 at 18:50
add comment

Try this:

\makeatletter
\def\bibliography#1{%
   \if@filesw
   \immediate\write\@auxout{\string\bibdata{#1}}%
\fi}
\makeatother

Note that in latex.ltx this command is defined as

\def\bibliography#1{%
  \if@filesw
    \immediate\write\@auxout{\string\bibdata{#1}}%
  \fi
 \@input@{\jobname.bbl}}

This command writes the bibliography files to the .aux file, and the last line reads the .bbl file and inserts it at the point. By redefining the command you keep the first part and get rid of the last one.

share|improve this answer
3  
Would you care to elaborate on your answer? Suggesting "Try this..." or "Here you go..." solutions provides little context and no justification as to the choice of your code. –  Werner Oct 27 '11 at 18:24
    
<em>Would you care to elaborate on your answer? Suggesting "Try this..." or "Here you go..." solutions provides little context and no justification as to the choice of your cod</em><br> Surely –  Boris Oct 27 '11 at 18:48
add comment

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