如果章节标题太长且被截断,如何使用 nameref 命令来链接它?

如果章节标题太长且被截断,如何使用 nameref 命令来链接它?

我使用\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}就会使用简称。

相关内容