在 scrlttr2 中使用圖形和wrapfig

在 scrlttr2 中使用圖形和wrapfig

scrlttr2好像沒有定義數字?

包標題錯誤:未定義浮點類型“圖形”。

那我該如何解決這個問題呢?

在你爭論在字母中使用數字毫無意義之前:

  1. 是的,也許吧,但我想要它。
  2. 例如,在一封關於藝術的多頁信中,它可能實際上很有用。
  3. 據我所知,除了wrapfig(wrapfigure) 之外,我無法以任何其他方式將文字環繞圖像 - 這不取決於嗎figure?我可以在網路上找到的所有指南推薦wrapfig。否則我該如何環繞圖像?甚至 Word 也可以輕鬆做到這一點,而且它(也)是為創建字母而設計的。

範例程式碼(片段):

\documentclass[version=last]{scrlttr2}

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

答案1

如果您需要浮動數字和/或\caption命令,請使用 classscrartcl和 load package scrletter

例子:

\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}

相關內容