
Como adiciono texto na 'barra lateral'? Estou ciente de que 'barra lateral' provavelmente é a palavra errada a ser usada. Por favor, deixe-me saber qual é o termo correto. Estou me referindo ao texto à esquerda da letra maiúscula ("O Dia de Ação de Graças".)
Algumas dicas: estou trabalhando na replicação de umFólio de 72 páginas do Livro Episcopal de Oração Comum de 1785. Estou fazendo isso por diversão e para garantir que mais pessoas tenham acesso fácil à maravilhosa prosa do BCP de 1785. Sou novo no LaTeX e trabalho com a linguagem há apenas alguns dias. Ah, e usei o ABBYY FineReader Pro 11 para o trabalho de OCR. As boas pessoas da sede da ABBYY precisam receber o memorando sobre pessoas que usam OCR em documentos antigos - o programa deles acha que o s longo é uma merda!
Meu código é:
\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}
Obrigado!
PS: Procurando artigos sobre como aprender LaTeX (especialmente para pessoas com LD) e como se envolver neste Stack.
PPS: Descobri que “Nós te abençoamos por tua paciência conosco” realmente falou comigo. O BCP moderno (e, francamente, as orações em geral) raramente abençoam a Deus – geralmente são intercessões pela bênção de Deus. Pena que isso foi removido das versões posteriores.
Responder1
Que tal agora:
\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}
Responder2
A resposta de Jon acima está absolutamente correta, mas pensei em adicionar uma implementação LaTeX-y mais automatizada da solução. LaTeX trata de marcar seu documento de forma lógica, certo? O uso de ambientes permite manter partes lógicas inteiras do documento consistentes.
Cada oração que você reproduzir, presumo, terá algumas coisas em comum:
- capital abandonado
- um título à esquerda da letra maiúscula (como na sua imagem)
- Amémno final.
Vamos construir algo a partir disso:
\usepackage{xparse}
\NewDocumentEnvironment{prayer}{m m m}{%
\lettrine[ante=\prelude{#1}]{#2}{#3}%
}{
\unskip % removes excess space
\qquad
\textit{Amen.}\par
}
Isso é muito bom – agora podemos falar sobre orações como
\begin{prayer}{The Thanksgiving}{T}{O}
our prayers, ...
\end{prayer}
e ter todo esse trabalho feito para nós.
Observe que agora não podemos usar esse loversize
truque que Jon observou. Podemos colocá-lo como um argumento opcional para permitir que:
\usepackage{xparse}
\NewDocumentEnvironment{prayer}{O{} m m m}{%
\lettrine[ante=\prelude{#2},#1]{#3}{#4}%
}{
\unskip % removes excess space
\qquad
\textit{Amen.}\par
}
Agora também podemos ficar bonitos!
\begin{prayer}[loverline=.15]{The Thanksgiving}{T}{O}
our prayers, ...
\end{prayer}
E se quisermos também definir opcionalmente a largura da 'barra lateral' (também não sei como chamá-la…)? Você não pode definir dois argumentos opcionais com \newcommand
(ou seu amigo newenvironment
), mas xparse
pode fazer isso:
\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
}
Na verdade, xparse
é extremamente poderoso: pode definir algumas sintaxes bastante convenientesmuitofacilmente. (Veja texdoc xparse
, especialmente a página 2.) Considere o exemplo completocom quem ainda estou brincando.
% 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}
que produz o seguinte:
(A única alteração adicional que fiz foi aumentar ligeiramente o texto da 'barra lateral' com \raisebox
. Acho que fica um pouco mais próximo desta forma.)
Responder3
Uma variação da solução de Sean, com sintaxe simplificada; o texto “prelúdio” é fornecido como uma opção \lettrine
, é apenas uma questão de definir uma nova tonalidade. A largura deste prelúdio é, por padrão, a largura natural, cercada por um quadrante em ambas as extremidades. Uma prewidth
chave pode ser fornecida para alterar esta largura, conforme mostrado nos exemplos.
O padrão loversize
pode ser modificado no preâmbulo, portanto não é necessário especificá-lo a cada utilização.
\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}
Portanto a sintaxe de \begin{prayer}
é igual à sintaxe de \lettrine
.
O “Amém” é definido a duas quadras da última palavra (não é permitida quebra de linha); no código é mostrado como empurrá-lo para a margem direita, se desejar.
Para prelúdios de duas linhas, aqui está uma possibilidade: substitua o código de \makeatletter
para \makeatother
por
\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
Então a entrada
\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}
(observe que é melhor indicar a quebra de linha) produzirá