LyXScaling vector graphics in LyX

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
burgundi
Posts: 3
Joined: Wed Sep 04, 2013 8:09 am

Scaling vector graphics in LyX

Post by burgundi »

Hi,
I have several vector-graphs with molecule structures (carbon atoms connected by lines: H2C=CH-CH3). They all have different length/height/aspect ratio.
I have them in .emf format.
When I put them in the LyX document and make a pdf, all of them are scaled differently.
Bigger molecules have atoms sized like "c", and smaller molecules are sized like "C".
I use scaling size "20%" for all.

Is there any way to scale them similarly? Like dpi or something?
Of course I could adjust individual size in "%" or individual width, but I'm looking for a better solution.

Thanks.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

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

scottkosty
Site Moderator
Posts: 542
Joined: Sat Sep 01, 2012 6:38 am

Re: Scaling vector graphics in LyX

Post by scottkosty »

Hi and welcome.

In the graphics settings, click on "set width" and put, e.g. '4' in the box and leave 'cm'. Or use "Text Width %".

To give sets of images the same settings, consider using "Graphics group" (in graphics setting look at the "LaTeX and LyX options" tab).
burgundi
Posts: 3
Joined: Wed Sep 04, 2013 8:09 am

Re: Scaling vector graphics in LyX

Post by burgundi »

If I use set width, I still get different size on the text on the vector graphs, because all pictures have different size with 12cm width (see attachment).
Attachments
graphs.jpg
graphs.jpg (44.84 KiB) Viewed 6690 times
Last edited by localghost on Wed Sep 04, 2013 10:09 pm, edited 1 time in total.
Reason: Preferably no external links (see Board Rules). Attachments go onto the forum server where possible.
scottkosty
Site Moderator
Posts: 542
Joined: Sat Sep 01, 2012 6:38 am

Re: Scaling vector graphics in LyX

Post by scottkosty »

Then I'm not sure. I don't see why the pictures would have different (width) sizes if you fix the width. The only thing that comes to mind is making sure that the pictures are correctly cropped (there is no surrounding whitespace).
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Scaling vector graphics in LyX

Post by Johannes_B »

Think about the following: You have one molecule like the ones above and one which is just H2O. Both have a different size, and scaling them to .5\linewidth won't give you an exceptable size.

You have to make sure, that the inputsize is thhe same.

BTW: do you now about chemfig?

Best regards
Johannes
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
burgundi
Posts: 3
Joined: Wed Sep 04, 2013 8:09 am

Re: Scaling vector graphics in LyX

Post by burgundi »

If atom sizes are the same, then all pictures will have different width.
So if I scale them to have the same width, then atom sizes will become different.

That is the problem, that vector graphic doesn't have its original "size". It is always scaled to what a user or a program define.

Thanks for the link to the chemfig.
Post Reply