我在 Windows 7 上使用 MiKTeK 2.9。
我正在尝试使用以下代码从一组 eps 文件中提取单个图形
\documentclass{article} % Specifies the document class
\usepackage{geometry}
\usepackage{setspace}
\usepackage[dvips]{graphicx}
\usepackage{afterpage}
\usepackage{amssymb}
\usepackage{sistyle}
\usepackage{rotate}
\SIstyle{USA}
\newcommand{\ip}[2]{(#1, #2)}
% Defines \ip{arg1}{arg2} to mean
% (arg1, arg2).
\input{psfig}
\renewcommand\floatpagefraction{0.8}%
\setlength{\textwidth}{7.0in}
\setlength{\oddsidemargin}{-.25in}
\setlength{\evensidemargin}{-.25in}
\setlength{\topmargin}{-0.25in}
\setlength{\textheight}{9.0in}
\parskip 6pt
\begin{document}
\begin{figure}[p]
\centerline{\psfig{figure=c:/Users/Peter/Clustering/OriginalObjects2.eps,width=2.5in}
\psfig{figure=c:/Users/Peter/Clustering/Samples/OriginalGravFieldHist.eps,
width=2.5in,angle=-90}}
\vspace{0.1in}
\centerline{(a) \hspace{3.5in} (b)}
\vspace{0.2in}
\centerline{\psfig{figure=c:/Users/Peter/Clustering/Samples/OriginalGravFieldHistDiff.eps,width=2.5in}
\psfig{figure=c:/Users/Peter/Clustering/OriginalObjectsFiltSquared.eps,width=2.5in}}
\vspace{0.1in}
\centerline{(c) \hspace{3.5in} (d)}
\vspace{0.2in}
\centerline{\psfig{figure=c:/Users/Peter/Clustering/OriginalObjectsFiltCubed.eps,width=2.5in}}
\vspace{0.1in}
\centerline{(e)}
\caption{whatever}
\label{whatever}
\end{figure}
\end{document}
“angle=-90” 应该会旋转第二个 .eps 文件 (c:/Users/Peter/Clustering/Samples/OriginalGravFieldHist.eps),而不会平移它或影响其他 .eps 文件的位置或外观。相反,它会向下平移该图形而不旋转它,并将第一个图形 (c:/Users/Peter/Clustering/OriginalObjects2.eps) 推到左侧。
答案1
提供的自解法不会产生 -90 度旋转。事实上,\includegraphics
给出的结果与角度为 -90 时描述的结果相同psfig.tex
。我找不到任何psfig.tex
;我不确定是否存在同名的官方版本(我回头查看了 TeXLive 2000)。
但psfig.sty
对我来说是有效的。它明确地将图形向上移动,因此其最低点位于基线上。如果您真的想旋转 -90,您必须指定一个旋转中心将其定位在您想要的位置,或者自己移动它。以下是一种旋转和移动的方法(仅限垂直):
\documentclass{article}
\usepackage{graphicx}
\begin{document}
Rotate -90:
\vbox{\hbox{\includegraphics[width=2.5in,angle=-90]{example-image-a}}\kern0pt}
\bigskip\bigskip
Rotate 90: \includegraphics[width=2.5in,angle=90]{example-image-a}
\end{document}
结果如下:
答案2
好的。我找到解决办法了。
\documentclass{article} % Specifies the document class
\usepackage{geometry}
\usepackage{setspace}
\usepackage[dvips]{graphicx}
\usepackage{afterpage}
\usepackage{amssymb}
\usepackage{sistyle}
\usepackage{rotate}
\newcommand{\ip}[2]{(#1, #2)}
% Defines \ip{arg1}{arg2} to mean
% (arg1, arg2).
\input{psfig}
\renewcommand\floatpagefraction{0.8}%
\setlength{\textwidth}{7.0in}
\setlength{\oddsidemargin}{-.25in}
\setlength{\evensidemargin}{-.25in}
\setlength{\topmargin}{-0.25in}
\setlength{\textheight}{9.0in}
\parskip 6pt
\begin{document}
\begin{figure}[p]
\centerline{
\includegraphics[width=2.5in]{c:/Users/Peter/Clustering/OriginalObjects2.eps}
\includegraphics[angle=90,width=2.5in]{c:/Users/Peter/Clustering/Samples/OriginalGravFieldHist.eps}}
\vspace{0.1in}
\centerline{(a) \hspace{3.5in} (b)}
\vspace{0.2in}
\centerline{\includegraphics[angle=90,width=2.5in]{c:/Users/Peter/Clustering/Samples/OriginalGravFieldHistDiff.eps}
\includegraphics[width=2.5in]{c:/Users/Peter/Clustering/OriginalObjectsFiltSquared.eps}}
\vspace{0.1in}
\centerline{(c) \hspace{3.5in} (d)}
\vspace{0.2in}
\centerline{\includegraphics[width=2.5in]{c:/Users/Peter/Clustering/OriginalObjectsFiltCubed.eps}}
\vspace{0.1in}
\centerline{(e)}
\caption{whatever}
\label{whatever}
\end{figure}
\end{document}
看来我支持includegraphics但不支持psfig。