エンドノートのカスタマイズパート2

エンドノートのカスタマイズパート2

前述したように(文末脚注をカスタマイズする)、のドキュメント脚注パッケージでは、文末脚注の外観を変更およびカスタマイズする方法についてはあまり説明されていません。そのため、コミュニティに助けを求めています。

文末脚注は次のようになります。

  1. 文末脚注マーカーは左余白に配置する必要があります。
  2. 文末脚注のテキストは、文末脚注全体にわたってインデントする必要があります (つまり、各文末脚注の最初の行だけではありません)。
  3. \baselineskip各音符の間には1 行のスペース (つまり) が入ります。
  4. テキストの位置合わせなし (つまり\raggedright)。
  5. 文末脚注のテキストのサイズを設定できるようにしたいと思います (例\normalsize)。

私はから得るゴンサロ答え\enoteformatこれら全てまたは一部を達成するために再定義することはできるが、これで遊んでも何の達成にも至っていない:(

MWE:

\documentclass{article}
\usepackage{endnotes,lipsum}
    %\renewcommand\enoteformat{} % perhaps doing something here would do the trick?
\begin{document}
\endnote{\lipsum[1]}\endnote{\lipsum[2]}
\theendnotes
\end{document}

答え1

の標準的な定義\enoteformat

\def\enoteformat{\rightskip\z@ \leftskip\z@ \parindent=1.8em
  \leavevmode\llap{\makeenmark}}

これをモデルとして、次のようなことが考えられます。

\documentclass{article}
\usepackage{endnotes}
\usepackage{lipsum}

\renewcommand{\enotesize}{\normalsize}
\renewcommand\enoteformat{%
  \raggedright
  \leftskip=1.8em
  \makebox[0pt][r]{\theenmark. \rule{0pt}{\dimexpr\ht\strutbox+\baselineskip}}%
}

\begin{document}
\endnote{\lipsum[1]}\endnote{\lipsum[2]}

\theendnotes
\end{document}

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

同じですが、enotezパッケージを使用すると、おそらくより良く、確実に簡単になります。

\documentclass{article}
\usepackage{enotez}
\usepackage{lipsum}

\DeclareInstance{enotez-list}{sverre}{paragraph}
 {
  heading=\section*{#1},
  notes-sep=\baselineskip,
  format=\normalsize\normalfont\raggedright\leftskip1.8em,
  number=\makebox[0pt][r]{#1.\ }\ignorespaces,
 }

\begin{document}
\endnote{\lipsum[1]}\endnote{\lipsum[2]}

\printendnotes[sverre]
\end{document}

インデントの幅を小文字のインデントと左端の数字と同じにしたい場合は、次のようにします。

\documentclass{article}
\usepackage{showframe} % just for the example
\usepackage{enotez}
\usepackage{lipsum}

\newlength{\normalparindent}
\AtBeginDocument{\setlength{\normalparindent}{\parindent}}

\DeclareInstance{enotez-list}{sverre}{paragraph}
 {
  heading=\section*{#1},
  notes-sep=\baselineskip,
  format=\normalsize\normalfont\raggedright\leftskip\normalparindent,
  number=\makebox[0pt][r]{\makebox[\normalparindent][l]{#1.}}\ignorespaces,
 }

\begin{document}
Something\endnote{\lipsum[1]} to show the parindent\endnote{\lipsum[2]}

\printendnotes[sverre]
\end{document}

showframe仕様が尊重されていることを確認するために追加しました

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

ノート
パラメータは\leftskip、グローバル左マージンからテキストの実際の左マージンまでの距離です。コマンドは\raggedrightこれをゼロに設定するので、後でこれを上書きし、\rightskip伸縮可能なスペースに設定します。これもゼロに設定されるため、値を記憶するように\parindent定義しました。不揃いさを減らすために、(まれな)ハイフネーションを可能にするパッケージも試してみるとよいでしょう。ダブルメイクボックストリックを使用して、コンテンツが左に寄った幅ゼロのボックスを設定します。このボックスには、幅広のボックスが含まれており、コンテンツは左に寄っています。\normalparindent\RaggedRightragged2e\normalparindent

関連情報