Graphics, Figures & Tablesdvi2pdf and ps2pdf problem

Information and discussion about graphics, figures & tables in LaTeX documents.
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

dvi2pdf and ps2pdf problem

Post by Johannes_B »

I extended your code to make it compilable:

Code: Select all

\documentclass{article}
\usepackage{graphicx}
\begin{document}
\newpage
\setcounter{figure}{4}
\begin{figure}[t!]
	\centering
     % Use the relevant command to insert your figure file.
     % For example, with the graphicx package use
	\includegraphics[trim=0.2cm 1.4cm 0.2cm 1.4cm, clip=true,
	height=0.48\textwidth, angle=270]{Fig5.eps}
     % figure caption is below the figure
	\caption{(\textbf{a}) Amplitude of the climatological seasonal cycle of the observational mean surface zonal wind stress, $\tau_x$; (\textbf{b}) and (\textbf{c}) observational and simulated climatological seasonal cycles of $\tau_x$, averaged over two regions of the same size in the West Pacific warm pool (PWP: 125$\mathrm{^o}$E-185$\mathrm{^o}$E, 5$\mathrm{^o}$N-15$\mathrm{^o}$N) and in the East equatorial Pacific (NINO3: 210$\mathrm{^o}$E-270$\mathrm{^o}$E, 5$\mathrm{^o}$S-5$\mathrm{^o}$N), respectively.}
	\label{fig:TAUX_seasonality}       % Give a unique label
\end{figure}
\clearpage
\end{document}
Running the code above (either with XeLaTeX or converting using dvips and ps2pdf), i get the following result.
caraboo.png
caraboo.png (110 KiB) Viewed 2825 times
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

caraboo2001
Posts: 7
Joined: Wed Dec 10, 2014 8:54 pm

Re: dvi2pdf and ps2pdf problem

Post by caraboo2001 »

Johannes_B, thank you for the suggestion but I had already tried dvips+ps2pdf and, sadly, it produced the same result as dvi->pdf

For the try you made, please see my earlier post of a minimal working example (and just comment out \rule{4in}{3in} and uncomment \includegraphics[trim=0.2cm 1.4cm 0.2cm 1.4cm, clip=true, height=0.48\textwidth, angle=270]{Fig5.eps}). For my current purposes, I have to use the agutex document class, which is where things start to break down... I did not encounter this problem with other document classes up to now.
Last edited by caraboo2001 on Thu Dec 11, 2014 6:02 pm, edited 1 time in total.
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Re: dvi2pdf and ps2pdf problem

Post by Johannes_B »

What do you get compiling the above example? Is the picture ok as shown in my example? What is wrong?
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
caraboo2001
Posts: 7
Joined: Wed Dec 10, 2014 8:54 pm

Re: dvi2pdf and ps2pdf problem

Post by caraboo2001 »

With documentclass{article} all is well. The problem occurs when I switch to document class agutex.
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

dvi2pdf and ps2pdf problem

Post by Johannes_B »

You mentioned that earlier, sorry.

Code: Select all

    \documentclass[draft,jgrga,a4paper]{agutex} %document class for Journal of Geophysical Research articles
    \usepackage{lineno}
    \linenumbers*[1]
    \usepackage{amssymb}
    \usepackage{amsmath}
    \usepackage{multirow}
    \usepackage{url}
%    \usepackage{widetext}
    \usepackage[dvips]{graphicx}
    \usepackage{graphicx}
    \usepackage{rotating}
    \usepackage{geometry}

    \setkeys{Gin}{draft=false} %required for draft format in this document class

    %% ------------------------------------------------------------------------ %%
    %
    %  ENTER PREAMBLE
    %
    %% ------------------------------------------------------------------------ %%

    % Author names in capital letters:
    \authorrunninghead{CARABOO2001 ET AL.}

    % Shorter version of title entered in capital letters:
    \titlerunninghead{A BRILLIANT TITLE}

    %Corresponding author mailing address and e-mail address:
    \authoraddr{Corresponding author: caraboo2001,
    Somewhere in the Milky Way.
    }

    \begin{document}
    \title{The brilliant title, but longer}

    \authors{caraboo2001\altaffilmark{1,2}}

    \altaffiltext{1}{Institute1}

    \altaffiltext{2}{Institute2}

    \begin{abstract}
    Abstract...
    \end{abstract}

    \begin{article}
    \section{Introduction}
    \label{intro}

    ...



    \section{Data}
    \label{sec:data}

    ...


    \subsection{Methodology}
    \label{sec:methods}

    ...
    At some point I cite Figure ~\ref{fig:myfig}
    ...

    \end{article}


     \newpage
     \setcounter{figure}{4}
     \begin{figure}[t!]
     \centering
     % Use the relevant command to insert your figure file.
     % For example, with the graphicx package use
     \rule{4in}{3in}
       %\includegraphics[trim=0.2cm 1.4cm 0.2cm 1.4cm, clip=true, height=0.48\textwidth, angle=270]{Fig5.eps}
     % figure caption is below the figure
     \caption{Legend.}
     \label{fig:myfig}       % Give a unique label
     \end{figure}
     \clearpage

\newpage
\setcounter{figure}{4}
\begin{figure}[t!]
	\centering
     % Use the relevant command to insert your figure file.
     % For example, with the graphicx package use
	\includegraphics[trim=0.2cm 1.4cm 0.2cm 1.4cm, clip=true,
	height=0.48\textwidth, angle=270]{Fig5.eps}
     % figure caption is below the figure
	\caption{(\textbf{a}) Amplitude of the climatological seasonal cycle of the observational mean surface zonal wind stress, $\tau_x$; (\textbf{b}) and (\textbf{c}) observational and simulated climatological seasonal cycles of $\tau_x$, averaged over two regions of the same size in the West Pacific warm pool (PWP: 125$\mathrm{^o}$E-185$\mathrm{^o}$E, 5$\mathrm{^o}$N-15$\mathrm{^o}$N) and in the East equatorial Pacific (NINO3: 210$\mathrm{^o}$E-270$\mathrm{^o}$E, 5$\mathrm{^o}$S-5$\mathrm{^o}$N), respectively.}
	\label{fig:TAUX_seasonality}       % Give a unique label
\end{figure}
\clearpage
\end{document}
gives me the attached pdf after calling latex filename -> dvips filename.dvi -> ps2pdf filename.ps
Attachments
carabooCroppedFigure.pdf
(97.82 KiB) Downloaded 202 times
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
caraboo2001
Posts: 7
Joined: Wed Dec 10, 2014 8:54 pm

Re: dvi2pdf and ps2pdf problem

Post by caraboo2001 »

Including the a4paper option in the documentclass call and using dvips+dvi2pdf indeed works. Thank you!

Alternatively, it looks like re-generating my eps figure can also lead to a solution without any more changes in the document class/package calls.

Thank you all for contributing to find some solutions!
Post Reply