以下是我使用的格式,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}