强制字母出现在移位的粗体文本块内

强制字母出现在移位的粗体文本块内

我正在尝试编写一份服务订单,其中包含从实际边距缩进的粗体文本块。当我使用带有这种格式的普通文本的 lettrine 时,它​​会按预期显示(即嵌入在文本中),但当我将其与粗体文本一起使用时,它会出现在块之外,就好像它忽略了缩进命令一样。有人知道解决这个问题的方法吗?

先感谢您!

\documentclass[11pt,a5paper]{article}

\usepackage[cm]{fullpage}

\usepackage{fontspec}
\usepackage{lettrine}
\usepackage{libertine}
\usepackage{graphicx} % support the \includegraphics command and options
\usepackage{ragged2e}
\usepackage[parfill]{parskip}

\usepackage[autocompile]{gregoriotex}

\setlength{\parskip}{0.7mm}

\begin{document}

\textit{{\color{gregoriocolor}A period of silence for reflection on the past day may follow.}}

\textit{{\color{gregoriocolor}The following or other suitable words of penitence may be used.}}
\bigskip

\setlength{\leftskip}{1cm}

    \textbf{\lettrine{\textcolor{gregoriocolor}{W}}e confess to God almighty,\\
    the Father, the Son and the Holy Ghost,\\
    that we have sinned in thought, word and deed,\\
    through our own grievous fault.\\
    Wherefore we pray God to have mercy upon us.\\}

    \textbf{Almighty God, have mercy upon us,\\
    forgive us all our sins and deliver us from all evil,\\
    confirm and strengthen us in all goodness,\\
    and bring us to life everlasting;\\
    through Jesus Christ our Lord.\\
    Amen.\\}

\setlength{\leftskip}{0pt}

\end{document}

答案1

问题不是由缩进引起的,而是由在 内放置带有字母的段落引起的\textbf{...}。如果您尝试在 内放置段落分隔符,则中断不会像那样严重,\textbf{...}但似乎会产生一个框,通过声明比通过命令lettrine可以更好地处理该框:\bfseries\textbf{...}

\documentclass[11pt,a5paper]{article}
\usepackage[cm]{fullpage}% the geometry package is more recent and more powerful
\usepackage{fontspec,graphicx,lettrine,libertine}
\usepackage[parfill]{parskip}
\usepackage[autocompile]{gregoriotex}
\setlength{\parskip}{1ex}% ex and em are better than mm: if you change font size, spacing will change proportionally
\renewcommand*{\DefaultLoversize}{.02}% the lettrine is a little too small without this
\begin{document}
\textit{\color{gregoriocolor}A period of silence for reflection on the past day may follow.}% you had an extra set of braces here — not harmful, but clutters the source

\textit{\color{gregoriocolor}The following or other suitable words of penitence may be used.}

\bigskip

\setlength{\leftskip}{1cm}

{\bfseries
  \lettrine[lhang=.03]{\textcolor{gregoriocolor}{W}}{e} confess to God almighty,\\
  the Father, the Son and the Holy Ghost,\\
  that we have sinned in thought, word and deed,\\
  through our own grievous fault.\\
  Wherefore we pray God to have mercy upon us.% no \\ here: the blank line ends a paragraph

  Almighty God, have mercy upon us,\\
  forgive us all our sins and deliver us from all evil,\\
  confirm and strengthen us in all goodness,\\
  and bring us to life everlasting;\\
  through Jesus Christ our Lord.\\
  Amen.}

\setlength{\leftskip}{0pt}
\end{document}

输出

请注意,lettrines 的命令需要两个参数:\lettrine{}{},所以你想要\lettrine{W}{e}(将“e”变成小写)。

我设置了lhang,因为从视觉上看,如果字母突出一点,对齐效果会更好。它们应该突出多少取决于单个字母的形状,所以我没有设置默认值。我确实设置了默认值Loversize,但这仅适用于所有字母都采用这种字体的情况;否则,您可以将其设置loversize为命令的可选参数\lettrine

虽然我不知道整个文档看起来会是什么样子,但我认为你会发现 Libertine 的半粗体系列在审美上比粗体更令人愉悦。

相关内容