Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

通过labelformat增强subfigure/subtable的定制化能力 #993

Open
3 tasks done
Luffbee opened this issue Feb 11, 2025 · 0 comments
Open
3 tasks done

通过labelformat增强subfigure/subtable的定制化能力 #993

Luffbee opened this issue Feb 11, 2025 · 0 comments

Comments

@Luffbee
Copy link

Luffbee commented Feb 11, 2025

提交前检查

  • 我已经充分阅读了模板文档。
  • 我的问题并非关于模板的用法(否则请前往 discussions 提出)。
  • 我已经搜索了已有的 issues 和 discussion,确认没有重复提交。

系统

macOS 15.1 (24B2083)

TeX 发行版

TeX Live 2024

TeX 编译器

XeLaTeX

版本

7.5.0

学位类型

doctor

问题描述

有些学科可能需要自定义subfigure/subtable caption的labelformat,比如目前默认是(a), (b)这样,但化学中通常不加括号。
根据caption包的文档,一般情况可以使用 \DeclareCaptionLabelFormat 自定义格式(我的场景下按理应该是自定义成 \textbf{#2} 就好了,但结果还是带括号,查了下代码,发现问题是这里直接把括号加在序号里了:

thuthesis/thuthesis.dtx

Lines 3703 to 3704 in c183306

\renewcommand{\thesubfigure}{(\alph{subfigure})}
\renewcommand{\thesubtable}{(\alph{subtable})}

个人试了一下这subfigure把括号去掉,可以解决我的问题。
另外caption包文档也说了,使用\captionsetup{labelformat=parens},这个labelformat就会加上括号,所以目前带括号的格式也可以通过调整labelformat来实现,默认情况下符合要求,在特殊情况下也能更方便自定义格式。

复现代码

使用subfigure插入图片,在setup里面加上这个,就可以看到还带括号。

\DeclareCaptionLabelFormat{mymymy}
{%
      \textbf{#2}
}
\captionsetup[subfigure]{labelformat=mymymy}

编译日志


其他信息

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant