标签引用

标签引用

我想创建一个标签并显示在 pdf 输出中,其中使用该标签:

\documentclass{report}
\usepackage{nameref, hyperref}

\begin{document}

\chapter{The first chapter}
\label{ch:ch1}
This chapter is referenced in the following chapters: The second chapter, The third chapter\\
The list should be updated automatically.

\chapter{The second chapter}
Read this chapter first: \nameref{ch:ch1}

\chapter{The third chapter}
Read this chapter first: \nameref{ch:ch1}

\end{document}

我在代码中手动编写了列表,但我想在构建时动态创建它。我该怎么做?

输出片段

相关内容