How to include a bunch of tex commands globally

Dr Eberhard Lisse nospam at lisse.NA
Mon Apr 18 07:51:44 UTC 2022


That will not survive LyX Updates.  Local Layouts should go into the
local layout difrectory (which on the Mac is below ~/Library/Application
Support/LyX-2.3).

Never mind that "must be located" is incorrect.  LaTeX finds documents
in many places (find out what texhash does :-)-O)

I don't understand the issue, however. Why do you need (look at) the
TeX files generated by LyX? And even if so, why the concern about the
"clutter"?

That's what the Preamble is for (put in ton's of LaTeX and never look
at it again :-)-O)

I have a large include.tex for my handbook whih is included by the
master document and all child documents, so I have the same
"environment" for all and even setting up conditionals so font changes
depending on Landscape vs Portrait and similar.

greetings, el

On 2022-04-17 20:00 , tush via lyx-users wrote:
> I have a big block of tex commands (about 80 lines in length) that set
> up theorem environments using the |amsthm| and |thmtools| packages.
> 
> To this bunch of tex commands there is also a corresponding LyX module
> that defines the theorems in the editor (paragraph styles, section
> 5.3.7 in the customization manual).
> 
> I want to avoid this 80 lines code block in my document preamble.  It
> clutters the document structure.
> 
> Of course, one can insert the code block as it is inside this:
> 
> Preamble
> ⟨80 lines of code go here⟩
> EndPreamble
> 
> But this adds the big code block right into my preamble, which, as I
> said, I want to avoid.
> 
> The other option is to save the code block in a tex file
> (`myPreable.tex` for example) and to load it into my document:
> Preamble
> \input{myPreamble}
> EndPreamble
> 
> But this means that the file `myPreamble.tex` must be located in the
> root directory of the LyX project.
> 
> Is there any way to load the code block while it is located in the
> "Applications/LyX.app/Contents/Resources/layouts/" directory?  I am
> about to send this module file and all its accompanying files to a
> colleague, and I want to spare him from the task of taking care which
> files go where.
> 
> I hope my question is clear.
> 
> 



More information about the lyx-users mailing list