Generaljpeg and tif figures in Latex2e

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
The_Watcher
Posts: 5
Joined: Mon Jul 09, 2007 8:01 pm

jpeg and tif figures in Latex2e

Post by The_Watcher »

Hello,

I am preparing a presentation and I have some jpeg and tif images that I want to put into it. I have written it in Latex2e, and I have *.eps (encapsulated postscript) figures which I can put it no problem; it is the *.jpg and *.tif which I have no idea about.

For the record here is how I input my *.eps figures:


\input{epsf}
\begin{figure}[h]
\begin{center}
\epsfxsize=10cm
\epsffile{Fig-1.eps}
\mbox{\bf Figure 1}\\
\mbox{First line} \\
\mbox{Second line \\
\mbox{ }
\end{center}
\end{figure}

Please advise -- need solution quickly.

Thanks.

The_Watcher
The Watcher
London

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

countbela666
Posts: 64
Joined: Thu Apr 26, 2007 2:44 pm

jpeg and tif figures in Latex2e

Post by countbela666 »

Hi,

as you can read for example in this thread you cannot simply use EPS and JPG graphics in parallel and you cannot use TIF graphics with LaTeX at all.

A solution would be:
  1. convert your TIF images to JPG
  2. convert your EPS graphics to PDF or use the epstopdf package
  3. compile your document via pdfLaTeX (not via plain LaTeX, as you seem to be used to)
And another one: please don't use packages like epsf, epsfig and so on which are obsolete for decades, but include all your graphics regardless of which type by using the \includegraphics command of the graphicx package. Moreover it's not a good idea to use the center environment inside a figure environment as the former inserts additional vertical space whereas the \centering switch does not.

Regards
Marcel
Listen to me children of the night, beyond the doors of darkness you will find
a thousand worlds for you to see here, take my hand and follow me...
The_Watcher
Posts: 5
Joined: Mon Jul 09, 2007 8:01 pm

jpeg and tif figures in Latex2e

Post by The_Watcher »

countbela666 wrote: Hi,

as you can read for example in this thread you cannot simply use EPS and JPG graphics in parallel and you cannot use TIF graphics with LaTeX at all.

A solution would be:
  1. convert your TIF images to JPG
  2. convert your EPS graphics to PDF or use the epstopdf package
  3. compile your document via pdfLaTeX (not via plain LaTeX, as you seem to be used to)
And another one: please don't use packages like epsf, epsfig and so on which are obsolete for decades, but include all your graphics regardless of which type by using the \includegraphics command of the graphicx package. Moreover it's not a good idea to use the center environment inside a figure environment as the former inserts additional vertical space whereas the \centering switch does not.

Regards
Marcel

:mrgreen:

Thanks Marcel, that is great.

I just need to know how to specify the size of the figure? At the moment, my pdf figure is below the footer level; the jpg file is better but I don't know how to control the size. In the old Latex version, it was easy with:

\epsfxsize=10cm

Thank you.
Best regards
The Watcher
London
User avatar
pumpkinegan
Posts: 91
Joined: Thu May 03, 2007 10:29 pm

jpeg and tif figures in Latex2e

Post by pumpkinegan »

Specify the width by:

Code: Select all

%%--------------------
\begin{figure}[ht]
   \centering
   \includegraphics[width=10cm]{figurename}
   \caption{Description of figure.}
   \label{fig:figurelabel}
\end{figure}
%%--------------------
Other useful size specification would include [height=10cm] or [width=\textwidth] or [width=0.75\textwidth].

Patrick.
The_Watcher
Posts: 5
Joined: Mon Jul 09, 2007 8:01 pm

jpeg and tif figures in Latex2e

Post by The_Watcher »

pumpkinegan wrote: Specify the width by:

Code: Select all

%%--------------------
\begin{figure}[ht]
   \centering
   \includegraphics[width=10cm]{figurename}
   \caption{Description of figure.}
   \label{fig:figurelabel}
\end{figure}
%%--------------------
Other useful size specification would include [height=10cm] or [width=\textwidth] or [width=0.75\textwidth].

Patrick.


Thanks Patrick. I have got the hang of things now.

Just one more thing, how do I get multiple figures in. Say:
(1) 2 figures next to each other; (2) 4 figures in a 2X2 block, and (3) 6 figures on a page in a 2X3 block?

Thanks.
The Watcher
London
User avatar
countbela666
Posts: 64
Joined: Thu Apr 26, 2007 2:44 pm

jpeg and tif figures in Latex2e

Post by countbela666 »

The_Watcher wrote: Just one more thing, how do I get multiple figures in. Say:
(1) 2 figures next to each other; (2) 4 figures in a 2X2 block, and (3) 6 figures on a page in a 2X3 block?
Have a look at the subfig package:

Code: Select all

\documentclass[demo]{article}
\usepackage{graphicx,subfig}
\begin{document}
  \begin{figure}
    \centering
    \subfloat[Subtitle 1]{\includegraphics{foo}}\quad
    \subfloat[Subtitle 2]{\includegraphics{foo}}\\
    \subfloat[Subtitle 3]{\includegraphics{foo}}\quad
    \subfloat[Subtitle 4]{\includegraphics{foo}}\\
    \subfloat[Subtitle 5]{\includegraphics{foo}}\quad
    \subfloat[Subtitle 6]{\includegraphics{foo}}
    \caption{Title of whole figure}
  \end{figure}
\end{document}
Regards
Marcel
Listen to me children of the night, beyond the doors of darkness you will find
a thousand worlds for you to see here, take my hand and follow me...
Post Reply