![环绕图标题无缩进](https://linux22.com/image/275175/%E7%8E%AF%E7%BB%95%E5%9B%BE%E6%A0%87%E9%A2%98%E6%97%A0%E7%BC%A9%E8%BF%9B.png)
我想删除环绕图标题的缩进,但不想删除普通图标题的缩进。可以吗?
\documentclass{scrbook}
\usepackage[english]{babel}
\usepackage[T1]{fontenc}
\usepackage{wrapfig}
\usepackage{blindtext}
\begin{document}
\begin{figure}[tbp]
\fbox{\begin{minipage}[t]{\textwidth}A figure!\end{minipage}}
\caption{\blindtext}
\end{figure}%
\begin{wrapfigure}{l}{5cm}
\fbox{\begin{minipage}[t]{5cm}A figure!\end{minipage}}
\caption{For this caption I don't want an indention!}
\end{wrapfigure}
\blindtext
\end{document}
答案1
使用该caption
包和本地\captionsetup{format=plain}
命令:
\documentclass{scrbook}
\usepackage[english]{babel}
\usepackage[T1]{fontenc}
\usepackage{caption}
\usepackage{wrapfig}
\usepackage{blindtext}
\begin{document}
\begin{wrapfigure}{l}{5cm}
\fbox{\begin{minipage}[t]{4cm}A figure!\end{minipage}}
\captionsetup{format=plain}
\caption{For this caption I don't want an indention!}
\end{wrapfigure}
\blindtext
\begin{figure}[htbp]
\fbox{\begin{minipage}[t]{.9\textwidth}A figure!\end{minipage}}
\caption{\blindtext}
\end{figure}
\end{document}
使用标准方法可以实现自动化:
\usepackage{etoolbox}
\pretocmd{\wrapfloat}{\captionsetup{format=plain}}
就足够了。