考慮以下簡單的 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}
輸出採用類似杜威的節號:
現在,如果我將其轉換為投影儀,則會發生一些奇怪的事情。如果文字在框架之外,即
\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}
投影機根本無法找到交叉引用。無論我運行多少次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
沒有錯誤。
「missing (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}