1桁と2桁の脚注記号をKOMAで右揃えにする

1桁と2桁の脚注記号をKOMAで右揃えにする

に基づくこの答え私の質問に対して本文中の脚注マーカーは上付き数字で表記する必要がありますが、脚注中の脚注マーカーはフルサイズの旧スタイルの数字で表記する必要があります。脚注の外観をフォーマットするための次のコードがあります。

\documentclass{article}
\usepackage{fontspec} % Unicode
    \setmainfont{Libertinus Serif}
    \newfontfamily\footfont{Libertinus Serif}[% for footnote markers in the footnote
        Numbers = {Monospaced, OldStyle}]
\usepackage{scrextend} % KOMA script
    \newcommand*\footnotemarkspace{1em} % set distance of the footnote text from the margin
    \deffootnote{\footnotemarkspace}% use distance from above
        {\parindent}% paragraph indent in footnotes (footnotes should never have paragraphs!)
        {\makebox[\footnotemarkspace][l]{\footfont\thefootnotemark.}} % footfont with period for footnote marks in footnote

\begin{document}
Foobar\footnote{First footnote}\footnote{Second footnote}\footnote{Third footnote}\footnote{Fourth footnote}\footnote{Fifth footnote}\footnote{Sixth footnote}\footnote{Seventh footnote}\footnote{Eighth footnote}\footnote{Ninth footnote}\footnote{Tenth footnote}\footnote{Eleventh footnote}\footnote{Twelfth footnote}
\end{document}

テキストの 10 番目の脚注に達すると、つまり脚注マークが 1 桁から 2 桁に変わると、問題が発生します。上記のコードからの出力は次のようになります。

ここに画像の説明を入力してください

問題は、footnotemarkspace脚注マークの右端からテキストまでの距離を設定するパラメータがないまま、左余白から脚注テキストまでの距離を設定することです。

私にとって最善の解決策は、脚注マークを右揃えにして、1 桁の数字の右端を 2 桁の数字の右端と同じにし、脚注マークの右端からテキストまでの距離を均一にすることです。理想的には、2 桁の脚注マークの左端は、ドキュメントのテキスト領域の左余白に揃える必要があります。

どうすればこれを実現できるでしょうか?同じ質問は以前にもされたことがあるただし、その場合、質問も提案された回答も、この場合私が使用している KOMA スクリプトを使用していません。

答え1

を拡大する必要があります。その後、の最後の引数でコマンドの\footnotemarkspaceオプションを使用できます。r\makebox\deffootnote

\documentclass{article}
\usepackage{fontspec} % Unicode
\setmainfont{Libertinus Serif}
\newfontfamily\footfont{Libertinus Serif}[% for footnote markers in the footnote
  Numbers = {Monospaced, OldStyle}]

\usepackage{scrextend} % KOMA script
\KOMAoptions{footnotes=multiple}% maybe you want to use this option?
\newcommand*\footnotemarkspace{1.5em} % set distance of the footnote text from the margin
\deffootnote{\footnotemarkspace}% use distance from above
  {\parindent}% paragraph indent in footnotes (footnotes should never have paragraphs!)
  {\makebox[\footnotemarkspace][r]{\thefootnotemark.\ }} % footfont with period for footnote marks in footnote

\begin{document}
Foobar
\footnote{First footnote}\footnote{Second footnote}%
\footnote{Third footnote}\footnote{Fourth footnote}%
\footnote{Fifth footnote}\footnote{Sixth footnote}%
\footnote{Seventh footnote}\footnote{Eighth footnote}%
\footnote{Ninth footnote}\footnote{Tenth footnote}%
\footnote{Eleventh footnote}\footnote{Twelfth footnote}
\end{document}

ここに画像の説明を入力してください

または、次のようなものを使うこともできます

\makebox[\footnotemarkspace][l]{\footfont\phantom{99}\llap{\thefootnotemark}.}

ここに画像の説明を入力してください

コード:

\documentclass{article}
\usepackage{fontspec} % Unicode
\setmainfont{Libertinus Serif}
\newfontfamily\footfont{Libertinus Serif}[% for footnote markers in the footnote
  Numbers = {Monospaced, OldStyle}]

\usepackage{scrextend} % KOMA script
\KOMAoptions{footnotes=multiple}% maybe you want to use this option?
\newcommand*\footnotemarkspace{1.5em} % set distance of the footnote text from the margin
\deffootnote{\footnotemarkspace}% use distance from above
  {\parindent}% paragraph indent in footnotes (footnotes should never have paragraphs!)
  {\makebox[\footnotemarkspace][l]{\footfont\phantom{99}\llap{\thefootnotemark}.}} % footfont with period for footnote marks in footnote

\begin{document}
Foobar
\footnote{First footnote}\footnote{Second footnote}%
\footnote{Third footnote}\footnote{Fourth footnote}%
\footnote{Fifth footnote}\footnote{Sixth footnote}%
\footnote{Seventh footnote}\footnote{Eighth footnote}%
\footnote{Ninth footnote}\footnote{Tenth footnote}%
\footnote{Eleventh footnote}\footnote{Twelfth footnote}
\end{document}

編集:Sverre

ここで、最初のコード サンプルでは、​​2 桁の脚注マークの最初の桁をドキュメントのテキスト領域の左余白に揃える方法がないため、手動で調整する必要があることを説明します。

ここに画像の説明を入力してください

一方、2 番目のコード サンプルでは、\phantom​​ とにより\llap、2 桁の数字の左端が左余白に揃えられます。

ここに画像の説明を入力してください

この左揃えが必要な場合は、\phantomとを含むコードが\llapおそらく適切でしょう。

関連情報