文本中带有配对标记的脚注

文本中带有配对标记的脚注

如何在普通乳胶或lualatex中获取“配对脚注”。

可以使用回忆录宏来完成:http://tug.ctan.org/macros/latex/contrib/memoir/memman.pdf第 237 页

\wrapfootnote{disciplines}{For example, Celtic studies.} require double marks in the text.

使得:

Some α-disciplines-α require double marks in the text
...
Footnote
α--α For example, Celtic studies.

答案1

有以下可能性:

\documentclass{article}

\makeatletter
\newcommand{\wrapfootnote}[1]{%
  \@ifnextchar[%
    {\double@xfootnote{#1}}
    {%
     \stepcounter\@mpfn
     \protected@xdef\@thefnmark{\thempfn}%
     \double@footnotemark{#1}%
     \@footnotetext
    }%
}
\def\double@xfootnote#1[#2]{%
  \begingroup
  \csname c@\@mpfn\endcsname #2\relax
  \unrestored@protected@xdef\@thefnmark{\thempfn}%
  \endgroup
  \double@footnotemark{#1}\@footnotetext
}
\newcommand{\double@footnotemark}[1]{%
  \leavevmode
  \@makefnmark
  #1\edef\@x@sf{\the\spacefactor}\nobreak
  \@makefnmark
  \spacefactor\@x@sf\relax 
}
\makeatother

\xspaceskip=20pt % for exaggerating the effect
\textheight=4cm % for smaller picture

\begin{document}

Some \wrapfootnote{disciplines}{For example, Celtic studies.} require double marks in the text.

Let's see after a \wrapfootnote{period.}{Will the space be extended?} Is the space extended?

Also \wrapfootnote{whatever}[42]{Foo.} is correct.

\end{document}

在此处输入图片描述

答案2

针对两种解释进行了编辑

这是为了满足 OP 的特定要求而做出的尝试。显然,\thefnsymbol需要通过更多案例来充实。

\documentclass{article}
\makeatletter
\def\@fnsymbol#1{\thefnsymbol{#1}---\thefnsymbol{#1}}
\def\thefnsymbol#1{\ensuremath{\ifcase#1\or 
  \alpha\or \beta \or \delta \or
   \gamma\or \epsilon\or ... \fi}}
\makeatother
\renewcommand{\thefootnote}{\fnsymbol{footnote}}
\newcommand\wrapfootnote[2]{\stepcounter{footnote}%
  \thefnsymbol{\value{footnote}}-#1-%
   \thefnsymbol{\value{footnote}}\footnotetext{#2}}
\textheight1in
\begin{document}
\wrapfootnote{disciplines}{For example, Celtic studies.} require double marks in the text.

Also, \wrapfootnote{more disciplines}{For example, German studies.} require double marks in the text.

But never, ever, do \wrapfootnote{Antarctic Studies}{that's right, Antarctic
  studies} require double marks.
\end{document}

在此处输入图片描述对 稍加重新设计\wrapfootnote,可以得到上标形式的分隔符:

\documentclass{article}
\makeatletter
\def\@fnsymbol#1{\thefnsymbol{#1}---\thefnsymbol{#1}}
\def\thefnsymbol#1{\ensuremath{\ifcase#1\or 
  \alpha\or \beta \or \delta \or
   \gamma\or \epsilon\or ... \fi}}
\makeatother
\renewcommand{\thefootnote}{\fnsymbol{footnote}}
\newcommand\wrapfootnote[2]{\stepcounter{footnote}%
  $^{\thefnsymbol{\value{footnote}}-}$#1%
   $^{-\thefnsymbol{\value{footnote}}}$\footnotetext{#2}}
\textheight1in
\begin{document}
\wrapfootnote{disciplines}{For example, Celtic studies.} require double marks in the text.

Also, \wrapfootnote{more disciplines}{For example, German studies.} require double marks in the text.

But never, ever, do \wrapfootnote{Antarctic Studies}{that's right, Antarctic
  studies} require double marks.
\end{document}

在此处输入图片描述

相关内容