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

图片 caption 中使用 footnote 无法正确产生脚注 #267

Open
4 tasks done
NIL-zhuang opened this issue Jan 9, 2025 · 2 comments
Open
4 tasks done

图片 caption 中使用 footnote 无法正确产生脚注 #267

NIL-zhuang opened this issue Jan 9, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@NIL-zhuang
Copy link

先决条件

期望的现象

在图片右上角添加角标,在下方添加脚注

发生了什么

image

可以正常产生角标,但下方没有脚注,并且模板报错

Argument of \caption@ydblarg has an extra }.
Paragraph ended before \caption@ydblarg was complete.

最小工作示例

\documentclass[
    fontset = win, % |mac|macoffice|fandol|none,
  ]{njuthesis}

\input{njuthesis-setup.def}

\begin{document}

\maketitle
\raggedbottom
\begin{abstract}
  中文摘要
\end{abstract}
\begin{abstract*}
  English abstract
\end{abstract*}
\mainmatter

\chapter{引言}

\begin{figure}[htbp]
  \centering
  \includegraphics[width=0.7\textwidth]{2-3-transformer-mha.png}
  \caption{Transformer 模型的结构示意图\footnote{图源 Vaswani 等的论文}}
  \label{fig:transformer-arch}
\end{figure}

\printbibliography
\begin{acknowledgement}
  感谢 \href{https://git.nju.edu.cn/nju-lug/lug-introduction}{LUG@NJU}。
\end{acknowledgement}
\appendix
\chapter{正文中涉及的数据及源代码}
\dots
\end{document}

njuthesis 模板版本

v1.4.2

模板获取途径

https://tex.nju.edu.cn

操作系统

None

TeX 发行版

No response

编译程序

None

额外信息

尝试了本地 macos + mactex-no-gui (Tex Live 2024) + vscode + latexmk(xe) 的编译,和 njutex 的云端编译,都复现了这个问题

@NIL-zhuang NIL-zhuang added the bug Something isn't working label Jan 9, 2025
@NIL-zhuang
Copy link
Author

发现了一个迂回的解决方案,就是在 caption 中使用 \protect 命令

\caption{Transformer 模型的结构示意图\protect\footnote{图源 Vaswani 等的论文}}

@NIL-zhuang
Copy link
Author

发现了一个迂回的解决方案,就是在 caption 中使用 \protect 命令

\caption{Transformer 模型的结构示意图\protect\footnote{图源 Vaswani 等的论文}}

但是添加 protect 的方法并不能保证图像和 footnote 在同一页上,case 如下所示
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant