在左边距实现右对齐脚注标记的侵入性较小的方法是什么?

在左边距实现右对齐脚注标记的侵入性较小的方法是什么?

有没有比我在这里使用的方法侵入性更小的方法来实现在左边距右对齐的脚注标记(设置\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}

相关内容