首页>LaTeX>source

我使用 caption包   设置浮动的标题.我希望获得一个大标题的标题放置在边距,所以我需要更改标题标题及其标签的距离(默认为 \nobreakspace )。

--- --- EDIT

MwE是:

\documentclass{article}
\usepackage{caption,wrapfig,lipsum,marginnote}
\captionsetup[wrapfigure]{
labelsep=newline,
labelfont={bf},
position=top,
skip=0pt,
singlelinecheck=no}
\begin{document}
\lipsum[1]
\begin{wrapfigure}{r}[0pt]{4cm}\raggedleft
\marginnote{
\captionof{figure}
{Here is a caption text.}}
\fbox{\parbox{4cm}{aaa\\
bbb\\
ccc\\
ddd\\
eee\\
fff\\
ggg
}}
\end{wrapfigure}
\lipsum[1]
\end{document}

上面的代码显示:

但我想要的是:

也就是说,我想插入一个 \newline   在 Figure之后   在 1之前 .

最新回答
  • 2019-12-5
    1 #

    注意,我还修复了\ parbox的宽度,以便\ fbox适合边距。

    我原来的解决方案很简单优雅,而且错了.具体来说,\ thefigure也用在图表列表中.它需要一些搜索,但我相信\ fnum @ figure是正确的修改宏。

    \documentclass{article}
    \usepackage{caption,wrapfig,lipsum,marginnote}
    \makeatletter
    \renewcommand{\[email protected]}{\figurename\newline\centerline{\huge\thefigure}}
    \makeatother
    \captionsetup[wrapfigure]{
    labelsep=newline,
    labelfont={bf},
    position=top,
    skip=0pt,
    singlelinecheck=no}
    \begin{document}
    \lipsum[1]
    \begin{wrapfigure}{r}[0pt]{4cm}\raggedleft
    \marginnote{
    \captionof{figure}
    {Here is a caption text.}}
    \fbox{\parbox{\dimexpr 4cm-2\fboxsep-2\fboxrule}{aaa\\
    bbb\\
    ccc\\
    ddd\\
    eee\\
    fff\\
    ggg
    }}
    \end{wrapfigure}
    \lipsum[1]
    \end{document}
    

  • LaTeXmk输出的时间戳
  • LaTeX tex core:什么设置结转到发货页面?