![在左边距实现右对齐脚注标记的侵入性较小的方法是什么?](https://linux22.com/image/470706/%E5%9C%A8%E5%B7%A6%E8%BE%B9%E8%B7%9D%E5%AE%9E%E7%8E%B0%E5%8F%B3%E5%AF%B9%E9%BD%90%E8%84%9A%E6%B3%A8%E6%A0%87%E8%AE%B0%E7%9A%84%E4%BE%B5%E5%85%A5%E6%80%A7%E8%BE%83%E5%B0%8F%E7%9A%84%E6%96%B9%E6%B3%95%E6%98%AF%E4%BB%80%E4%B9%88%EF%BC%9F.png)
有没有比我在这里使用的方法侵入性更小的方法来实现在左边距右对齐的脚注标记(设置\marginparsep
在正文的左边)?它似乎按我想要的方式工作,但我基本上只是猜测......
\documentclass[12pt]{article}
\usepackage[text={140mm, 40mm}]{geometry}
\usepackage[marginal]{footmisc}
\makeatletter
% Copied from footmisc.sty and edited
\ifFN@para
\else
\long\def\@makefntext#1{%
\ifFN@hangfoot
\bgroup
\setbox\@tempboxa\hbox{%
\ifdim\footnotemargin>0pt
\hb@xt@\footnotemargin{\@makefnmark\hss}%
\else
\@makefnmark
\fi
}%
\leftmargin\wd\@tempboxa
\rightmargin\z@
\linewidth \columnwidth
\advance \linewidth -\leftmargin
\parshape \@ne \leftmargin \linewidth
\footnotesize
\@setpar{{\@@par}}%
\leavevmode
\llap{\box\@tempboxa}%
\parskip\hangfootparskip\relax
\parindent\hangfootparindent\relax
\else
\parindent1em
\noindent
\ifdim\footnotemargin>\z@
\hb@xt@ \footnotemargin{\hss\@makefnmark}%
\else
\ifdim\footnotemargin=\z@
\llap{\@makefnmark}%
\else
\llap{\hb@xt@ -\footnotemargin{\hss\@makefnmark\hspace{\marginparsep}}}%\llap{\hb@xt@ -\footnotemargin{\@makefnmark\hss}}%
\fi
\fi
\fi
\footnotelayout#1%
\ifFN@hangfoot
\par\egroup
\fi
}
\fi
\makeatother
\begin{document}
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua.\footnote{Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.}
\addtocounter{footnote}{9}
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua.\footnote{Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.}
\end{document}
答案1
\llap
与左边重叠(边距)。\noindent
开始新行(\llap
需要)。 \hspace
在后添加间隙\@makefnmark
。我任意选择了\columnsep
。 \marginparsep
将匹配正常的\marginpar
。
\documentclass[12pt]{article}
\usepackage[text={140mm, 40mm}]{geometry}
\makeatletter
\def\@makefntext{\noindent\llap{\@makefnmark\hspace{\columnsep}}}
\makeatother
\begin{document}
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua.\footnote{Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.}
\addtocounter{footnote}{9}
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua.\footnote{Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.}
\end{document}