我正在写一篇论文LaTeX
。我需要在另一章中引用一章的标签。有什么建议吗?
答案1
这完全是开箱即用的,filecontents
仅用于轻松生成带有部分内容的虚拟章节文件。
\ref
或语句\cref
需要标签名称,必须首先指定要标记的相关实体!
\documentclass{book}
\begin{filecontents}{nasimchapterone}
\chapter{Nasim One}\label{chap:one}
In \Cref{chap:two} or \Cref{chap:three,chap:four} we will see that
\end{filecontents}
\begin{filecontents}{nasimchaptertwo}
\chapter{Nasim Two}\label{chap:two}
In \Cref{chap:one} or \Cref{chap:three,chap:four} we will see that
\end{filecontents}
\begin{filecontents}{nasimchapterthree}
\chapter{Nasim Three}\label{chap:three}
In \Cref{chap:three} or \Cref{chap:one,chap:two} we will see that
\end{filecontents}
\begin{filecontents}{nasimchapterfour}
\chapter{Nasim Four}\label{chap:four}
In \Cref{chap:one,chap:three} we have seen that
\end{filecontents}
\usepackage{hyperref}
\usepackage{cleveref}
\begin{document}
\tableofcontents
\include{nasimchapterone}
\include{nasimchaptertwo}
\include{nasimchapterthree}
\include{nasimchapterfour}
\end{document}