Ceci est une ancienne révision du document !


Comment insérer des images avec “pdfLaTeX”?

Le programme pdfTeX lui-même dispose d'une gamme assez large de formats qu'il peut incorporer directement dans son flux PDF de sortie :

  • JPEG (fichiers jpg) pour les photographies et images similaires ;
  • PNG pour les images bitmap artificielles ;
  • PDF pour les dessins vectoriels.

Les anciennes versions de pdfTeX (antérieures à la version 1.10a) prenaient en charge le format TIFF (fichiers tif) comme alternative aux fichiers PNG. Mieux vaut ne pas compter sur cette fonctionnalité, même si vous utilisez une version suffisamment ancienne de pdfTeX.

FIXME Traduire.

In addition to the “native” formats, the standard pdfLaTeX graphics package setup causes Hans Hagen's supp-pdf macros to be loaded: these macros are capable of translating the output of MetaPost to PDF “on the fly”; thus MetaPost output (mps files) may also be included in pdfLaTeX documents.

The commonest problem users encounter, when switching from TeX, is that there is no straightforward way to include EPS files : since pdfTeX is its own “driver”, and since it contains no means of converting PostScript to PDF, there's no direct way the job can be done.

The simple solution is to convert the EPS to an appropriate PDF file. The epstopdf program will do this: it's available either as a Windows executable or as a Perl script to run on Unix and other similar systems. A LaTeX package, epstopdf, can be used to generate the requisite PDF files “on the fly”; this is convenient, but requires that you suppress one of TeX's security checks: don't allow its use in files from sources you don't entirely trust.

The package pst-pdf permits other things than “mere” graphics files in its argument. Pst-pdf operates (the authors suggest) “like BibTeX” — you process your file using pdfLaTeX, then use LaTeX, dvips and ps2pdf in succession, to produce a secondary file to input to your next pdfLaTeX run. (Scripts are provided to ease the production of the secondary file.)

A further extension is auto-pst-pdf, which generates PDF (essentially) transparently, by spawning a job to process output such as pst-pdf uses. If your pdfLaTeX installation doesn't automatically allow it — see spawning a process — then you need to start pdfLaTeX with :

pdflatex -shell-escape <file>

for complete “automation”.

An alternative solution is to use purifyeps, a Perl script which uses the good offices of pstoedit and of MetaPost to convert your Encapsulated PostScript to “Something that looks like the encapsulated PostScript that comes out of MetaPost”, and can therefore be included directly. Sadly, purifyeps doesn't work for all eps files.

Good coverage of the problem is to be found in Herbert Voß's PDF support page, which is targeted at the use of pstricks in pdfLaTeX, and also covers the pstricks-specific package pdftricks. A recent alternative (not covered in Herbert Voß's page) is pdftricks2, which offers similar facilities to pdftricks, but with some useful variations.


Source: Imported graphics in pdfLaTeX

3_composition/illustrations/inclure_une_image/inclure_un_fichier_pdf2.1638792562.txt.gz · Dernière modification : 2021/12/06 12:09 de yannick.tanguy
CC Attribution-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0