TeXnik - Tips TeX and LaTeX


Welcome to the TeXnik website (under construction)

Graphic
TUG logo

Main page

Index
UK FAQ
Documentation
Software
CTAN
Search CTAN:

Statistics

Google c.t.t.

Google d.c.t.t.

 


 


converting to another format | 
DeclareGraphicsExtensions |  DeclareGraphicsRule |  Double page float | 
EPS Images |  Extension | 
Full Page Graphic | 
gif-Images |  Graphic on chapter-page |  Graphics as empty rectangles |  Graphics config file |  Graphics over full Page |  Graphics side by side | 
Height/Width not greater than textwidth or textheight | 
jpeg-images | 
Max Width/Height not greater than textwidth or textheight |  Multiple graphics side by side | 
Rotating Images | 
wmf images |  Width/Height not greater than textwidth or textheight | 


Have a look at the float pages, too.
Docs:
Graphics in LaTeX2e
Using Imported Graphics in LaTeX2e
Rotating

DeclareGraphicsExtensions

When having the same graphic with different extensions in the same directory it may be useful to predefine what extension should be used depending to the running program. If we run for example vlatex nad pdlaftex, we can predefine what extension should be used:
\usepackage{graphicx}
\usepackage{ifvtex}
\ifvtex
   \DeclareGraphicsExtensions{.eps}
\else
   \DeclareGraphicsExtensions{.png}
\fi
and in the text we use \includegraphics without an extension
GIF-Images
To convert gif-Images by yourself use convert or
giftopnm file.gif | pnmtops -noturn -nocenter >file.eps
convert is really easy to use, but still not the best in every case. Search for special programs in the net.
Graphic over full Page
This is only possible with a pdf image and the package pdfpages, which is part of your local TeX installation or available at CTAN.
fullPage.png
The used image rose.eps or rose.pdf

wmf Images
If you use Windows and want to convert your wmf-Format into eps then have a loo at http://520060481190-0001.bei.t-online.de/WMF2EPS/index.htm


Placing multiple images
multiImage.png

wmf Images
If you use Windows and want to convert your wmf-Format into eps then have a loo at http://520060481190-0001.bei.t-online.de/WMF2EPS/index.htm


DeclareGraphicsRule
With this command the graphicx-package allows better controlling of the imported graphic files.
\DeclareGraphicsRule knows four arguments:
  1. File extension (ext)
  2. Type of file (type)
  3. File extension for size information (read)
  4. Command to execute on file name (command)
All four properties can also be set as key value pairs, example for file "file.NN":
\usepackage{graphicx}
\usepackage{ifpdf}
\ifpdf
  \includegraphics[%
    type=mps,ext=.NN,read=.NN,command=#1%
  ]{file}%
\else
  \includegraphics[%
    type=eps,ext=.NN,read=.NN,command=#1%
  ]{file}%
\fi
The key "command" can be omitted, because the default is already correct, but "type", "ext", and "read" are necessary. Also the file argument should be not have an extension.
Or if read does not expand to nothing, then the extension can be moved into the file argument:
\includegraphics[%
  type=mps,% or "eps"
  read=\relax,% or "\noexpand\empty"
  % ext={},command=#1,% the defaults are ok
]{file.NN}

Look also in floats/eps


converting to another format
Use the following Shell-Script when you want to convert a lot of files to another format.
It converts all files in the current directory with extension "wmf, png, jpg, jpeg, tif, tiff" to eps.
#!/bin/sh
# wmf->eps
echo "make_epses:"
for i in ${1}*.wmf ; do
  STEM=`basename $i wmf`
  echo "converting $STEM"wmf
  wmftoeps $i ${STEM}eps
done
# png,jpg, jpeg, tif, tiff -> eps
for j in png jpg jpeg tif tiff ; do
  for i in ${1}*.${j} ; do
    STEM=`basename $i $j`
    if [ -f $i ] ; then 
      echo "converting $STEM"$j
      convert $i ${STEM}eps
    fi
  done
done


jpeg images
Choose the program jpeg2ps for converting the jpeg files to ps-files. The info from ctan:

Purpose of jpeg2ps
==================
jpeg2ps converts JPEG files to PostScript Level 2 or 3 EPS. In fact, jpeg2ps is not really a converter but a "wrapper": it reads the image parameters (width, height, number of color components) in a JPEG file, writes the according EPS header and then copies the compressed JPEG data to the output file. Decompression is done by the PostScript interpreter (only PostScript Level 2 and 3 interpreters support JPEG compression and decompression). If you have a slow communication channel and a fast printer, sending compressed image data is a big win.


Double page float
The image is always on the left side and the caption on the right side.
fullPage.png
The used image rose.eps or rose.pdf

local time: Wed Oct 16 21:39:20 CEST 2019 ; file is: 109.495428240741 days old
contact webmaster _at_ TeXnik.de