在 Latex 中使用 fancyhead 時分割字串變數

在 Latex 中使用 fancyhead 時分割字串變數

我用於fancyhdr我的報告課程。我將作業的名稱儲存在變數中。然後我將其內容放置在除第一頁之外的每個頁面的右上角。除了右上角之外,我還有一個左上角和一個中心標題。如果作業文字很長,它會與中心標題重疊,如圖所示。

在此輸入影像描述

% Header and footer style.
\RequirePackage{fancyhdr}

\fancypagestyle{firstpage}{%
  \fancyhf{}
  \fancyfoot[CE,CO]{\thepage}
  \renewcommand{\headrulewidth}{0pt}
  \renewcommand{\footrulewidth}{0.7pt}
}

\fancypagestyle{followingpage}{%
  \fancyhf{}
  \fancyhead[LE,LO]{\@student}
  \fancyhead[CE,CO]{\@course}
  \fancyhead[RE,RO]{\@assignment}
  \fancyfoot[CE,CO]{\thepage}
  \renewcommand{\headrulewidth}{0.7pt}
  \renewcommand{\footrulewidth}{0.7pt}
}

我想知道是否有一種方法可以分割變數的內容,@assignment以便它顯示在兩行或更多行中並防止這種重疊。

相關內容