0

scrlttr2 does not seem to have figures defined?

Package caption Error: No float type 'figure' defined.

So how can I fix that?

Before you argue using figures is pointless in letters:

  1. Yes, maybe, but I want it.
  2. In a multi-pages letter about art it may e.g. be actually useful.
  3. As far as I see I cannot wrap text around images in any other way than with wrapfig (wrapfigure) – does not this depend on figure? All guides I can find online recommend wrapfig. How should I wrap around an image otherwise? Even Word can do this easily and it is (also) made for creating letters.

Example code (snippet):

\documentclass[version=last]{scrlttr2}

\usepackage{caption} \captionsetup{justification=centering} \usepackage{wrapfig}

rugk
  • 1,090
  • 1
  • 10
  • 27
  • Welcome to TeX.SX! Please don't post code snippets. Instead, put your snippet into a complete compilable document that shows the problem.

    Unfortunately your snippet doesn't illustrate the problem you describe.

    – Aradnix Sep 01 '20 at 02:54
  • why should wrapfig require floats? If you tried it and got an error, post your small test file and ask about the error. – David Carlisle Sep 01 '20 at 07:29
  • What about "figures" do you want? Floating to different pages? Numbered figure captions? Or the images? Wrapfigure does not depend on figures, but the \caption command does. – Donald Arseneau Sep 01 '20 at 07:34
  • 1
    Also, wrapfig is not the only way to wrap text around images, nor the best way. Just the easiest to use. See https://tex.stackexchange.com/questions/157110/wrapping-image-with-multiple-theorem-like-environments-and-displayed-math – John Kormylo Sep 01 '20 at 13:31

1 Answers1

1

If you need floating figures and/or the \caption command, then use class scrartcl and load package scrletter.

Example:

\documentclass{scrartcl}
\usepackage{scrletter}

\usepackage{blindtext}% only for dummy text \usepackage{graphicx} \usepackage{wrapfig}

\begin{document} \begin{letter}{Max Mustermann} \opening{Hello \usekomavar{toname},} \begin{wrapfigure}{l}{3cm} \includegraphics[width=\linewidth]{example-image} \caption{Caption} \end{wrapfigure} \blindtext

\Blindtext[2]

\begin{figure} \centering \includegraphics[width=5cm]{example-image} \caption{Another Caption} \end{figure} \closing{Best regards} \end{letter} \end{document}

esdd
  • 85,675
  • But is not scrartcl the outdated version of scrlttr2? – rugk Sep 05 '20 at 12:44
  • No, scrartcl is the article class in the KOMA-Script bundle. If you load package scrletter you can write a letter with this class (or scrreprt and scrbook), too. – esdd Sep 05 '20 at 14:41