Hello, I am trying to code a module that allocates a variable in the preamble. More specifically, I am using a package that requires to allocate a variable in the preamble. For example, if the package is called "thepackage" and the variable is called "myvariable" my LaTeX code is:
\documentclass{book} \makeatletter \usepackage{thepackage} \myvariable{Some stuff here} \makeatother \begin{document} \end{document} I know how to define an environment using a module, but that just includes the definition of the environment in the preamble. I also tried to use the option InPreamble 1 but that doesn't seem to work. What I am looking for is a LyX layout/style where I can write "Some stuff here", and that this shows up in the preamble as \myvariable{Some stuff here}. Right now, I am doing this using ERT boxes and the "title and preamble hacks" module. I have more than one of those custom variables, so editing a large ERT box(es) becomes tedious in LyX. Any ideas?