# Re: Toggle comments in Lyx->LaTeX Preamble

Maye some form of LaTeX conditional (\newif), which you then pass as a
Custom option in Documents->Settings?

el

On 22/02/2018 22:05, Joel Kulesza wrote:
> On Thu, Feb 22, 2018 at 12:52 PM, Daniel Gómez Martínez
> <dangome...@gmail.com> wrote:
>
>     Hello everyone,
>
>     I have large sections of customized TeX code in the LaTeX preamble
>     of some LyX templates I've created over time. I would like to know
>     if there's a way to quickly toggle between commented and uncommented
>     line for a given selection of lines (say, with a keyboard shortcut)
>
>
> I don't know of a way to do this.
>
>
>     , and in case there's not a quick way to do this, I would like to
>     ask the developers if they can include this feature in
>     Settings->Document->LaTeX Preamble and in the TeX code environment
>
>
> I would be happy to see this also.
>
>
>     (the one you have with Ctrl+L), it would also be great if a message
>     of how to do so (toggle comment lines keyboard shortcut) could be
>     included in the Settings->Document->LaTeX Preamble sub-window.
>
>     I'm sure I've read somewhere that LyX tries to the highest extent to
>     be so complete that users don't usually have to put TeX or Preamble
>     code lines, but as we users have some really customized and variable
>     needs
>
>
> The approach I use is to write a separate, external, preamble.tex file
> that I then put alongside the .lyx file and in LyX's premable I issue
> "\input{preamble.tex}".  Then, I can (un)comment the contained behavior
> in one line.  Naturally, one can use multiple preamble files to
> segregate behaviors.  Using this approach also allows multiple documents
> to share a common preamble.  Further, by symbolically linking the .tex
> file, an update in one instance updates behaviors globally.
>
> - Joel