latex_子图标题带括号

在 LaTeX 中插入多张图片作为子图时,通常使用 subcaption 包。默认情况下,子图标题带有括号,但在引用时括号会消失。要解决这个问题,可以修改子图的引用格式,添加命令` enewcommand{ hesubfigure}{(alph{subfigure})}`以在引用时显示括号。同时,为了避免重复的括号,需要使用`captionsetup[subfigure]{labelformat=parens}`。完整示例代码可以实现带括号的子图标题和引用。
摘要由CSDN通过智能技术生成

Latex中,插入多张图片,作为一张图片的子图时,需要添加{subsection}包,即

\usepackage{subcaption}

不过,这样的子图时带括号,而引用子图时,不带括号。

示例:

\usepackage{subcaption}

\begin{document}

Reference the sub-figure in full form: \ref{sf1}.
Referencing just the sub-figure parts: \subref{sf1} and \subref{sf2}.

\begin{figure}
  \begin{subfigure}{.48\textwidth}
    \centering
    Contents of the sub-figure
    %\includegraphics[width=5cm]{cherry_blossom}
    \caption{Subfig 1}
    \label{sf1}
  \end{subfigure}
  \begin{subfigure}{.48\textwidth}
    \centering
    Contents of the sub-figure
    %\includegraphics[width=5cm]{cherry_blossom}
    \caption{Subfig 2}
    \label{sf2}
  \end{subfigure}
  \caption{A figure}
  \label{fig}
\end{figure}

\end{document}

示例结果:

评论 8
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值