3

I have an a0poster document (see below an example) which is not loading the cross-references, although bibtex is working fine and compiling the references.

I write the main text into a different tex file and include it into the main tex file (both can be found below).

If the file text.tex is included with \include, the cross-referencing fails. If it is included using \input, everything works fine. Why?

PS: The file main.tex below has lots of \usepackages and some definitions required by the a0poster class.

main.tex

\documentclass[portrait]{a0poster}

\RequirePackage{amssymb,amsthm,array}
\RequirePackage[reqno]{amsmath}

% revtex
\usepackage[sort&compress,numbers]{natbib}
\usepackage{doi}%<----------
\usepackage{hyperref}

% Insert font types as \LARGE or \color
\usepackage{multicol}
\usepackage{amsfonts}
\usepackage[final]{graphicx}
\usepackage{pstricks}
\usepackage{alltt}
\usepackage{a4}
\usepackage{float}
\usepackage{verbatim}
\usepackage{calc}
\usepackage{wrapfig}%I took out the package cite
\usepackage[absolute]{textpos}
\usepackage{boxedminipage}
\renewcommand\familydefault{cmss}

% Switch off page numbers on a poster, obviously, and section numbers too.
\pagestyle{empty}
\setcounter{secnumdepth}{0}

\usepackage{dcolumn}% Align table columns on decimal point
\usepackage{bm}% bold math

\usepackage[normalem]{ulem} % underline \uline
\usepackage{pifont} % inclui suporte a simbolos \ding no texto
\usepackage{stmaryrd} % inclui outros simbolos

% These colours are tried and tested for titles and headers. Don't
% over use color!
\usepackage{color}
\definecolor{DarkBlue}{rgb}{0.1,0.1,0.5}
\definecolor{Red}{rgb}{0.9,0.0,0.1}

% put text on the top of the image
\def\imagetop#1{\vtop{\null\hbox{#1}}}
\setlength{\abovecaptionskip}{0pt}
\setlength{\belowcaptionskip}{0pt}

% see documentation for a0poster class for the size options here
\newcommand{\Textsize}{\large}
\newcommand{\IntroTextsize}{\large}
\newcommand{\Abstractsize}{\normalsize}
\newcommand{\TReferences}{\scriptsize}
\def\Head#1{\noindent\hbox to \hsize{\hfil{\Huge\color{DarkBlue} #1}}\bigskip}
\def\TAuthors#1{\noindent{\huge\color{DarkBlue} #1}\smallskip}
\def\TAddress#1{\noindent{\Large\color{DarkBlue} #1}\smallskip}
\def\LHead#1{\noindent{\Huge\color{DarkBlue} #1}\smallskip}
\def\Subhead#1{\noindent{\Large\color{DarkBlue} #1}}
\def\Title#1{\noindent{\VERYHuge\color{Red} #1}}

\TPGrid[20mm,20mm]{15}{25}  % 3 - 1 - 7 - 1 - 3 Columns

% Mess with these as you like
\parindent=0pt
\parskip=0.5\baselineskip

\begin{document}

%%%%%%%%%%%%%%%%%%%%%%

\include{text} %%%%% gives the undefined reference error

\input{text} %%%%% loads the text with correct cross-referencing

%%%%%%%%%%%%%%%%%%%%%%



    \begin{textblock}{7}(7.8,21.6)
\begin{multicols}{2}
\TReferences
\bibliographystyle{apsrev4-1-custom}
\bibliography{referencias}
\end{multicols}
\end{textblock}
\end{document}

text.tex

\begin{textblock}{7}(0.25,5.8)

\begin{equation}
\label{eq:myEqn1}
f(x) = a + bx
\end{equation}

eq \eqref{eq:myEqn1} is a straight line! %%%% display '??' undefined reference

\end{textblock}
  • 2
    Using \include for a poster is wrong: it wants (and needs) to issue a page break that can't happen, so everything goes awry. Use \input and live happy. – egreg Apr 24 '14 at 18:13
4

You can't use \include with this class; the \include mechanism requires a page break, which can't be performed in a poster. Actually a0poster (or a package input by it) redefines \clearpage not to really issue a page break.

Since \include doesn't see the necessary page break, the label can't be properly written in the secondary .aux file, so the result is that the label is lost. Indeed the code

\newlabel{eq:myEqn1}{{1}{1}{}{equation.0.1}{}}

appears in the .log file, which means that the .aux file isn't correctly open when \label is executed.

See When should I use \input vs. \include? and especially Redefining \include for reference.

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.