Набранный текст непосредственно перед \lettrine с отброшенной заглавной буквы

Набранный текст непосредственно перед \lettrine с отброшенной заглавной буквы

Как добавить текст «sidebar»? Я знаю, что «sidebar» — это, скорее всего, неправильное слово. Пожалуйста, дайте мне знать, какой термин правильный. Я имею в виду текст слева от буквицы («The Thanksgiving»).

Некоторое понимание: я работаю над воспроизведением72-страничный фолиант Епископальной книги общих молитв 1785 года. Я делаю это ради развлечения и для того, чтобы больше людей имели легкий доступ к замечательной прозе BCP 1785 года. Я новичок в LaTeX и работаю с этим языком всего несколько дней. О, и я использовал 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)

Спасибо!

PS: Ищу статьи по изучению LaTeX (особенно для людей с LD) и вовлечению в этот стек.
PPS: Я обнаружил, что "We bleſs you for your tenderity with us" действительно зацепило меня. Современные 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

Ответ Джона выше абсолютно правильный, но я подумал, что добавлю более автоматизированную реализацию решения в стиле 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}

и пусть всю эту работу сделают за нас.


Обратите внимание, что прямо сейчас мы не можем использовать этот loversizeтрюк, который отметил Джон. Мы можем сделать его необязательным аргументом, чтобы разрешить это:

\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), но 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

Вариант решения Шона с упрощенным синтаксисом; текст «прелюдии» дается как опция для \lettrine, это просто вопрос определения нового ключа. Ширина этого прелюда по умолчанию равна естественной ширине, окруженной одним квадратом с обоих концов. 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.

«Аминь» располагается на расстоянии двух квадратов от последнего слова (перенос строки не допускается); в коде показано, как при желании переместить его на правое поле.

введите описание изображения здесь

Для двухстрочных прелюдий есть возможность: заменить код с \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}

(обратите внимание, что лучше указать разрыв строки) даст

введите описание изображения здесь

Связанный контент