我想要插入一个横向的图形,并使用以下(剪切)代码:
\documentclass[12pt, oneside]{book}
\usepackage{graphicx}
\usepackage{wrapfig}
\usepackage{lscape}
\usepackage{rotating}
\usepackage{epstopdf}
\begin{document}
\begin{figure}[ht]
\includegraphics{../figures/pics/DivLibPropProfile}
\caption{Property profile of the diverse library compared to the compound pool.}
\label{fig:PropProf}
\end{figure}
\end{document}
当我使用 pdfLaTeX 编译它时,输出的行为符合我的预期 – 页面以纵向显示,标题在底部,但图形的方向“错误”。
然而,当我使用 LaTeX 进行编译时,页面会变成横向,图形现在处于正确的方向,但标题现在位于页面的左侧而不是图形下方,您应该使用 来获得它\begin{landscape}
。
当我确实使用该landscape
环境并使用 LaTeX 编译标题时,整个页面都会颠倒过来,一切都是错误的。
任何想法,我怎样才能得到横向页面上的横向图形的正确方向,并在数字(附上以供参考)?我还需要使用 LaTeX 而不是 pdfLaTeX 来使另一个包正常运行。
答案1
这应该对你有用,无需删除“不必要的”包:
\documentclass[12pt, oneside]{book}
\usepackage{graphicx}
\usepackage{wrapfig}
\usepackage{lscape}
\usepackage{rotating}
\usepackage{epstopdf}
\begin{document}
\begin{sidewaysfigure}[ht]
\includegraphics{../figures/pics/DivLibPropProfile}
\caption{Property profile of the diverse library compared to the compound pool.}
\label{fig:PropProf}
\end{sidewaysfigure}
\end{document}
这是一个使用rotating
\documentclass{article}
% For rotating figures, tables, etc.
% including their captions
\usepackage{rotating}
\begin{document}
% A small example on how to use the "rotating" package.
% Displays a figure and it's caption in landscape
\begin{sidewaysfigure}[ht]
\includegraphics[width=\textwidth]{figure.png}
\caption{Caption in landscape to a figure in landscape.}
\label{fig:LandscapeFigure}
\end{sidewaysfigure}
\end{document}
答案2
您可以使用包angle=90
提供的选项graphicx
。
\documentclass[12pt, oneside]{book}
\usepackage[demo]{graphicx}%<----remove demo in your file
\usepackage{wrapfig}
\usepackage{lscape}
\usepackage{rotating}
\usepackage{epstopdf}
\begin{document}
\begin{figure}[ht]
\centering
\includegraphics[angle=90]{../figures/pics/DivLibPropProfile}%<---angle here
\caption{Property profile of the diverse library compared to the compound pool.}
\label{fig:PropProf}
\end{figure}
\begin{figure}[ht]
\centering
\includegraphics[angle=0]{../figures/pics/DivLibPropProfile}
\caption{Property profile of the diverse library compared to the compound pool - not rotated.}
\label{fig:PropProf}
\end{figure}
\end{document}
答案3
选项1
这样可以让你的标题保持在底部。除了旋转之外,我还需要缩放图像:scale=0.6
。
\documentclass{article}
\usepackage{graphicx}
\begin{document}
\begin{figure}[!htb]
\centering
\includegraphics[angle=-90, scale=0.6]{figure.png}
\caption{Caption in landscape to a figure in landscape.}
\label{fig:LandscapeFigure}
\end{figure}
\end{document}
选项 2
如果旋转的方向不符合你的预期,例如 侧身图形总是顺时针旋转
您可以尝试将figuresleft
选项添加到包中
\documentclass{article}
% For rotating figures, tables, etc.
% including their captions
\usepackage[figuresleft]{rotating}
\begin{document}
% A small example on how to use the "rotating" package.
% Displays a figure and it's caption in landscape
\begin{sidewaysfigure}[!htb]
\includegraphics[width=\textwidth,keepaspectratio]{figure.png}
\caption{Caption in landscape to a figure in landscape.}
\label{fig:LandscapeFigure}
\end{sidewaysfigure}
\end{document}