节标题中的脚注会导致不需要的新行

节标题中的脚注会导致不需要的新行

我在 Windows 7 上使用 MiKTeX 2.9。

当我使用以下内容向节标题添加脚注时

\section{Section Name}\footnote{Footnote text.}
\label{sec:SectionLabel}

我得到脚注的上标作为该部分的一个单独段落。当我尝试

\section{Section Name\protect\footnote{Footnote text.}}
\label{sec:SectionLabel}

我收到编译错误

! TeX capacity exceeded, sorry [input stack size=5000].

由于它是一份相当小的文档(33 页),因此我无法理解。

编辑:可编译的乳胶代码如下。

\documentclass[twocolumn]{article}

\usepackage{MnSymbol}
\usepackage{amsmath} % Required to use \text
\usepackage[normalem]{ulem} % Use ulem with normal (as opposed to underlined) emphasis option

\usepackage[T1]{fontenc} % Use 8-bit encoding that has 256 glyphs
\usepackage{datetime}

\usepackage[hmarginratio=1:1,top=32mm,columnsep=20pt]{geometry} % Document margins
\usepackage[hang, small,labelfont=bf,up,textfont=it,up]{caption} % Custom captions under/above floats in tables or figures
\usepackage{booktabs} % Horizontal rules in tables
\usepackage{float} % Required for tables and figures in the multi-column environment - they need to be placed in specific locations with the [H] (e.g. \begin{table}[H])
\usepackage{hyperref} % For hyperlinks in the PDF
\usepackage{mathtools}
\DeclarePairedDelimiter{\ceil}{\lceil}{\rceil}
\DeclarePairedDelimiter{\floor}{\lfloor}{\rfloor}

\usepackage{lettrine} % The lettrine is the first enlarged letter at the beginning of the text
\usepackage{paralist} % Used for the compactitem environment which makes bullet points with less space between them

\usepackage{abstract} % Allows abstract customization

\renewcommand{\abstractnamefont}{\normalfont\bfseries} % Set the "Abstract" text to bold
\renewcommand{\abstracttextfont}{\normalfont\small\itshape} % Set the abstract itself to small italic text

\usepackage{titlesec} % Allows customization of titles
\titleformat{\section}[block]{\large\scshape\centering}{\thesection.}{1em}{} % Change the look of the section titles
\titleformat{\subsection}[block]{\large}{\thesubsection.}{1em}{} % Change the look of the section titles

\usepackage{fancyhdr} % Headers and footers
\pagestyle{fancy} % All pages have headers and footers
\fancyhead{} % Blank out the default header
\fancyfoot{} % Blank out the default footer
\fancyhead[C]{ Title $\bullet$ \date{\today}} % Custom header text
\fancyfoot[RO,LE]{\thepage} % Custom footer text

\usepackage{graphicx}
\usepackage{rotating}
\usepackage{amsfonts} % For number set symbols
\usepackage{appendix}
\usepackage{color}

\usepackage{amsmath}
\usepackage{algorithm}
\usepackage[noend]{algpseudocode}
\makeatletter
\def\BState{\State\hskip-\ALG@thistlm}
\makeatother

%----------------------------------------------------------------------------------------
%   TITLE SECTION
%----------------------------------------------------------------------------------------

\title{\vspace{-15mm}\fontsize{24pt}    {10pt}\selectfont\textbf{Title}} % Article title

\author{
    \large
    \textsc{Name}\thanks{Thankee}\\[2mm] 
    \normalsize Address \\ Address, cont\\
    \vspace{-5mm}
}
\date{}

%----------------------------------------------------------------------------------------

\begin{document}

    \maketitle % Insert title

    \thispagestyle{fancy} % All pages have headers and footers


    \section{Section Name}\footnote{Footnote text.}
    \label{sec:SectionLabel}

\end{document}

进一步编辑以添加版本号

答案1

保护\footnote是完全没用的;如果您不加载titlesec,它会起作用,但您也会在几个地方得到脚注(例如,目录和页面标题)。

该问题有两种解决方案:

  1. (最好的)绝不为章节标题添加脚注
  2. 使用

    \section[Section Name]{Section Name\footnote{Whatever}}
    

答案2

我创建了一个简短的命令来执行@egreg 建议,避免TOC 存在这个问题保持正常字体大小

\newcommand{\headingwithfootnote}[2]{
    #1[#2]{#2{\textsuperscript{\normalsize\footnotemark}}}}

...

\headingwithfootnote{\section}{Chapter Title}
\footnotetext{The footnote text.}

相关内容