![自定义尾注的论证](https://linux22.com/image/304642/%E8%87%AA%E5%AE%9A%E4%B9%89%E5%B0%BE%E6%B3%A8%E7%9A%84%E8%AE%BA%E8%AF%81.png)
我有这个代码:
\documentclass[a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lipsum}
\usepackage{endnotes}
\let\footnote=\endnote
\usepackage{etoolbox}
\preto{\theendnotes}{%
\renewcommand{\makeenmark}{\textsuperscript{\theenmark}\enspace}%
}
\renewcommand\enoteformat{%
\raggedright
\leftskip=1.8em
\makebox[0pt][r]{\textsuperscript\theenmark\enspace %
\rule{0pt}{\dimexpr\ht\strutbox}}%
}
\begin{document}
Bla bla\footnote{\lipsum[1]} Bla bla\footnote{\lipsum[2]}
\theendnotes
\end{document}
我需要添加或更改哪些设置才能使注释文本对齐,同时保留其他自定义设置?谢谢
答案1
您应该在 之前删除\raggedright
并添加。\noindent
\makebox
但是有一种更巧妙的方法,那就是也可以在尾注中添加列表(这在\leftskip
上下文中表现会很糟糕)。
\documentclass[a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lipsum}
\usepackage{endnotes}
\usepackage{etoolbox}
%%% Customize endnotes
\let\footnote=\endnote
\makeatletter
% remove the useless part
\renewcommand{\enoteheading}{%
\section*{\notesname
\@mkboth{\MakeUppercase{\notesname}}{\MakeUppercase{\notesname}}}%
}
\makeatother
% change the endnote mark
\preto{\theendnotes}{%
\renewcommand{\makeenmark}{\textsuperscript{\theenmark}\enspace}%
}
% the notes are typeset as a list
\patchcmd{\theendnotes}{\input}{\noteslist\input}{}{}
\patchcmd{\theendnotes}{\endgroup}{\endnoteslist\endgroup}{}{}
% \enoteformat issues \item
\renewcommand\enoteformat{%
\item[\textsuperscript\theenmark\rule{0pt}{\dimexpr\ht\strutbox}]%
}
% the list
\newenvironment{noteslist}
{\list{}{%
\leftmargin=1.8em
\topsep=0pt
\partopsep=0pt
\itemindent=0pt
\itemsep=0pt}}
{\endlist}
\begin{document}
Bla bla\footnote{\lipsum*[1]} Bla bla\footnote{\lipsum*[2]}
\theendnotes
\end{document}