# Tag Info

17

When you take a screenshot or export a figure from Matlab as a rasterised image,usually the resulting image file will not contain any resolution information (or "pixel density", usually measured in "dots per inch", or "DPI") in its metadata. When you include such an image in a LaTeX document using \includegraphics, a resolution of 72 DPI will be assumed. ...

14

I've tried a little black magic with LaTeX, and found out how to do it without external scripts ─ though it still is somewhat dirty and not that easy to use. Basically, you would need to call ImageMagick from inside LaTeX. To do this, you need to call it with --shell-escape parameter. This allows for using a command named \write18, that executes a parameter ...

12

The samples axis setting lets you do this: \begin{tikzpicture} \begin{axis}[samples=15,xmin=0,xmax=360,ymin=-1, ymax=1] \addplot+[domain=0:360,mark=none] {sin( x )}; \end{axis} \end{tikzpicture} Looks blocky: Upping samples to samples=65 looks quite a bit smoother for this zoom level:

8

LaTeX does not have a dpi setting so your question is rather unclear. LaTeX itself doesn't handle images at all, In classic TeX it just puts a request to include an image into the dvi file and a separate program (eg dvips) selects an image. In pdftex the pdftex engine does handle both aspects but again it doesn't have any setting called dpi the nearest it ...

7

The parameter to set is \pdfpkresolution that TeX Live (and MiKTeX, I believe) sets to 600 (dpi). It can be set in the document by \pdfpkresolution=2400 There is also a token register \pdfpkmode that chooses the Metafont mode for creating the bitmaps, if non empty: \pdfpkmode={supre} The supre mode is found in modes.mf and is for a 2400 dpi printer ...

5

I think what you may be looking for is instead of using the scale option you should use the width option in \includegraphics. There are different widths you can use \textwidth or \linewidth are likely what you are looking for. \includegraphics[width=.5\textwidth]{...} will scale your graphic to be half of the text width. If your graphic is inside an ...

5

Yes, changing the resolution using the -density operator in ImageMagick (or through the Information window in IrfanView) is a lossless operation. From the ImageMagick documentation: The -density option sets an attribute and does not alter the underlying raster image.

5

In the log file are you getting a message saying that TeX cannot find the bounding box size of the .png file? If so then you will have to supply the bounding box dimensions by measuring them in some graphics editor and then use the following \includegraphics command: \includegraphics[bb=0 0 urx ury, width=40mm]{yourGraphicsFile.png} where urx, ury are the ...

5

Well, these fonts are not available as Type 1 fonts. This means that they are rendered as bitmaps with the current bitmap resolution. To increase the quality of the fonts, increase the resolution. For pdflatex this is explained in this answer: add to the preamble \pdfpkresolution=2400 \pdfpkmode={supre}

4

LaTeX neither knows the resolution nor the final size on the paper: \includegraphics prints the requested sizes in the .log file with driver pdftex.def: Package pdftex.def Info: foobar.png used on input line 5. (pdftex.def) Requested size: 67.0pt x 89.0pt. But \includegraphics can be put inside \scalebox or \resizebox, for example. Thus the ...

4

Sorry to use up space for yet another answer - just wanted to have the nice formatting :) Well, thanks to answers by @finrod and @Ken Bloom; and additionally How to execute shell script from LaTeX?; How can I save shell output to a variable in LaTeX? and Scale (resize) large images (graphics) that exceed page margins; I managed to cook up a "script" (well, ...

4

Multiple parents to single child is done manually by adding edges to the nodes. So you build your tree as usual, and assign (easy to remember) node names to each or only to those nodes you need. After the tree is done, inside the tikzpicture you can then draw the extra lines. This is possible both with Tikz-qtree and with Tikz trees. I made a random edge ...

3

Inkscape should export to a pure vector PDF file. There is no need to tweak the DPI value or using the --export-dpi option, since it only affects the rasterized output that you want to avoid. It can be problematic to convert from one vector format to another. That only works under two conditions: The target format supports all the features of the source ...

3

I do beamer presentations with lots of art. While I have not experimented to find minimum values, I get good results from anything 1024x768 pixels and up. This is flickr's "large" size. I mention flickr because it's a good resource for this kind of thing. Do an advanced search and check the box for Creative Commons-licensed photos. In case you want to ...

3

In my experience, most projectors have a resolution of 1024x768 px (XGA), and there are still plenty around that only have 800x600 px (SVGA). So if your images have 1024x768 px, you should be fine, and if the images are photos (no text and no sharp lines), scaling up from 800x600 px would probably also work (try looking at this 800x600 px image in ...

3

Try the degrade package, which performs the ImageMagick trick that others have written about.

3

To repeat my comment above for the sake of writing a reasonably coherent answer, the reason your publishers' software is complaining is that both fraction bars and horizontal rules are being rendered as a 1x1 black image stretched to the required size. This is caused by the dvips configuration you're using. If you keep the same workflow, but replace ...

3

D:/mikTeX/fonts/type1/public/amsfonts/cm/cmr 10.pfb><D:/mikTeX/fonts/type1/public/amsfonts/cm/cmssbx10.pfb><D:/mikTeX/fonts/ type1/public/amsfonts/cm/cmssi12.pfb><D:/mikTeX/fonts/type1/public/amsfonts/cm/ cmti12.pfb> So that file just uses pfb fonts (scalable type 1 postscript fonts in binary form) and doesn't include any bitmap ...

2

It seems I managed to find a solution by myself. I rolled back the change to tex4ht.env, so that math formulas rendered as image are safe now, and I added the following section to my above mentioned preamble myconfig.cfg: \Configure{graphics*} {eps} {\Needs{"convert -density 110x110 \csname Gin@base\endcsname.eps \csname Gin@base\endcsname.png"} ...

2

You may change resolution automatically using ImageMagick's convert -resample. Here is an awk script that parses the tex file, finds \includegraphics statements and then converts images embedded there to a required resolution: (/\\includegraphics/&&(/{.*\.png}/||/{.*\.jpg}/)){ if(match($0,"width=[0123456789\.]*in")==0){ print "%Cannot ... 2 Resolution and quality are the same. As for speed, if your figure changes often (and hence has to be recompiled frequently), the second approach does not provide much speed advantage. If it doesn't change, then the second approach is faster since the tikz code is compiled only once. Note that your "main" document doesn't require to use tikz, and this is ... 1 There are several approaches described in the linked answer. Route from eps to output formats is the default way tex4ht deals with generated images. You shouldn't get eps images as final format, it is always converted to something which can be displayed with a browser. another way is to use some dvi to image converter such as dvipng or dvisvgm. To avoid ... 1 forest is a powerful option for drawing trees of all kinds. Here is your original example in forest. Note that the curly brackets are added automatically as appropriate and that all nodes are typeset in maths mode so that$...\$ need not be used. \documentclass[tikz, border=10pt, multi]{standalone} \usepackage{amssymb,forest} \begin{document} \begin{forest} ...

1

dvips: dvips -D10000 -t unknown input.dvi ghostscript: gswin64c -r10000 -dCompatibilityLevel=1.5 -dAutoRotatePages=/None -sDEVICE=pdfwrite -o output.pdf input.ps

1

To sum up the comments: TeX doesn't have any concept of a 'document DPI' as it fundamentally does not make sense. DPI in print depend on the output device but that should only have an effect during the actual output. Thus if you want to fiddle with images you have to pre-process with a suitable third-party tool.

1

I've found one solution is to post-process the PDF, re-saving it in an application which will resize the images in the PDF to a maximum resolution. Adobe Acrobat Pro (not just Acrobat Reader) can do this via File / Save As / Optimized PDF. Have recently tested this on Mac OS X (and so assume it works on Windows too) with Acrobat Pro X. You can specify what ...

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