![图片标题格式 = 挂起无法按我期望的方式工作](https://linux22.com/image/353342/%E5%9B%BE%E7%89%87%E6%A0%87%E9%A2%98%E6%A0%BC%E5%BC%8F%20%3D%20%E6%8C%82%E8%B5%B7%E6%97%A0%E6%B3%95%E6%8C%89%E6%88%91%E6%9C%9F%E6%9C%9B%E7%9A%84%E6%96%B9%E5%BC%8F%E5%B7%A5%E4%BD%9C.png)
以下是我使用的格式,KOMA-Script,出于某种原因,使用后\usepackage[format=hang]{caption}
第二行的图形标题从第一个大写字母向右移动。我想与第一个大写字母对齐。哪里出了问题?
\AtBeginDocument{%
\renewcommand{\ref}[1]{\mbox{\autoref{#1}}}
}
\def\refnamechanges{%
\renewcommand*{\equationautorefname}[1]{}%
\renewcommand{\sectionautorefname}{sec.\negthinspace}%
\renewcommand{\subsectionautorefname}{sec.\negthinspace}%
\renewcommand{\subsubsectionautorefname}{sec.\negthinspace}%
\renewcommand{\figureautorefname}{Fig.\negthinspace}%
\renewcommand{\tableautorefname}{Tab.\negthinspace}%
}
\@ifpackageloaded{babel}{\addto\extrasenglish{\refnamechanges}}{\refnamechanges}
\usepackage[figure]{hypcap}
\let\myTOC\tableofcontents
\renewcommand\tableofcontents{%
\frontmatter
\pdfbookmark[1]{\contentsname}{}
\myTOC
\mainmatter }
\setkomafont{captionlabel}{\bfseries}
\setcapindent{1em}
\usepackage[format=hang]{caption}
\usepackage{calc}
\usepackage{cite}
\renewcommand{\chaptermark}[1]{\markboth{#1}{#1}}
\renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}}
\renewcommand{\bottomfraction}{0.5}
\let\mySection\section\renewcommand{\section}{\suppressfloats[t]\mySection}
答案1
消除\setcapindent{1em}
:
\documentclass{scrartcl}
\setkomafont{captionlabel}{\bfseries}
%\setcapindent{1em}% <- remove this line
\usepackage[format=hang]{caption}
\usepackage{blindtext}% dummy text
\begin{document}
\begin{figure}[hbp]
\caption{\blindtext}
\end{figure}
\end{document}
注意:标题的悬挂样式是 KOMA-Script 类的默认设置。因此似乎不需要加载包caption
:
\documentclass{scrartcl}
\setkomafont{captionlabel}{\bfseries}
\usepackage{blindtext}% dummy text
\begin{document}
\begin{figure}
\caption{\blindtext}
\end{figure}
\end{document}