尾注在同一行

尾注在同一行

我正在努力让每个尾注条目不占用新行。我读答案,解释了很多,但没有回答我的疑问,正如所说,我怎样才能让尾注条目不开始新行。例如:

1- 条目 1 2- 条目 2

代替

1- 条目 1

2- 条目 2

答案1

在endnotes.sty中,\theendnotes定义如下:

\def\theendnotes{\immediate\closeout\@enotes \global\@enotesopenfalse
  \begingroup
    \makeatletter
    \edef\@tempa{`\string >}%
    \ifnum\catcode\@tempa=12%
      \let\@ResetGT\relax
    \else
      \edef\@ResetGT{\noexpand\catcode\@tempa=\the\catcode\@tempa}%
      \@makeother\>%
    \fi
    \def\@doanenote##1##2>{\def\@theenmark{##1}\par\begingroup
        \@ResetGT
        \edef\@currentlabel{\csname p@endnote\endcsname\@theenmark}%
        \enoteformat}
    \def\@endanenote{\par\endgroup}%
    \enoteheading
    \enotesize
    \input{\jobname.ent}%
  \endgroup}

您需要做的就是破解它以删除\par定义中的 s。这是 MWE,其中\par刚刚删除了两个 s:

\documentclass{article}
\usepackage{endnotes}
\makeatletter
\def\theendnotes{\immediate\closeout\@enotes \global\@enotesopenfalse
  \begingroup
    \makeatletter
    \edef\@tempa{`\string >}%
    \ifnum\catcode\@tempa=12%
      \let\@ResetGT\relax
    \else
      \edef\@ResetGT{\noexpand\catcode\@tempa=\the\catcode\@tempa}%
      \@makeother\>%
    \fi
    \def\@doanenote##1##2>{\def\@theenmark{##1}\begingroup
        \@ResetGT
        \edef\@currentlabel{\csname p@endnote\endcsname\@theenmark}%
        \enoteformat}
    \def\@endanenote{\hspace{1em}\endgroup}%
    \enoteheading
    \enotesize
    \input{\jobname.ent}%
  \endgroup}
\makeatother
\begin{document}
One\endnote{this is the first endnote. this is the first endnote.} two\endnote{this is the second endnote. this is the second endnote.} three \endnote{this is the third endnote.} 

\theendnotes
\end{document}

您可以通过修改的数量来更改尾注之间的间距\hspace{1em}

结果

答案2

您可以enotez与 一起使用enumitem

\documentclass{article}
\usepackage{enotez}
\usepackage[inline]{enumitem}

\DeclareInstance{enotez-list}{itemize*}{list}{list-type = itemize*}
\setlist[itemize]{itemjoin={\qquad}}

\begin{document}

A\endnote{entry one}
B\endnote{entry two}
A\endnote{entry one}
B\endnote{entry two}
A\endnote{entry one}
B\endnote{entry two}
A\endnote{entry one}
B\endnote{entry two}
A\endnote{entry one}
B\endnote{entry two}
A\endnote{entry one}
B\endnote{entry two}
A\endnote{entry one}
B\endnote{entry two}
A\endnote{entry one}
B\endnote{entry two}
A\endnote{entry one}
B\endnote{entry two}

\printendnotes[itemize*]

\end{document}

在此处输入图片描述

相关内容