
'사이드바' 텍스트를 어떻게 추가하나요? 나는 '사이드바'가 사용하기에 잘못된 단어일 가능성이 높다는 것을 알고 있습니다. 정확한 용어가 무엇인지 알려주세요. 나는 떨어진 모자 왼쪽에 있는 텍스트("추수감사절")를 언급하고 있습니다.
몇 가지 통찰력: 저는1785년 성공회의 공동 기도서 72페이지 2절판. 나는 재미를 위해 그리고 더 많은 사람들이 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}
감사해요!
추신: LaTeX 학습(특히 LD 환자용)에 대한 기사를 찾고 이 스택에 참여합니다.
PPS: 저는 "당신의 인내심에 감사드립니다"라는 말이 정말로 저에게 와 닿는다는 것을 알았습니다. 현대 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-y 솔루션 구현을 추가하겠다고 생각했습니다. 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
Jon이 언급한 트릭을 사용할 수 없습니다. 이를 허용하기 위해 선택적 인수를 넣을 수 있습니다.
\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
단순화된 구문을 사용한 Sean 솔루션의 변형입니다. "전주곡" 텍스트는 에 대한 옵션으로 제공되므로 \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
.
“아멘”은 마지막 단어로부터 두 개의 쿼드에 설정됩니다(줄 바꿈은 허용되지 않음). 코드에는 원하는 경우 오른쪽 여백으로 밀어 넣는 방법이 나와 있습니다.
두 줄 전주곡의 경우 다음과 같은 방법이 가능합니다. from 의 코드를 \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}
(줄 바꿈을 나타내는 것이 더 좋습니다)