![如果章节标题太长且被截断,如何使用 nameref 命令来链接它?](https://linux22.com/image/256642/%E5%A6%82%E6%9E%9C%E7%AB%A0%E8%8A%82%E6%A0%87%E9%A2%98%E5%A4%AA%E9%95%BF%E4%B8%94%E8%A2%AB%E6%88%AA%E6%96%AD%EF%BC%8C%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8%20nameref%20%E5%91%BD%E4%BB%A4%E6%9D%A5%E9%93%BE%E6%8E%A5%E5%AE%83%EF%BC%9F.png)
我使用\nameref
命令来链接章节标题。但如果章节标题太长且被截断,则不会链接。
\documentclass[twocolumn]{article}
\usepackage{hyperref}
\begin{document}
\title{Sample File}
\date{}
\maketitle
\section{Comparison with existing hierarchical decomposition methods}
\label{sec1}
This is a simple text. This is a simple text. This is a simple text. This is a simple text. This is a simple text. This is a simple text. This is a simple text. This is a simple text. This is a simple text. This is a simple text~\nameref{sec1}. This is a simple text. This is a simple text.
这是一段简单的文本。我使用\nameref
命令来链接章节标题。但如果章节标题太长且被截断,则不会链接。
\documentclass[twocolumn]{article}
\usepackage{hyperref}
\begin{document}
\title{Sample File}
\date{}
\maketitle
\section{Comparison with existing hierarchical decomposition methods}
\label{sec1}
This is a simple text. This is a simple text. This is a simple text. This
is a simple text. This is a simple text. This is a simple text. This is a
simple text. This is a simple text. This is a simple text. This is a
simple text~\nameref{sec1}. This is a simple text. This is a simple text.
This is a simple text.
\end{document}
答案1
您可以使用可选参数\section
,即
\section[short]{Long tittle}
\label{sec:ref}
这样\nameref{sec:ref}
就会使用简称。