我有一个用于渲染下图的文本,其中图形标题包含以下文本不是水平填充页面。
\begin{figure}
\centering
\includegraphics[scale=0.30]{image} \\
\flushleft \noindent {\bf Figure 1}: ver very veryverylongword short word short word ververyveryverylongword ververyveryverylongword short word short wordververyveryverylongword short word short wordververyveryverylongword short word short wordververyveryverylongwordwordververyveryverylongword short word short wordververyveryverylongword short word short wordververyveryverylongword short word short word
\end{figure}
输出结果如下:
我的问题:如何让文本水平填充空间?我不喜欢右侧的文本没有填满整个侧面。(最好的情况是最后一行不填满,但所有其他前面的行都水平填充)
我故意避免使用 \caption{} 来给这个图形添加标题(这样做的原因是我不想让我的图形在目录中编号,出于某种原因,这是我能让它工作的唯一方法)
答案1
我不确定我是否理解了你的问题。你为什么不使用\caption
指令来写标题?像这样:
\documentclass{article}
\usepackage[font=small, labelfont=bf]{caption}
\usepackage{graphicx}
\begin{document}
\begin{figure}
\centering
\includegraphics[scale=0.30]{example-image-duck} \\
\caption{Very very veryverylongword short word short word ververyveryverylongword ververyveryverylongword short word short wordververyveryverylongword short word short wordververyveryverylongword short word short wordververyveryverylongwordwordververyveryverylongword short word short wordververyveryverylongword short word short wordververyveryverylongword short word short word}
\end{figure}
\end{document}
这就是你所追求的吗?