5

Working with lettrine in a probably not intended kind leads me to a problem. When running the following example you can see that the two lines of text are not starting at the same position. Ugly! I hope and believe that there is a workaround to get a smart and LaTeX-like result.

\documentclass{scrartcl}
\usepackage{lettrine}
\usepackage{tikz}
\setlength{\textwidth}{5cm}
\begin{document}
\lettrine{\tikz\fill[red] (0,0) rectangle (1ex,2ex);}{} This is just
a ridiculous test. This is just a ridiculous test. This is just a
ridiculous test. This is just a ridiculous test.
\end{document}

Remark: In my application there is no red rectangle but an opened book as a hint for a literature cross reference.

6

From the documentation of lettrine:

findent=<dimen> (positive or negative) controls the horizontal gap between the dropped capital and the indented block of text (default=0pt);

nindent=<dimen> shifts all indented lines, starting from the second one, horizontally by <dimen> (this shift is relative to the first line, default=0.5em);

Then the following setting can be used, e.g.:

\documentclass{scrartcl}
\usepackage{lettrine}
\usepackage{tikz}
\setlength{\textwidth}{5cm}
\begin{document}
  \lettrine[
    findent=.5em,
    nindent=0pt
  ]{\tikz\fill[red] (0,0) rectangle (1ex,2ex);}{}% comment line end (space)
  This is just
  a ridiculous test. This is just a ridiculous test. This is just a
  ridiculous test. This is just a ridiculous test.
\end{document}

Result

  • Yes, I misunderstood the fine manual. The solution works fine, thanks! – Jürgen Apr 15 '15 at 8:23
4

You said, you will use image in lettrine. Then you need the following:

\lettrine[
    lines=2,
    lraise=0.05,   %% raises or lowers (for -ve value) image
    findent=.5em,   %% controls the gap between image and the text
    image=true]{example-image-a}{This}

Here the option image=true allows you to put an image (example-image-a here}. Note that the second argument contains This and to prevent this word from changing its font, you have to use

\renewcommand{\LettrineTextFont}{\normalfont}

Code:

\documentclass{scrartcl}
\usepackage{lettrine}
\usepackage{graphicx}
\setlength{\textwidth}{5cm}
\renewcommand{\LettrineTextFont}{\normalfont}
\begin{document}
\lettrine[
    lines=2,
    lraise=0.05,
    findent=.5em,
    image=true]{example-image-a}{This} is just
a ridiculous test. This is just a ridiculous test. This is just a
ridiculous test. This is just a ridiculous test.
\end{document}

enter image description here

1

Like that?

\documentclass{scrartcl}
\usepackage{lettrine}
\usepackage{tikz}
\setlength{\textwidth}{5cm}

\begin{document}

\lettrine[nindent = 0em]{\tikz\fill[red] (0,0) rectangle (1ex,2ex);\,}{}This is just a ridiculous test. This is just a ridiculous test. This is just a
ridiculous test. This is just a ridiculous test.

\end{document} 

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.