Tag Info

Hot answers tagged

142

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{% ...


52

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 ...


44

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 ...


41

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

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 ...


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 ...


19

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 ...


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 ...


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: ...


15

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 ...


14

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 ...


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" ...


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.


12

The newest libpng update (1.6.2 I believe?) has stricter rules about iCCP and will print this warning every time it finds a png that is broken. This warning can be ignored. Fixes would include: Downgrade to a older version of libpng Install imagemagick and convert all .png files with convert -strip (script below) Maybe even just disable this warning? In ...


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} ...


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

I do the exact thing all the time, and it always looks good. Perhaps it is the pdf viewer that renders it badly? (I use xpdf mostly.) Maybe you can post screenshots of the image, and how it looks in the pdf document?


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). ...


8

Install inkscape2tikz. The following example is taken from inkscape2tikz home page. Using inkscape2tikz we export this in to tikz code: \documentclass{article} \usepackage{tikz} \usepackage{charter} %%%% Added for demo of fonts \usepackage[active,tightpage]{preview} \PreviewEnvironment{tikzpicture} \begin{document} ...


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

TeX is not interested in graphics it needs only a bounding box, the rest is done by an import filter driver and there is none for LaTeX that supports other formats than ps, eps, mp and some bitmap formats ...


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 ...


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

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).


7

A TeX compiler is not an image processing program. The image is just included in total. Trimming/clipping is applied via PDF (PostScript) operators without changing the image. Load the image into an image processing program (gimp or many other), remove the unwanted parts there. Depending on the image, it could also be downscaled or exported in a different ...


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} ...


7

Plotting heatmaps with gnuplot and LaTeX with small file size Basically, there are two different ways to draw heatmaps with gnuplot: Plotting with image Plotting with pm3d and splot Both have their advantages and disadvantages, and which one should use also depends on the actual data structure. The following terminals allow typesetting text with LaTeX ...



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