
Wie füge ich „Seitenleisten“-Text hinzu? Mir ist bewusst, dass „Seitenleiste“ wahrscheinlich das falsche Wort ist. Bitte lassen Sie mich wissen, was der richtige Begriff ist. Ich beziehe mich auf den Text links vom Großbuchstaben („Das Erntedankfest“).
Ein kleiner Einblick: Ich arbeite an der Replikation eines72-seitiges Folio des episkopalischen Book of Common Prayer von 1785. Ich mache das zum Spaß und um sicherzustellen, dass mehr Menschen einfachen Zugang zu der wunderbaren Prosa des 1785 BCP haben. Ich bin neu bei LaTeX und arbeite erst seit ein paar Tagen mit der Sprache. Oh, und ich habe ABBYY FineReader Pro 11 für die OCR-Arbeit verwendet. Die guten Leute dort drüben in der ABBYY-Zentrale müssen das Memo über Leute bekommen, die OCR bei alten Dokumenten verwenden – ihr Programm denkt, das lange s sei ein f!
Mein Code ist:
\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}
Danke!
PS: Ich suche nach Artikeln zum Erlernen von LaTeX (insbesondere für Menschen mit Lernbehinderung) und zur Teilnahme an diesem Stack.
PPS: Ich fand, dass „Wir segnen dich für deine Geduld mit uns“ mich wirklich angesprochen hat. Das moderne BCP (und, ehrlich gesagt, Gebete im Allgemeinen) segnen Gott selten – es sind normalerweise Fürbitten um Gottes Segen. Schade, dass dies aus späteren Versionen entfernt wurde.
Antwort1
Wie wäre es damit:
\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}
Antwort2
Jons Antwort oben ist absolut richtig, aber ich dachte, ich würde eine automatisiertere, LaTeX-artige Implementierung der Lösung hinzufügen. Bei LaTeX geht es darum, Ihr Dokument logisch zu markieren, oder? Durch die Verwendung von Umgebungen können Sie ganze logische Teile des Dokuments konsistent halten.
Ich gehe davon aus, dass alle Gebete, die Sie wiedergeben, einige Dinge gemeinsam haben:
- Kapital verloren
- ein Titel links vom Großbuchstaben (wie in deinem Bild)
- AmenAm Ende.
Lasst uns daraus etwas bauen:
\usepackage{xparse}
\NewDocumentEnvironment{prayer}{m m m}{%
\lettrine[ante=\prelude{#1}]{#2}{#3}%
}{
\unskip % removes excess space
\qquad
\textit{Amen.}\par
}
Das ist wirklich großartig – jetzt können wir über Gebete sprechen wie
\begin{prayer}{The Thanksgiving}{T}{O}
our prayers, ...
\end{prayer}
und lassen Sie die ganze Arbeit für uns erledigen.
Beachten Sie, dass wir den von Jon erwähnten Trick derzeit nicht verwenden können loversize
. Wir können ihn als optionales Argument angeben, um dies zu ermöglichen:
\usepackage{xparse}
\NewDocumentEnvironment{prayer}{O{} m m m}{%
\lettrine[ante=\prelude{#2},#1]{#3}{#4}%
}{
\unskip % removes excess space
\qquad
\textit{Amen.}\par
}
Jetzt können auch wir gut aussehen!
\begin{prayer}[loverline=.15]{The Thanksgiving}{T}{O}
our prayers, ...
\end{prayer}
Was wäre, wenn wir optional auch die Breite der „Seitenleiste“ definieren möchten (ich weiß auch nicht, wie ich sie sonst nennen soll…)? Sie könnten mit \newcommand
(oder seinem Freund newenvironment
) nicht zwei optionale Argumente definieren, aber xparse
das ist möglich:
\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
}
Tatsächlich xparse
ist es extrem leistungsfähig: Es kann einige ziemlich verrückt-praktische Syntaxen definierensehrleicht. (Siehe texdoc xparse
, insbesondere Seite 2.) Betrachten Sie das vollständige Beispielmit dem ich immer noch spiele.
% 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}
was folgendes ergibt:
(Die einzige zusätzliche Änderung, die ich vorgenommen habe, bestand darin, den Text der Seitenleiste mit leicht anzuheben \raisebox
. Ich finde, so sieht es etwas ähnlicher aus.)
Antwort3
Eine Variante von Seans Lösung mit einer vereinfachten Syntax; der Text „Präludium“ wird als Option angegeben \lettrine
, es geht lediglich darum, einen neuen Schlüssel zu definieren. Die Breite dieses Präludiums ist standardmäßig die natürliche Breite, an beiden Enden von einem Quad umgeben. prewidth
Zum Ändern dieser Breite kann ein Schlüssel angegeben werden, wie in den Beispielen gezeigt.
Der Standard loversize
kann in der Präambel geändert werden, sodass es nicht notwendig ist, ihn bei jeder Verwendung anzugeben.
\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}
Daher ist die Syntax von \begin{prayer}
dieselbe wie die Syntax von \lettrine
.
Das „Amen“ wird zwei Quads vom letzten Wort entfernt gesetzt (kein Zeilenumbruch erlaubt); im Code wird gezeigt, wie es bei Bedarf an den rechten Rand verschoben werden kann.
Für zweizeilige Präludien gibt es folgende Möglichkeit: Ersetzen Sie den Code von \makeatletter
bis \makeatother
durch
\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
Dann die Eingabe
\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}
(beachten Sie, dass es besser ist, den Zeilenumbruch anzuzeigen) erzeugt