LyX ⇒ Scaling of images in output PDF
Scaling of images in output PDF
I'm currently using Lyx 2.0.0 RC1 on Ubuntu, but I've experienced the same problem with Lyx 1.6.9 on Windows.
SOLVED: I suggest you simply read through the whole thread for a solution if you're having the same issues as me. Many thanks to meho_r and localghost for the help, much appreciated.
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
Re: Scaling of images in output PDF
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Scaling of images in output PDF
You have to take the relation between postscript point and pixel into account (1.333… or 0.75, respectively) [1]. So try to scale the concerned picture(s) to three quarters of the original size while including. In LaTeX this would be done by the graphicx package.jdefoe wrote:When using PNG-files in my lyx document, they get scaled (up) in the exported pdf. […]
Code: Select all
\includegraphics[scale=0.75]{‹filename›}
Best regards and welcome to the board
Thorsten
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Scaling of images in output PDF
Another thing I notice is that it takes up to several minutes to create the PDF-file with pdflatex with the 1.6.9 version on Windows, compared to my current Ubuntu desktop where it only takes a couple of seconds.
Edit: Sorry, I was composing this post so I didn't notice the last answer there. I'll try that right away!
Edit2: Thank you very much for pointing out the relation between postscript point and pixel Thorsten, and for the welcome.
This is exactly my problem indeed. I can't seem to get the scale function to work though, as I get this output:
Code: Select all
LaTeX Error: Missing \begin{document}.
\includegraphics[scale=0.75]{skisse01.png}
You're in trouble here. Try typing <return> to proceed.
If that doesn't work, type X <return> to quit.
Edit3: It hits me that when using PNG-files some sort of scaling probably is inevitable. So my next question would be, is there a format more appropriate for figures? I'm thinking the best solution would be some sort of scaleable (vector) format?
- Attachments
-
- example.zip
- The example files as requested.
- (4.32 KiB) Downloaded 213 times
Re: Scaling of images in output PDF
Suggestions:
1. Always prepare the image in an image editor before using it in your document
2. At least 300 dpi resolution is required for images which should be printed
3. Use vector graphics whenever you can instead of bitmap graphics. This image you attached would look much better if you exported it as an SVG or PDF file instead of PNG.
- Attachments
-
- example-1.zip
- An example file. LyX 2.0.0rc2 or greater needed.
- (8.02 KiB) Downloaded 219 times
Re: Scaling of images in output PDF
I'm really thankful for your suggestions by the way, and I will most certainly stick with those formats where possible. Also thank you for taking the time to supply an example.
- Attachments
-
- How the output PDF-file looks like.
- Screenshot-1.png (18.22 KiB) Viewed 13554 times
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Scaling of images in output PDF
TeX (the back-end) is not interested to do anything with image files but to just include them. The seeming scale is just a result of the relation I mentioned in my last reply. The DPI value influences only the printed output but does not really affect the appearance in the electronic document.jdefoe wrote:[…] Lyx (or its back end) must be doing some kind of scaling with my low resolution PNG-image, as it should turn out really small in the final PDF-file, instead it turns out really big (see picture attached for example). […]
The best way to check that is to include a small screen capture into a document and try to let it appear in the document as it appears on the screen.
But as already mentioned, it can't do any harm to have a plan for including image files into a LaTeX document. Some pre-processing might be necessary to get the desired result.
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: Scaling of images in output PDF
Seems as if my problem has been solved, so I'll do the necessary changes to the thread. Thanks a lot!
Re: Scaling of images in output PDF
On an image inserted in Lyx, double click, and you should be presented with scaling and clipping options. If they are there and don't work, report it as a bug.