我有一个关于图表列表中间距的问题。我的论文附录中有一些图表;当我设置以下代码让它们在 Lot/Lof 中可见时,例如,附录的第一个图和章节的最后一个图之间没有间距。但是,当图来自不同的章节时,这种间距是存在的。这里有一个 MWE 来了解我的意思。我不知道这是否可行,我不擅长 Latex。如果有人有任何建议,请告诉我,谢谢!
\documentclass[11pt,twoside, openright, cleardoublepage=empty]{book}
\usepackage[font=small,format=hang,labelfont={sf,bf}]{caption}
\usepackage{graphicx}
\PassOptionsToPackage{hyphens}{url}
\usepackage{hyperref}
\begin{document}
\frontmatter
\tableofcontents\listoftables\listoffigures
\mainmatter
\chapter{First}
\section{one}
\section{two}
\section{three}
One image
\begin{figure}[ht]
\centering
\includegraphics[scale=0.25]{example-image-c}
\caption[Capital letter C]{This is capital letter C}
\label{fig:my_label}
\end{figure}
and a table:
\begin{table}[ht]
\centering
\begin{tabular}{|c|c|}
\hline
1 & 2 \\
\hline
\end{tabular}
\caption[1 and 2 data table]{This is a table with 1 and 2}
\label{Table}
\end{table}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\chapter{Second}
Another image
\begin{figure}[ht]
\centering
\includegraphics[scale=0.25]{example-image-golden}
\caption[Golden]{This is golden image}
\label{fig:my_label}
\end{figure}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\chapter*{Appendix}
\renewcommand\thefigure{A.\arabic{figure}}
\setcounter{figure}{0}
\renewcommand\thetable{T.\arabic{table}}
\setcounter{table}{0}
Another image
\begin{figure}[ht]
\centering
\includegraphics[scale=0.25]{example-image-b}
\caption[Capital letter B]{This is capital letter B}
\label{fig:my_label}
\end{figure}
and another table:
\begin{table}[ht]
\centering
\begin{tabular}{|c|c|}
\hline
3 & 4 \\
\hline
\end{tabular}
\caption[3 and 4 data table]{This is a table with 3 and 4}
\label{Table}
\end{table}
\end{document}
答案1
\appendix
最简单的解决方案可能是在章节前添加附录,并为章节编号。之后,可以使用包\titleformat
中的命令titlesec
格式化附录章节标题,使其看起来就像未编号一样。
\documentclass[11pt,twoside, openright, cleardoublepage=empty]{book}
\usepackage[font=small,format=hang,labelfont={sf,bf}]{caption}
\usepackage{graphicx}
\PassOptionsToPackage{hyphens}{url}
\usepackage{titlesec}
\usepackage{hyperref}
\begin{document}
\frontmatter
\tableofcontents\listoftables\listoffigures
\mainmatter
\chapter{First}
\section{one}
\section{two}
\section{three}
One image
\begin{figure}[ht]
\centering
\includegraphics[scale=0.25]{example-image-c}
\caption[Capital letter C]{This is capital letter C}
\label{fig:my_label}
\end{figure}
and a table:
\begin{table}[ht]
\centering
\begin{tabular}{|c|c|}
\hline
1 & 2 \\
\hline
\end{tabular}
\caption[1 and 2 data table]{This is a table with 1 and 2}
\label{Table}
\end{table}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\chapter{Second}
Another image
\begin{figure}[ht]
\centering
\includegraphics[scale=0.25]{example-image-golden}
\caption[Golden]{This is golden image}
\label{fig:my_label}
\end{figure}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\appendix
\titleformat{\chapter}[display]
{\normalfont\huge\bfseries}{}{-\baselineskip}{\Huge}
\chapter{Appendix}
\renewcommand\thetable{T.\arabic{table}}
Another image
\begin{figure}[ht]
\centering
\includegraphics[scale=0.25]{example-image-b}
\caption[Capital letter B]{This is capital letter B}
\label{fig:my_label}
\end{figure}
and another table:
\begin{table}[ht]
\centering
\begin{tabular}{|c|c|}
\hline
3 & 4 \\
\hline
\end{tabular}
\caption[3 and 4 data table]{This is a table with 3 and 4}
\label{Table}
\end{table}
\end{document}