Tag Info

Hot answers tagged

141

The order of preference when files with the same name and different extensions is .png .pdf .jpg .mps .jpeg .jbig2 .jb2 .PNG .PDF .JPG .JPEG .JBIG2 .JB2 which is stored in the macro \Gin@extensions. So if you have both image.png and image.pdf, pdflatex will load the former. If you are mixing case in extensions, then \DeclareGraphicsExtensions{% ...


51

Formats that work with LaTeX (dvi mode, using dvips): eps Formats that work with LaTeX (dvi mode, using dvipdfm(x)): pdf png jpeg eps Formats that work with pdfLaTeX (pdf mode): pdf png jpeg jbig2 LuaTeX can also read jpeg 2000 TeX Live since 2010 will automatically convert eps files to pdf format. This can currently be done if you include ...


41

The DVI producing latex doesn't support reading the size of PNG, JPG or PDF images. You need to use pdflatex for this. Actually latex is pdflatex in DVI mode in modern distributions, but it can read the sizes only in PDF mode for some reason. You are however able to state the natural size of the images using natwidth and natheight which will make latex ...


40

Answering my own question after much research, experimentation, and testing. stevem's pointer to to the Mac OS X TeX Toolbox approach (store the TeX snippet in a box and write the height, width, and depth to a file) was the crucial key to the puzzle. I followed that approach, made some adjustments and additions, and came up with a solution that is not only ...


26

Nowadays everything is actually very simple. In essence, you only need to worry about three different file formats: PDF for vector graphics JPEG for photos PNG for other kinds of raster graphics. pdflatex supports all of these, and virtually any graphics file can be converted to one of these formats. And pdflatex not only supports these, but it does it ...


25

A pragmatic solution would be to just have two subdirectories with illustrations, pics and draftpics, where in draftpics you store the low-res png's. If you use a variable like: \def \picsdir {draftpics} You can refer to this variable when including them using includegraphics: \includegraphics[width=\textwidth]{\picsdir/spam} At the end you only need ...


19

Disclaimer: I'll try to write a technical explanation of what I found, but I'm not versed in those image witchcrafts. Please bear with me. :) This is just a partial answer. I have no idea of the impact of such formats when processed by pdfTeX. EDIT: See Patrick's answer. Just to make our lives easier, I'll name the images: The "normal" one: subject1.png ...


18

Hartmut Henkel states these conditions in a mail on the context mailing list: non-interlaced no palette no transparency no gamma coming with it no gamma modification requested no white adjustment in the PNG and a few more rare others. He also states: These are about the factors affecting the PNG to PDF size. For your big PNG graphic you may find a ...


17

You can use the standalone class which will produce a pdf with no border. If you want a small border you can add [border=<length>] class option. Notes: As LionelMANSUY mentioned in the comments it is usually preferable to use keepaspectratio, but if specific dimensions of both height and width are required, using `keepaspectratio may conflict with ...


16

Me personally, I make a poor copy of the .pdf graphics and use these, just when I'm finished I switch to the high-quality ones. I don't know whether there's an automated LaTeX gadget for that. My solution in bash (Unix systems) I have the full .pdf images stored in sub-directory full_images. Using the following script I convert them to preview quality: ...


14

This is not an answer to the question as asked, but I think it may be of use to those trying to work out which format to use and how to select it. If you are using the graphicx package and your intention is to be flexible (in that you want to be able to produce different output formats from the same source file) then there is a simple way to avoid having to ...


13

You can use the TikZ external library to automatically generate PNGs of your tikzpictures. The style \tikzset{ png export/.style={ external/system call={ pdflatex \tikzexternalcheckshellescape -halt-on-error -interaction=batchmode -jobname "\image" "\texsource"; convert -density 300 -transparent white "\image.pdf" ...


13

LaTeX graphics packages LaTeX and its graphics packages do not touch the image data. TeX does not even provide the reading of binary data. Thus LaTeX passes the image as file name reference to the driver. Also most of the drivers are not image processing programs. They only move the image data in a form appropriate for the output format. For example, dvips ...


12

Age! None of these standards were around when TeX was developed. As a matter of fact there were only dot matrix printers! As Knuth - wisely - in my opinion - decided to freeze the development of TeX and concentrate in making it better and bug free, these were added much later via the special command by packages such as graphicx.


9

Have a look at the ideas at The baseline problem corrected. They have been incorporated into mathTeX vertical alignment if you want to use mathTeX to create the images.


9

Media size (SRA3): 320mm x 450mm Image size: 5400px x 3850px Media or image needs to be rotated to prevent severe distortion of the image (keepaspectratio=false) or larger margins (keepaspectratio=true). Package geometry can be used to set the paper size and package pdfpages also works with images. If the image is rotated, then package pdflscape tells the ...


9

The DPI measure the displayed number of Dot Per Inch. If you increase the DPI, it is normal that your picture dimensions will decrease at the same scale. You do not need to change the DPI, you should insert your image like this: \includegraphics[width=Xcm]{file.png} to have a picture of a width equal to Xcm (height automatically adjusted, or height=Xcm). ...


9

Using ImageMagick: convert -density 300x300 simplenetwork02_stack.pdf -transparent white simplenetwork02_stack.png To have just the PSTricks graphic as output, add \usepackage[tightpage,active]{preview} \PreviewEnvironment{pspicture} to the preamble. You may want to adjust the pspicture size to get a tightly boxed graphic: \begin{pspicture}*(0,0)(6,7) ...


9

Here is a startpoint. You can continue writing... Code: \documentclass[10pt,landscape]{article} \usepackage{multicol} \usepackage{array} \newcolumntype{L}{>{\ttfamily\color{red!50}}l} \usepackage[landscape]{geometry} \geometry{paperwidth=508mm,paperheight=286mm,top=1cm,left=3cm,right=3cm,bottom=1cm} \usepackage{xcolor} \pagecolor{black} ...


8

You have to convert your DVI file to PS using dvips -I c <filename> instead of just dvips <filename> (http://www.win.tue.nl/latex/faq.html#q16). The -I switch is used to select image options, the c stands for color, grayscale would be g (http://docs.miktex.org/manual/dvips.html).


8

There is no package makemypdfsmaller.sty which reduces the PDF file size without removing information. However, there are a few things you can do: Reduce number of images Do you really need to include eighteen images? Maybe sixteen or twelve is enough. Reduce image size You can use imagemagick (or gimp or …) to reduce the image size. You have to ...


8

What Geoff said, additionally you can specify the height, or even both: \includegraphics[width=5cm,height=5cm]{chart} That being said, if you use only one of them graphicx (the package providing the \includegraphics macro) will take care of maintaining the proper aspect ratio.


8

In the LaTeX-step (from tex to dvi) LaTeX needs to know only the size of the image. As an eps is a simple text file, LaTeX can read the file and find the bounding box informations. With binary image formats this is not possible. But if you give the bounding box informations to LaTeX - either with the bb-key or with a .bb-file - LaTeX will happily process ...


7

This is not exactly an answer to the question you asked, but do you know that R/ggplot2 can write out your charts as pdf files that can be \includegraphicsed? Just use pdf() instead of png() when setting up the output device, or if you're using ggsave(), give the file a .pdf extension instead of png. Then you get real text and vector graphics, which pdfTeX ...


7

The graphics formats that you can use depend on the graphics driver not on (pdf)LaTeX: As others have said pdfLaTeX in pdf-mode can use pdf, png, jpg, and mps. LaTeX in dvi-mode and dvips as driver can use eps (and mps). LaTeX in dvi-mode and dvipdfmx as driver can use eps (and mps), pdf, png, and jpg if you provide information about the bounding box and ...


7

This question has received excellent answers to the general question relating to what graphics formats the two Tex engines, but the Metapost part has been neglected (Just to confuse matters, metapost produces .eps but I can use these with pdflatex as long as I put in a four line incantation), so I shall document what you can get from Metapost. Hobby's ...


7

The syntax for mk4ht is as given below: mk4ht command file option1 option2 option3 command could be htlatex or mzlatex or oolatex of any one of the scripts provided by tex4ht. option1 is passed on to tex4ht.sty (like html, xhtml, mathml ...) option2 is passed on to tex4ht.env and tex4ht binary, the post-processor of *.dvi output. option3 is those ...


7

you can use png or gif images also with the dvi route, but you have to define some graphic rules for the converting. The following needs latex <file> dvips -R0 <file> ps2pdf <file>.ps The program convert must be installed. It is part of the ImageMagick bundle \documentclass{article} \usepackage[dvips]{graphicx} ...


7

If you just want the image to go away in dvi/dvips mode then: \makeatletter \def\temp{dvips.def} \ifx\Gin@driver\temp \def\Ginclude@graphics#1{\def\temp{#1}---image \expandafter\strip@prefix\meaning\temp---} \fi \makeatother In your preamble will have that effect.


7

As a fan of both tikz and background, here's a version showing four different opacities: Code \documentclass[parskip]{scrartcl} \usepackage[margin=5mm,a6paper]{geometry} \usepackage[angle=0,scale=20,opacity=1,color=black]{background} \usepackage{lipsum} \backgroundsetup{% contents={% \begin{tikzpicture} ...



Only top voted, non community-wiki answers of a minimum length are eligible