图目录文字太长,如何使用缩进?

发布于 2021-12-05 01:09:15

image.png

压缩包下载:zc.zip

需求:让图目录的第二、三行缩进,与第一行对齐。

MWE如下:

% !Mode:: "TeX:UTF-8"                                  %  采用UTF-8编码
%& -makeindex_opts='-C mixed -s ctex.ist'              %  索引按拼音排序
\documentclass[doctor,twoside,otf]{snnupaper}
\usepackage{mysnnu}
% \makeindex

\begin{document}

\midmatter
\tableofcontents
\listoffigures   %图目录
%\listoftables    %表目录

\mainmatter

%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%

\begin{figure}[h]
    \centering
    \includegraphics[width=0.4\linewidth]{cat.jpg}
    \caption{图注里有很多文字,图注里有很多文字,图注里有很多文字,图注里有很多文字,图注里有很多文字,图注里有很多文字,图注里有很多文字,}
\end{figure}

\begin{figure}[h]
    \centering
    \includegraphics[width=0.4\linewidth]{cat.jpg}
    \caption{图注里有很多文字,图注里有很多文字,图注里有很多文字,图注里有很多文字,图注里有很多文字,图注里有很多文字,图注里有很多文字,}
\end{figure}

\begin{figure}[h]
    \centering
    \includegraphics[width=0.4\linewidth]{cat.jpg}
    \caption{图注里有很多文字,图注里有很多文字,图注里有很多文字,图注里有很多文字,图注里有很多文字,图注里有很多文字,图注里有很多文字,}
\end{figure}

\begin{figure}[h]
    \centering
    \includegraphics[width=0.4\linewidth]{cat.jpg}
    \caption{图注里有很多文字,图注里有很多文字,图注里有很多文字,图注里有很多文字,图注里有很多文字,图注里有很多文字,图注里有很多文字,}
\end{figure}
%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%

\cleardoublepage
\backmatter
\phantomsection
\bibliographystyle{bstutf8}
\bibliography{ref/refs}
\appendix

\cleardoublepage \phantomsection
\printindex

\end{document}

查看更多

关注者
0
被浏览
1.8k
1210
1210 2021-12-05
道阻且长,行则将至,行而不辍,未来可期

算是定制需求了,可以使用titletoc宏包,所有可以简单写一下,放在导言区就好了,更多内容,建议自己去看宏包文档,实现方法很多!

\usepackage{titletoc}
\titlecontents{figure}[12mm]{\contentslabel[图~\thecontentslabel]{12mm}}{}{}{}

呐,这是实现的效果!
image.png

下次,建议规范下MWE,你发的那玩意,就跑不通,注意下!

2 个回答
LaTeXStudio
LaTeXStudio 2021-12-05
这家伙很懒,什么也没写!

tocloft 也是可以的,这样定义即可,原理同上:

\documentclass{article} 

\usepackage{tocloft}
\usepackage{graphicx}

\renewcommand{\cftfigpresnum}{\figurename~}
\addtolength{\cftfignumwidth}{30pt}

\begin{document}
%{
%    \let\oldnumberline\numberline
%    \renewcommand{\numberline}{\figurename~\oldnumberline}
%    \listoffigures
%}
\listoffigures

\clearpage

\begin{figure}
     \includegraphics{example-image-a}
     \caption{Blablabla bla blabla blablabla bla blabla blablabla bla blabla blablabla bla blabla blablabla bla blabla blablabla bla blabla}
\end{figure}

\end{document}

image.png

撰写答案

请登录后再发布答案,点击登录

发布
问题

分享
好友

手机
浏览

扫码手机浏览