我在 lyx 中居中图像时遇到了一些问题,并且读过数字 的 问题关于主题。但是,当尝试应用答案中的解决方案时,图像仍然没有居中。lyx 中的代码是:
\begin{figure}
\includegraphics[scale=0.4]{Figure5_RPC_Problem_1}\caption{Wider than figure text. Wider than figure text.}
\end{figure}
我尝试使用居中命令:
\centering\includegraphics{...}
当图形小于文本宽度时\centerline{\includegraphics{...}}
当图形宽度大于文本宽度时
\begin{figure}
\centering\includegraphics[scale=0.4]{Figure5_RPC_Problem_1}\caption{Wider than figure text. Wider than figure text. Wider than figure text.Wider than figure text.Wider than figure text.}
\end{figure}
和
\begin{figure}
\centerline{\includegraphics[scale=0.4]{Figure5_RPC_Problem_1}\caption{Wider than figure text. Wider than figure text.Wider than figure text.Wider than figure text.Wider than figure text.}}
\end{figure}
但输出仍然相同。接下来我尝试使用中心但图像仍然没有居中
\begin{center}
\begin{figure}
\centerline{\includegraphics[scale=0.4]{Figure5_RPC_Problem_1}\caption{Wider than figure text. Wider than figure text.Wider than figure text.Wider than figure text.Wider than figure text.}}
\end{figure}
\end{center}
文档现在如下所示:
可以找到图片链接这里。
编辑:
我已将代码修改为:
\begin{figure}
\centering\includegraphics[scale=0.4]{Figure5_RPC_Problem_1}\caption{Wider than figure text. Wider than figure text.Wider than figure text.Wider than figure text.Wider than figure text.Wider than figure text.Wider than figure text.Wider than figure text.Wider than figure text.Wider than figure text.Wider than figure text.Wider than figure text.Wider than figure text.}
\end{figure}
但图像仍然稍微偏右。
答案1
裁剪图像后,我使用了以下乳胶代码:
\begin{figure}
\centering\includegraphics[scale=0.4]{Figure5_RPC_Problem_1}\caption{Wider than figure text. Wider than figure text.Wider than figure text.Wider than figure text.Wider than figure text.Wider than figure text.Wider than figure text.Wider than figure text.Wider than figure text.Wider than figure text.Wider than figure text.Wider than figure text.Wider than figure text.}
\end{figure}
在 lyx 中,graphicx
软件包必须包含在序言中:
转到文档→ 设置→序言并添加
\usepackage{graphicx}