你好,我用不同的线条画了一些图,但是它在图中占据了很多位置,所以我尝试在图形标题内画一条 tikz 线,但是它在图形标题内不起作用,
\documentclass[12pt,a4paper]{book}
\usepackage[latin1]{inputenc}
\usepackage[francais]{babel}
\usepackage{tikz}
\begin{document}
line \tikz\draw [thick] (0,0.5) -- (0.5,0.5) ;
\begin{figure}[!ht]
\includegraphics{image}
\caption{Inside caption .\tikz\draw [thick] (0,0.5) -- (0.5,0.5) ; }
\end{figure}
\end{document}
答案1
一个选择就是只描述这条线,例如粗黑线显示……。解决此问题的方法是使用可选参数\caption
,该参数包含放置在图形列表中的“简短标题”。即\caption[in list of figures]{in document under figure}
。
\documentclass[12pt,a4paper]{book}
\usepackage[latin1]{inputenc}
\usepackage[francais]{babel}
\usepackage{tikz}
\begin{document}
\listoffigures
line \tikz\draw [thick] (0,0.5) -- (0.5,0.5) ;
\begin{figure}[!ht]
\centering
\includegraphics[width=3cm]{example-image}
\caption[For list of figures]{Inside caption .\tikz\draw [thick] (0,0.5) -- (0.5,0.5) ; }
\end{figure}
\end{document}