标签 foo 多次定义

标签 foo 多次定义

我正在尝试创建一张带有 bibtex 格式参考资料的海报。这是一张极简的 tex

\documentclass[a0,portrait]{a0poster}
\usepackage{stackengine}
\usepackage{tikz}
\usepackage[T1]{fontenc}

\usetikzlibrary{shapes,snakes,arrows,shadows,petri,decorations.markings}
\definecolor{pms286}{RGB}{4,52,177}
\def\LHead#1{\noindent{\Large\color{pms286} #1}\smallskip}

\pagecolor{pms286!30!white}
\tikzstyle{fancytitle} =[fill=pms286!80, text=white]
\tikzstyle{mybox} = [draw=pms286!80, fill=blue!20, very thick,
rectangle, rounded corners=30pt, inner sep=10pt, inner ysep=30pt,color=blue!20]


\renewcommand\refname{}
\usepackage{float}
\begin{document}

\def\intro{
  \begin{tikzpicture}
    \node [mybox] (box){%
      \begin{minipage}{0.45\textwidth}
        \LHead{foo
        }
      \end{minipage}
    };
    \node[fancytitle, right=30pt,rounded corners=10pt] at (box.north west) {\Huge{Introduction}};
  \end{tikzpicture}
}

\def\bib{
  \begin{tikzpicture}
    \node [mybox] (box){%
      \begin{minipage}{0.45\textwidth}
        \LHead{
          \vspace*{-4cm}
          \nocite{small,big}
          \bibliography{mini}{}
          \bibliographystyle{abbrv}
        }
      \end{minipage}
    };
    \node[fancytitle, right=30pt,rounded corners=10pt] at (box.north west) {\Huge{Reference}};
  \end{tikzpicture}
}

\centering
\Shortstack{{\protect\intro} {\protect\bib} }
\end{document}

以及最小的 bibtex:

@article{small,
author = {Freely, I.P.},
title = {A small paper},
journal = {The journal of small papers},
year = 1997,
volume = {-1},
note = {to appear},
}

@article{big,
author = {Jass, Hugh},
title = {A big paper},
journal = {The journal of big papers},
year = 7991,
volume = {MCMXCVII},
}

问题是我收到错误:

(./mini.aux

LaTeX Warning: Label `small' multiply defined.


LaTeX Warning: Label `big' multiply defined.

)

而我的辅助文件肯定有两次:

\relax 
\citation{small}
\citation{big}
\bibdata{mini}
\bibcite{small}{1}
\bibcite{big}{2}
\bibstyle{abbrv}
\citation{small}
\citation{big}
\bibdata{mini}
\bibcite{small}{1}
\bibcite{big}{2}
\bibstyle{abbrv}

我不知道为什么。我查了几个关于同一问题的先前问题,但不明白是什么导致了这个错误。请帮忙。

我正在用pdflatex和编译它bibtex

答案1

\Shortstack似乎至少对其参数进行了两次排版,这就是为什么你会得到双重定义的引用。

使用

\centering
\begin{tabular}{@{}c@{}}
\intro\\
\bib
\end{tabular}

输出结果是一样的。不过,这tabular似乎没有必要,因为

\centering
\intro

\bib

也会这么做。

相关内容