以 wrapfigure 开头——还有其他想法吗?

以 wrapfigure 开头——还有其他想法吗?

以下最小示例显示了我想如何在文档中制作首字母。我使用wrapfigure制作它,但似乎很难手动调整或自动测量和调整高度和宽度。

\documentclass[twoside,11pt]{memoir}
\usepackage[english]{babel}
\usepackage[latin2]{inputenc}
\usepackage{fouriernc}
\usepackage{blindtext}
\usepackage{calc}
\usepackage{wrapfig}
\usepackage{graphicx}

\renewcommand{\baselinestretch}{1.1}
\parskip9pt
\parindent0pt

\newlength{\wrapfig}            % this length will be used for measure the with of the letter
\newcommand{\initiale}[1]{%
 \settowidth{\wrapfig}{\makebox{\resizebox{!}{35pt}{#1}}}%
 \begin{wrapfigure}[3]{l}{\wrapfig-9pt}%
 \vskip-14pt
   \makebox{\resizebox{!}{35pt}{#1}}%
 \end{wrapfigure}\par
}

\begin{document}
\sloppy

\initiale{D}
Hello, here is some text without a meaning. This text should show, how a
printed text will look like at this place. If you read this text, you will get no
information. Really? Is there no information?Hello, here is some text without a meaning. 
This text should show, how a
printed text will look like at this place. If you read this text, you will get no
information. Really? Is there no information?

\initiale{D}
Hello, here is some text without a meaning. This text should show, how a
printed text will look like at this place. If you read this text, you will get no
information. Really? Is there no information?Hello, here is some text without a meaning.
This text should show, how a
printed text will look like at this place. If you read this text, you will get no
information. Really? Is there no information?

\end{document}

您可以看到,wrapfigure 还存在另一个问题。如果 wrapfigure 环境位于页面顶部或命令之后,“图形”上方的垂直空间与任何地方都不一样。\clearpage该命令\initiale{D}与文本之前的命令相同,但它仍会产生其他输出。

我想寻求更好的解决方案。 最简单的方法是将 放在\parbox左侧,然后是文本,但显然 parbox 右侧只有一行文本。我也尝试将 设置\leftskip为非零值,但我无法在实际段落结束之前将其重新设置。

答案1

您可以使用莱特林包。一个小例子:

\documentclass[twoside,11pt]{memoir}
\usepackage[english]{babel}
\usepackage{fouriernc}
\usepackage{lettrine}
\renewcommand{\baselinestretch}{1.1}
\parskip9pt
\parindent0pt

\begin{document}
\sloppy

\lettrine[lines=3, lraise=0.1, nindent=0em]%
{H}{ello}, here is some text without a meaning. This text should show, how a
printed text will look like at this place. If you read this text, you will get no
information. Really? Is there no information?Hello, here is some text without a meaning.
This text should show, how a
printed text will look like at this place. If you read this text, you will get no
information. Really? Is there no information?

\lettrine[lines=3, lraise=0, nindent=1em, slope=-.5em]%
{H}{ello}, here is some text without a meaning. This text should show, how a
printed text will look like at this place. If you read this text, you will get no
information. Really? Is there no information?Hello, here is some text without a meaning.
This text should show, how a
printed text will look like at this place. If you read this text, you will get no
information. Really? Is there no information?

\lettrine[lines=4, lraise=0, nindent=0em,findent=10pt]%
{H}{}ello, here is some text without a meaning. This text should show, how a
printed text will look like at this place. If you read this text, you will get no
information. Really? Is there no information?Hello, here is some text without a meaning.
This text should show, how a
printed text will look like at this place. If you read this text, you will get no
information. Really? Is there no information?

\end{document}

\parskip顺便提一下,手动更改和并不是一个好主意\parindent

相关内容