LyXUser defined variables in Lyx?

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
shap
Posts: 1
Joined: Mon Nov 30, 2009 7:17 pm

User defined variables in Lyx?

Post by shap »

Hi,

I have a Lyx file that holds many pictures, all of the same size (same picture resulotions). I use Scale graphics for all of them, to the same size. Is there a way to define a variable or parameter and insert it to all fields?

Thanks,
Yaron

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

bbogart
Posts: 1
Joined: Tue Jun 03, 2014 2:31 am

User defined variables in Lyx?

Post by bbogart »

Define a new macro in the preamble, like so:

Code: Select all

\newcommand{\pageScale}{0.71} % 71 percent
Then in the graphics settings, don't check any "Output Size" options, but go to the "LaTeX and LyX options" and type the following in the "LaTeX options" field:

Code: Select all

scale=\pageScale
Last edited by bbogart on Tue Jun 03, 2014 2:37 am, edited 1 time in total.
StarValkyrie
Posts: 89
Joined: Fri Jan 24, 2014 12:42 am

Re: User defined variables in Lyx?

Post by StarValkyrie »

So let me make sure I understand... you're using the Insert>Graphics GUI and checking Scale and typing the percent each time and you want that scaling to happen automatically instead?

You need to set a Graphics Group. For the next image you want, enter your scale as normal, then on the third (LaTeX and LyX options) tab of the GUI, click the button that says Open New Group and assign a name (such as Scaled). Then click OK. The next time you insert a graphic, instead of entering all your configurations again, just go straight to the third tab and, in the pulldown list under Graphics Group, assign it to the group Scaled.
Post Reply