考虑以下简单的 Latex 文档:
\documentclass{article}
\begin{document}
\section{A} \label{A}
\subsection{B}\label{B}
\subsubsection{C}\label{C}
I am in section \ref{A}, subsection \ref{B}, subsubsection \ref{C}.
\end{document}
输出采用类似杜威的章节编号:
现在,如果我将其转换为 beamer,就会发生一些奇怪的事情。如果文本超出了框架,即
\documentclass{beamer}
\begin{document}
\section{A} \label{A}
\subsection{B}\label{B}
\subsubsection{C}\label{C}
I am in section \ref{A}, subsection \ref{B}, subsubsection \ref{C}.
\end{document}
beamer 根本找不到交叉引用。无论我运行多少次latex
,都会出现以下错误消息:
)pdfTeX warning (dest): name{C} has been referenced but does not exist, replac
ed by a fixed one
pdfTeX warning (dest): name{B} has been referenced but does not exist, replaced
by a fixed one
pdfTeX warning (dest): name{A} has been referenced but does not exist, replaced
by a fixed one
奇怪的是,参考编号出现在输出中,但嵌套的杜威编号却丢失了。
将文本放在框架中,
\documentclass{beamer}
\begin{document}
\section{A} \label{A}
\subsection{B}\label{B}
\subsubsection{C}\label{C}
\begin{frame}
I am in section \ref{A}, subsection \ref{B}, subsubsection \ref{C}.
\end{frame}
\end{document}
使错误信息消失,但输出仍然与平常不同
那么,这是 Beamer 的一个错误吗?有解决方法吗?
答案1
沒有 bug。
“丢失(dest)”错误是由于没有框架,
beamer
无法容纳由生成的超链接的目标\ref
“孤独的数字”是一个精确的选择。您可以在序言中添加常用代码来撤销该决定。
这是示例。
\documentclass{beamer}
\renewcommand{\thesubsection}{\thesection.\arabic{subsection}}
\renewcommand{\thesubsubsection}{\thesubsection.\arabic{subsubsection}}
\begin{document}
\section{A} \label{A}
\subsection{B}\label{B}
\subsubsection{C}\label{C}
\begin{frame}
I am in section \ref{A}, subsection \ref{B}, subsubsection \ref{C}.
\end{frame}
\end{document}