\lettrine の直前にテキストをタイプセットする

\lettrine の直前にテキストをタイプセットする

「サイドバー」テキストを追加するにはどうすればいいですか? 「サイドバー」はおそらく間違った言葉だとわかっています。正しい用語を教えてください。ドロップキャップの左側のテキスト (「The Thanksgiving」) について言及しています。

洞察:私は、1785 年聖公会祈祷書の 72 ページのフォリオ. 私は楽しみのために、そしてもっと多くの人が 1785 BCP の素晴らしい散文に簡単にアクセスできるようにするためにこれをやっています。私は LaTeX の初心者で、この言語を使い始めてまだ数日です。あ、OCR 作業には ABBYY FineReader Pro 11 を使用しました。向こうの ABBYY 本社の善良な人々は、古い文書に OCR を使用している人々についてのメモを受け取る必要があります。彼らのプログラムは長い s を f と認識しているのです!

私のコードは次のとおりです:

\documentclass{article}
\usepackage{lettrine}
\usepackage{fontspec}
    \defaultfontfeatures{Ligatures={Historical}}
    \setmainfont[Ligatures={Common,Rare}]{Adobe Caslon Pro}

\begin{document}
   \lettrine{T}{O} our prayers, O Lord, we join our unfeigned thanks for all thy
   mercies; for our being, our reaſon, and all other endowments and faculties of ſoul
   and body; for our health, friends, food, and raiment, and all the other comforts and
   conveniences of life. Above all we adore thy mercy in ſending thy only Son into the
   world to redeem us from ſin and eternal death, and in giving us the knowledge and           
   ſenſe of our duty towards thee. We bleſs thee for thy patience with us, notwithſtanding
   our many and great provocations; for all the directions, aſſiſtances, and comforts of thy
   Holy Spirit; for thy continual care and watchful providence over us through the whole
   courſe of our lives; and particularly for the mercies and benefits of the paſt day:
   Beſecching thee to continue theſe thy bleſſings to us; and to give is grace to ſhow
   our thankfulneſs in a ſincere obedience to his laws through whoſe merits and
   interceſſion we received them all, thy Son our Saviour Jeſus Chriſt. \textit{Amen.}
\end{document}

オリジナルのスクリーンショット 再現のスクリーンショット(TeXstudioを使用)

ありがとう!

追伸: LaTeX の学習 (特に LD の人向け) とこの Stack への参加に関する記事を探しています。
追伸: 「私たちに忍耐していただいたことを祝福します」という言葉が、私にとって本当に心に響きました。現代の BCP (そして率直に言って、祈り全般) は、神を祝福することはめったにありません。通常は、神の祝福を祈願するものです。後のバージョンでは、これが削除されたのは残念です。

答え1

これはどう:

\documentclass{article}
\usepackage{lettrine}
\usepackage{fontspec}
\defaultfontfeatures{Ligatures={Historical}}
\setmainfont[Ligatures={Common,Rare}]{Adobe Caslon Pro}

\newcommand \prelude[1] {\makebox[8em][c]{\em\scriptsize #1.}}

\begin{document}
   \lettrine[ante={\prelude{The Thanksgiving}}, loversize=0.1]{T}{O} 
   our prayers, O Lord, we join our unfeigned thanks for all thy
   mercies; for our being, our reaſon, and all other endowments and faculties of ſoul
   and body; for our health, friends, food, and raiment, and all the other comforts and
   conveniences of life. Above all we adore thy mercy in ſending thy only Son into the
   world to redeem us from ſin and eternal death, and in giving us the knowledge and           
   ſenſe of our duty towards thee. We bleſs thee for thy patience with us, notwithſtanding
   our many and great provocations; for all the directions, aſſiſtances, and comforts of thy
   Holy Spirit; for thy continual care and watchful providence over us through the whole
   courſe of our lives; and particularly for the mercies and benefits of the paſt day:
   Beſecching thee to continue theſe thy bleſſings to us; and to give is grace to ſhow
   our thankfulneſs in a ſincere obedience to his laws through whoſe merits and
   interceſſion we received them all, thy Son our Saviour Jeſus Chriſt. \qquad \textit{Amen.}
\end{document}

答え2

Jon の上記の回答はまったく正しいのですが、私は、ソリューションのより自動化された LaTeX 風の実装を追加したいと考えました。LaTeX は、ドキュメントを論理的にマークアップすることがすべてです。環境を使用すると、ドキュメントの論理チャンク全体の一貫性を保つことができます。

あなたが再現するすべての祈りには、いくつかの共通点があると思います。

  • 資本を落とした
  • ドロップキャピタルの左側にタイトル(写真のように)
  • アーメン最後に。

これを基に何かを構築してみましょう:

\usepackage{xparse}
\NewDocumentEnvironment{prayer}{m m m}{%
  \lettrine[ante=\prelude{#1}]{#2}{#3}%
}{
  \unskip % removes excess space
  \qquad
  \textit{Amen.}\par
}

これはとても素晴らしいことです。今、私たちは次のような祈りについて話すことができます。

\begin{prayer}{The Thanksgiving}{T}{O}
  our prayers, ...
\end{prayer}

そして、その作業をすべて私たちに代わってやってもらいます。


現時点では、loversizeJon が指摘したトリックは使用できません。オプションの引数を追加して、それを可能にします。

\usepackage{xparse}
\NewDocumentEnvironment{prayer}{O{} m m m}{%
  \lettrine[ante=\prelude{#2},#1]{#3}{#4}%
}{
  \unskip % removes excess space
  \qquad
  \textit{Amen.}\par
}

私たちも素敵に見えるようになりました!

\begin{prayer}[loverline=.15]{The Thanksgiving}{T}{O}
  our prayers, ...
\end{prayer}

オプションで「サイドバー」(他に何と呼べばいいのかわかりませんが…)の幅も定義できるようにしたい場合はどうすればよいでしょうか。\newcommand (またはその友人であるnewenvironment)を使用して 2 つのオプション引数を定義することはできませんが、xparse次のようにすることはできます。

\usepackage{xparse}
\NewDocumentEnvironment{prayer}{O{} m O{8em} m m}{%
  % note I've taken out \prelude now; it is no longer general enough.
  \lettrine[ante={\makebox[#3][c]{\itshape\scriptsize #2.}}, #1]{#4}{#5}%
}{
  \unskip
  \qquad
  \textit{Amen.}\par
}

実際、xparse非常に強力です。非常に便利な構文を定義できます。とても簡単にできます。(texdoc xparse特に2ページ目を参照)完全な例を考えてみましょう。私はまだそれをいじっている

% xelatex bcp.tex
% pdfcrop bcp.pdf
% convert  -density 600 bcp-crop.pdf bcp.png
\documentclass{article}
\usepackage{lettrine}
\usepackage{fontspec}
\defaultfontfeatures{Ligatures={Historical}}
\setmainfont[Ligatures={Common,Rare}]{Hoefler Text}
% Unfortunately, I do not own Caslon Pro

\usepackage{xparse}

% Starts an environment like this:
%
%   \begin{prayer}[extra options for lettrine]%
%                 {'sidebar' text}%
%                 [width of sidebar]
%     Dropped text \endl no longer dropped
%   \end{prayer}
%
%   Will automatically drop the first letter encountered and continue
%   the \lettrine until an \endl is encountered.
\NewDocumentEnvironment{prayer}{O{} m O{8em} m u{\endl}}{%
  \lettrine[ante={\raisebox{.5ex}
                 {\makebox[#3][c]{\itshape\scriptsize #2.}}},
            #1]%
           {#4}{#5}%
}{
  \unskip
  \qquad
  \textit{Amen.}\par
}
\pagestyle{empty}
\begin{document}
\begin{prayer}[loversize=.15]{The Thankſgiving}
  TO \endl our prayers, O Lord, we join our unfeigned thanks for all thy mercies;
  for our being, our reaſon, and all other endowments and faculties of
  ſoul and body; for our health, friends, food, and raiment, and all
  the other comforts and conveniences of life.  Above all we adore thy
  mercy in ſending thy only Son into the world to redeem us from ſin
  and eternal death, and in giving us the knowledge and ſenſe of our
  duty towards thee.  We bleſs thee for thy patience with us,
  notwithſtanding our many and great provocations; for all the
  directions, aſſiſtances, and comforts of thy Holy Spirit; for thy
  continual care and watchful providence over us through the whole
  courſe of our lives; and particularly for the mercies and benefits
  of the paſt day: Beſecching thee to continue theſe thy bleſſings to
  us; and to give is grace to ſhow our thankfulneſs in a ſincere
  obedience to his laws through whoſe merits and interceſſion we
  received them all, thy Son our Saviour Jeſus Chriſt.
\end{prayer}
\end{document}

結果は次のようになります。

出力

(私が行った唯一の追加変更は、「サイドバー」のテキストを で少しだけ上に上げたことです\raisebox。この方が少し近くなったと思います。)

答え3

Sean のソリューションのバリエーションで、構文が簡略化されています。「prelude」テキストは のオプションとして指定され\lettrine、新しいキーを定義するだけです。このプレリュードの幅は、デフォルトでは、両端が 1 つの四角形で囲まれた自然な幅です。prewidth例に示すように、この幅を変更するためのキーを指定できます。

標準はloversizeプリアンブルで変更できるため、使用のたびに指定する必要はありません。

\documentclass{article}
\usepackage{lettrine}
\usepackage{fontspec}
\defaultfontfeatures{Ligatures={Historical}}
\setmainfont[Ligatures={Common,Rare}]{Hoefler Text}
% Unfortunately, I do not own Caslon Pro

\makeatletter
\define@key{L}{prelude}{%
  \renewcommand*{\L@ante}{%
    \quad\makebox[\L@prewidth][c]{\em\scriptsize #1.}\quad
  }%
}
\define@key{L}{prewidth}{\renewcommand*{\L@prewidth}{#1}}
\newcommand{\L@prewidth}{\width}
\renewcommand{\DefaultLoversize}{0.15}
\makeatother

\usepackage{xparse}

\NewDocumentEnvironment{prayer}{O{}mm}{%
  \lettrine[#1]{#2}{#3}%
}{%
  % if you want the Amen at a quad from the last word
  \unskip\nolinebreak\qquad\textit{Amen.}\par
  % if instead you want the Amen at the right margin
  % comment the line above and uncomment the following three lines
  %{\nobreak\hfill\penalty50\hskip1em\null\nobreak
  % \hfill\textit{Amen.}%
  % \parfillskip=0pt \finalhyphendemerits=0 \par}%
}

\begin{document}

\begin{prayer}[prelude=The Thankſgiving]{T}{O}
our prayers, O Lord, we join our unfeigned thanks for all thy mercies;
for our being, our reaſon, and all other endowments and faculties of
ſoul and body; for our health, friends, food, and raiment, and all
the other comforts and conveniences of life.  Above all we adore thy
mercy in ſending thy only Son into the world to redeem us from ſin
and eternal death, and in giving us the knowledge and ſenſe of our
duty towards thee.  We bleſs thee for thy patience with us,
notwithſtanding our many and great provocations; for all the
directions, aſſiſtances, and comforts of thy Holy Spirit; for thy
continual care and watchful providence over us through the whole
courſe of our lives; and particularly for the mercies and benefits
of the paſt day: Beſecching thee to continue theſe thy bleſſings to
us; and to give is grace to ſhow our thankfulneſs in a ſincere
obedience to his laws through whoſe merits and interceſſion we
received them all, thy Son our Saviour Jeſus Chriſt.
\end{prayer}

\begin{prayer}[prewidth=6em,prelude=The Thankſgiving]{T}{O}
our prayers, O Lord, we join our unfeigned thanks for all thy mercies;
for our being, our reaſon, and all other endowments and faculties of
ſoul and body; for our health, friends, food, and raiment, and all
the other comforts and conveniences of life.  Above all we adore thy
mercy in ſending thy only Son into the world to redeem us from ſin
and eternal death, and in giving us the knowledge and ſenſe of our
duty towards thee.  We bleſs thee for thy patience with us,
notwithſtanding our many and great provocations; for all the
directions, aſſiſtances, and comforts of thy Holy Spirit; for thy
continual care and watchful providence over us through the whole
courſe of our lives; and particularly for the mercies and benefits
of the paſt day: Beſecching thee to continue theſe thy bleſſings to
us; and to give is grace to ſhow our thankfulneſs in a ſincere
obedience to his laws through whoſe merits and interceſſion we
received them all, thy Son our Saviour Jeſus Chriſt.
\end{prayer}

\begin{prayer}[prewidth=8em,prelude=The Thankſgiving]{T}{O}
our prayers, O Lord, we join our unfeigned thanks for all thy mercies;
for our being, our reaſon, and all other endowments and faculties of
ſoul and body; for our health, friends, food, and raiment, and all
the other comforts and conveniences of life.  Above all we adore thy
mercy in ſending thy only Son into the world to redeem us from ſin
and eternal death, and in giving us the knowledge and ſenſe of our
duty towards thee.  We bleſs thee for thy patience with us,
notwithſtanding our many and great provocations; for all the
directions, aſſiſtances, and comforts of thy Holy Spirit; for thy
continual care and watchful providence over us through the whole
courſe of our lives; and particularly for the mercies and benefits
of the paſt day: Beſecching thee to continue theſe thy bleſſings to
us; and to give is grace to ſhow our thankfulneſs in a ſincere
obedience to his laws through whoſe merits and interceſſion we
received them all, thy Son our Saviour Jeſus Chriſt.
\end{prayer}
\end{document}

したがって、 の構文は\begin{prayer}の構文と同じです\lettrine

「Amen」は最後の単語から 2 つのクワッドに設定されています (改行は許可されていません)。コードでは、必要に応じて右余白にプッシュする方法が示されています。

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

2行のプレリュードの場合、次のようになります。 から までのコードを\makeatletter次の\makeatotherように置き換えます。

\usepackage{varwidth}
\makeatletter
\define@key{L}{prelude}{%
  \renewcommand*{\L@ante}{%
    \quad
    \makebox[\L@prewidth][c]{%
      \begin{varwidth}[t]{12em}
      \em\scriptsize #1.
      \end{varwidth}%
    }\quad
  }%
}
\define@key{L}{prewidth}{\renewcommand*{\L@prewidth}{#1}}
\newcommand{\L@prewidth}{\width}
\renewcommand{\DefaultLoversize}{0.15}
\makeatother

次に入力

\begin{prayer}[
  prelude=The Thankſgiving\\ and Chriſtmas
]{T}{O}
our prayers, O Lord, we join our unfeigned thanks for all thy mercies;
for our being, our reaſon, and all other endowments and faculties of
ſoul and body; for our health, friends, food, and raiment, and all
the other comforts and conveniences of life.  Above all we adore thy
...
\end{prayer}

(改行を示す方が良いことに注意してください)は、

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

関連情報