Math & ScienceError on citations

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
roelv
Posts: 2
Joined: Tue Jun 08, 2010 9:38 am

Error on citations

Post by roelv »

I got an error on my citations and I don't understand why? ( If i knew i wouldn't ask ;-) ) It worked in previous versions and I don't know what I've changed to get this broken :-s. If someone could clarify my errors i would be very thankful.

The error (latex output):
(./thesis.aux) (/usr/share/texmf-texlive/tex/context/base/supp-pdf.mkii
[Loading MPS to PDF converter (version 2006.09.02).]
) (/usr/share/texmf-texlive/tex/latex/hyperref/nameref.sty
(/usr/share/texmf-texlive/tex/latex/oberdiek/refcount.sty)) (./thesis.out)
(./thesis.out) [1{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}]
(./chapters/preface.tex) (./chapters/executive_summary.tex
! Undefined control sequence.
\hyper@@link ->\let \Hy@reserved@a
\relax \@ifnextchar [{\hyper@link@ }{\hyp...
l.5 Texts \cite{van_der_aalst_business_2003}

?

Page with the citation:
\phantomsection
\addcontentsline{toc}{section}{Executive summary}
\section*{Executive summary}

Texts \cite{van_der_aalst_business_2003}

If any additional information is required for giving a good analysis please let me know.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

roelv
Posts: 2
Joined: Tue Jun 08, 2010 9:38 am

Re: Error on citations

Post by roelv »

I kinda solved the problem with excluding hyperref. Is there a way to include hyperref without encountering this problem?
morsedl
Posts: 2
Joined: Mon Feb 07, 2011 3:46 am

Re: Error on citations

Post by morsedl »

Hi,

I'm encountering the very same problem. I've tried the solution mentioned at http://promberger.info/linux/2009/03/18 ... -document/ , but unfortunately, that solution does not work for me. [The remainder of this post is a slightly more accurate version of a post I made there that is presently, 2011-02-09, awaiting moderation before it will show up.]

I do have a workable solution, but it is very inconvenient. Fortunately, I only need to generate a PDF with hyperref included when I share a document with other people, so I can live with my workaround. However, I would love to get it fixed if anyone has any suggestions. Moreover, given that my workaround is somewhat convoluted, it might actually help a more knowledgeable LaTeX person better diagnose the problem. Plus, perhaps someone else might find this workaround helpful.

This workaround is both necessary and functional for MiKTeX on WinXP SP3 and for Texlive 2009 on Ubuntu 10.04 LTS (Texlive 2009 as distributed by Ubuntu, not downloaded from the TUG website) as of 2011-02-09.

The workaround is as follows:

1. Comment out the \usepackage{hyperref} line.
2. Comment out anything that depends on hyperref (in my case, the \hypersetup entry and several \pdfbookmark entries).
3. Run pdflatex mydoc.tex; run bibtex mydoc.bib; run pdflatex mydoc.tex two more times. This generates a clean PDF, without any PDF bookmarks or hypertext links.
4. Uncomment (i.e., re-enable) my \usepackage{hyperref} and \hypersetup{} lines, as well as in my case several \pdfbookmark lines. In other words, in this step 4, undo the commenting done in step 2.
5. Run, ONLY ONCE, pdflatex mydoc.tex.

At this point, I have a clean PDF, with hypertext links, but NONE of my bookmarks show up. So, continue with the following steps:

6. Step 5 will have generated a mydoc.out file. KEEP THIS .out file, but DELETE all other intermediate files generated. In my case, this means deleting all files with the following extensions, which I do as follows: rm -f *.dvi *.aux *.bbl *.blg *.log *.fff *.ttt (note that not all of these necessarily get generated, most notable *.dvi; this is simply a line that I have in a Makefile).
7. REPEAT steps 1-5.

At this point, I have a correctly formated PDF file, having used both apacite and hyperref together, and my PDF correctly creates links from footnote numbers to the corresponding footnotes, links from in-text citations to the corresponding reference entries in the bibliography, and nested bookmarks for all my \section, \subsection, \subsubsetion, etc. and \pdfbookmark entries.

It's quite nice, after all is said and done. However, it is a major pain, in particular step 7, that is, having to repeate ALL PREVIOUS STEPS just because steps 1-5 are needed to generate a .out file. Fortunately, if I don't add, change, or delete any bookmarks or sections/subsection/etc., I can just keep the .out file around and I only have to run steps 1-5 once. This isn't beneficial that often, though, because (obviously) document structure (i.e., sections) and bookmarks can change a lot. So, I just don't generate a hyperref-enabled version that often -- only when I absolutely must.

I hope this is helpful to someone and, ideally, I hope it helps someone help me get the problem fixed.

Cheers,
Doug
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Error on citations

Post by frabjous »

It seems to me that there must be a solution simpler than morsedl's.

In order to help with an error like this, I need to be able to duplicate it. Please post a minimal working example showing the problem. If I simply do:

Code: Select all

\documentclass{article}
\usepackage{hyperref}
\begin{document}
\tableofcontents
\addcontentsline{toc}{section}{Executive summary}
\section*{Executive summary}

My Texts are these \cite{van_der_aalst_business_2003}
\bibliographystyle{plain}
\bibliography{sample}

\end{document}
with sample.bib:

Code: Select all

@article{ van_der_aalst_business_2003,
title = {Title},
author = {van der Aalst, Joe},
journal = {Journal of Fun},
year = {2011},
volume = 4,
pages = {1--12}
}
Then I do not get any errors. I need to know what else is in your document that might be affecting things.
Post Reply