I created a table in LaTeX in the Premables.

Original code below, Premables without the code, and a PDF output of it - I put placeholders (just text) for different kinds of text that I want to put in the table (denoted in [X] where X is some text:

enter image description here

My question is:

Is it possible to create some variables/something else which will enable me to edit those texts directly, in LyX's user interface? What I want to do is not edit/write the the code every single time, and just write the texts, to avoid going to the Premables every time I create a new document in which I want this table.

  • See also ERT to include LaTeX code directly in the text.
    – Karlo
    Mar 7, 2017 at 14:01
  • I don't know if I have understand your needs, but you can create a preamble.tex with you costumized code and put only \input{preamble.tex} in your LyX preamble.
    – CarLaTeX
    Mar 7, 2017 at 14:05
  • What does this command do? Does it just load the premable.tex file into my LyX file? I want to do something like sending values into functions, such that what would be printed would be the values that I sent. Like in programming: print("hey"), where print is the function, and "hey" is a text input. Mar 7, 2017 at 14:09
  • To ping a user, you have to put @ before his/her nickname, for example @CarLaTeX. Yes, \input{...} only load preamble.tex into your file. If you want to do a \newcommand, you can put it both in your preamble.tex or directly in your LyX file using ERT.
    – CarLaTeX
    Mar 7, 2017 at 15:23
  • I think you should probably look into making modules. I don't know much about that, but there is some info in e.g. Help->Customization. Jun 4, 2017 at 11:06


You must log in to answer this question.

Browse other questions tagged .