我正在尝试在诗歌环境中使用首字下沉。我手动操作时或多或少取得了成功:
\documentclass{book}
\usepackage{verse,anyfontsize}
\begin{document}
\begin{verse}
\hspace{22pt}his is line 1 of the verse.\\
\vspace{-8pt}{\fontsize{28}{30}\selectfont T}\hspace{2pt}This is line 2 of the verse.\\
Here is the third line.\\
And the fourth and final.
This is line 1 of the verse.\\
This is line 2 of the verse.\\
Here is the third line.\\
And the fourth and final.
\end{verse}
\end{document}
但是,如果我使用不同的字母作为首字下沉,则所有水平间距都需要通过目测进行更改。如果我更改文档中的字体大小(这会改变行距),则上面的垂直间距也需要通过目测进行更改。
有没有更好的方法?比如使用不同的字母(如首字下沉)或不同的字体大小不会让一切变得混乱?欢迎提出任何建议。
答案1
在这里,我刚刚构思了自己的版本,似乎很管用。以 开始这节诗,并将\startverse{}{}
诗节的前两行作为参数。确保\\
在 之后放置\startverse
。
我确实将 a 硬连线minipage
到 4in,这是可以更改的。除了适用于内联字体大小更改(如图所示)外,还已确认这适用于设置为 10pt - 12pt 的文档。
编辑以处理唯一的通用下行字符:字母“Q”。我还根据 OP 的评论重新编辑以处理彩色和左偏移通用字符。请注意,我将偏移量设为字母宽度的一小部分,而不是固定量。我在代码中保留了两种形式(一种有注释),以防 OP 希望使用固定偏移量。
\documentclass[12pt]{book}
\usepackage{scalerel}
\usepackage{stackengine}
\usepackage{verse,anyfontsize}
\usepackage{xcolor}
\def\startverse#1#2{%
\begin{minipage}{4in}%
\firstline#1\relax%
\def\verselineB{#2}%
\if Q\versalletter\def\descstrut{\strut}\else\def\descstrut{}\fi%
\def\Versal{\textcolor{red}{%
\scalerel*{$\fontsize{28}{30}\selectfont\versalletter$}%
{\def\stacktype{L}\stackon{T\descstrut}{T}}}}%
\setbox0=\hbox{\Versal\,}%
% \def\leftoffset{-15pt}%WHAT OP ASKED FOR, BUT NOT BEST, IMHO
\def\leftoffset{-.3\wd0}%
\hspace*{\wd0}\hspace{\leftoffset}%
\verselineA\\%
\hspace*{\wd0}\hspace{\leftoffset}%
\llap{\smash{\box0}}%
\verselineB\strut%
\end{minipage}%
}
\def\firstline#1#2\relax{\def\versalletter{#1}\def\verselineA{#2}}
\begin{document}
\begin{verse}
\startverse
{This is line 1 of my newly formed verse.}
{The second is nicely tucked in.}\\
Here is the third line, it is not quite so terse\\
and the fourth line is not quite its twin.
\startverse
{Queerly, the Q is a versal descender.}%
{If fully set, it would interfere.}\\
With a strut I will staunchly defend her\\
descending not fully, it suffers so here.
\scriptsize\startverse
{And this is line 1 of my scriptsiz-ed verse.}
{Good things are often quite small.}\\
I once wed a sweet, blonde-headed night nurse\\
only five feet and four inches tall.
\tiny\startverse
{Only this is yet smaller; ever so tiny.}
{You may need your spectacles on.}\\
Without them you could become quite whiney.\\
and that is the end of my song.
\end{verse}
\end{document}
先前答案的一部分:
对于那些不喜欢将前两行放在括号中的人来说,这种方法就足够了。
\documentclass[12pt]{book}
\usepackage{scalerel}
\usepackage{stackengine}
\usepackage{verse,anyfontsize}
\def\startverse#1\\#2\\{%
\begin{minipage}{4in}%
\firstline#1\relax%
\def\verselineB{#2}%
\if Q\versalletter\def\descstrut{\strut}\else\def\descstrut{}\fi%
\def\Versal{\scalerel*{$\fontsize{28}{30}\selectfont\versalletter$}%
{\def\stacktype{L}\stackon{T\descstrut}{T}}}%
\setbox0=\hbox{\Versal\,}%
\noindent\hspace*{\wd0}\verselineA\\%
\smash{\Versal\,}\verselineB\strut%
\end{minipage}\\%
}
\def\firstline#1#2\relax{\def\versalletter{#1}\def\verselineA{#2}}
\begin{document}
\begin{verse}
\startverse
This is line 1 of my newly formed verse.\\
The second is nicely tucked in.\\
Here is the third line, it is not quite so terse\\
and the fourth line is not quite its twin.
\startverse
Queerly, the Q is a versal descender.\\
If fully set, it would interfere.\\
With a strut I will staunchly defend her\\
descending not fully, it suffers so here.
\scriptsize\startverse
And this is line 1 of my scriptsiz-ed verse.\\
Good things are often quite small.\\
I once wed a sweet, blonde-headed night nurse\\
only five feet and four inches tall.
\tiny\startverse
Only this is yet smaller; ever so tiny.\\
You may need your spectacles on.\\
Without them you could become quite whiney.\\
and that is the end of my song.
\end{verse}
\end{document}