Re: Toggle comments in Lyx->LaTeX Preamble

2018-02-23 Thread Wolfgang Engelmann



Am 23.02.2018 um 12:02 schrieb Jean-Marc Lasgouttes:

Le 23/02/2018 à 11:47, Wolfgang Engelmann a écrit :

Jean-Marc,
where can I find the description and handling of "the 'title and 
preamble hacks' module"?

I searched for it in all available Helps for Lyx, but did not find it.
Wolfgang


The only documentation that I know is in the document settings dialog, 
modules panel.


Quote:

Provides two new styles: 1. An 'In Preamble' style that puts whatever 
is entered into it into the preamble. This can be used, if one wishes, 
to include preamble code in the body of the LyX document. 2. An 'In 
Title' style that will put its contents into the body of the LaTeX 
document, but before \maketitle is issued. This is useful for making 
branches and notes in title-related material. (If you put these in a 
Standard layout, this signals to LyX to output \maketitle, which may 
then come too early.)


JMarc

ok, got it
thanks, Wolfgang


Re: Toggle comments in Lyx->LaTeX Preamble

2018-02-23 Thread Jean-Marc Lasgouttes

Le 23/02/2018 à 11:47, Wolfgang Engelmann a écrit :

Jean-Marc,
where can I find the description and handling of "the 'title and 
preamble hacks' module"?

I searched for it in all available Helps for Lyx, but did not find it.
Wolfgang


The only documentation that I know is in the document settings dialog, 
modules panel.


Quote:

Provides two new styles: 1. An 'In Preamble' style that puts whatever is 
entered into it into the preamble. This can be used, if one wishes, to 
include preamble code in the body of the LyX document. 2. An 'In Title' 
style that will put its contents into the body of the LaTeX document, 
but before \maketitle is issued. This is useful for making branches and 
notes in title-related material. (If you put these in a Standard layout, 
this signals to LyX to output \maketitle, which may then come too early.)


JMarc


Re: Toggle comments in Lyx->LaTeX Preamble

2018-02-23 Thread Wolfgang Engelmann



Am 23.02.2018 um 10:57 schrieb Jean-Marc Lasgouttes:

Le 22/02/2018 à 20:52, Daniel Gómez Martínez a écrit :

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), 
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 
(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.


Using the 'title and preamble hacks' module, you can add preamble 
items in your document as normal paragraphs.


Then, one can include these things in branch(es) and you're done !

HTH,
JMarc

Jean-Marc,
where can I find the description and handling of "the 'title and 
preamble hacks' module"?

I searched for it in all available Helps for Lyx, but did not find it.
Wolfgang


Re: Toggle comments in Lyx->LaTeX Preamble

2018-02-23 Thread Jean-Marc Lasgouttes

Le 22/02/2018 à 20:52, Daniel Gómez Martínez a écrit :

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), 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 (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.


Using the 'title and preamble hacks' module, you can add preamble items 
in your document as normal paragraphs.


Then, one can include these things in branch(es) and you're done !

HTH,
JMarc


Re: Toggle comments in Lyx->LaTeX Preamble

2018-02-23 Thread Dr Eberhard Lisse
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
>  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




Re: Toggle comments in Lyx->LaTeX Preamble

2018-02-22 Thread Paul A. Rubin

On 02/22/2018 05:06 PM, Richard Heck wrote:

On 02/22/2018 04:00 PM, Paul A Rubin wrote:




On 02/22/2018 03:37 PM, Richard Heck wrote:

On 02/22/2018 03:05 PM, Joel Kulesza wrote:
On Thu, Feb 22, 2018 at 12:52 PM, Daniel Gómez Martínez 
mailto: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.


If one's preamble-related needs have become this sophisticated, then 
I'd recommend this approach. I don't think we really want to 
implement a full-fledged LaTeX editor inside LyX. What might be more 
plausible, and something I think we have considered, is to have some 
way to launch an external text editor and then read back whatever's 
provided, kind of like we do with graphics (say).


We already have line-begin, self-insert and char-delete-forward 
LFUNs. If someone were to add a "for-each-selected-line" LFUN (with a 
shorter name) that would take a command or command-sequence as its 
argument, block comment/uncomment could be done as a macro.


Those don't apply in the case of hte LaTeX preamble. That's just a 
text editing widget provided by Qt.


Richard


Oops. Missed that.

Paul



Re: Toggle comments in Lyx->LaTeX Preamble

2018-02-22 Thread Richard Heck
On 02/22/2018 04:00 PM, Paul A Rubin wrote:
>
>
>
> On 02/22/2018 03:37 PM, Richard Heck wrote:
>> On 02/22/2018 03:05 PM, Joel Kulesza wrote:
>>> On Thu, Feb 22, 2018 at 12:52 PM, Daniel Gómez Martínez
>>> mailto: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.
>>
>> If one's preamble-related needs have become this sophisticated, then
>> I'd recommend this approach. I don't think we really want to
>> implement a full-fledged LaTeX editor inside LyX. What might be more
>> plausible, and something I think we have considered, is to have some
>> way to launch an external text editor and then read back whatever's
>> provided, kind of like we do with graphics (say).
>
> We already have line-begin, self-insert and char-delete-forward LFUNs.
> If someone were to add a "for-each-selected-line" LFUN (with a shorter
> name) that would take a command or command-sequence as its argument,
> block comment/uncomment could be done as a macro.

Those don't apply in the case of hte LaTeX preamble. That's just a text
editing widget provided by Qt.

Richard



Re: Toggle comments in Lyx->LaTeX Preamble

2018-02-22 Thread Scott Kostyshak
On Thu, Feb 22, 2018 at 08:37:44PM +, Richard Heck wrote:

> What might be more plausible, and
> something I think we have considered, is to have some way to launch an
> external text editor and then read back whatever's provided, kind of
> like we do with graphics (say).

There is a trac ticket for this somewhere.

Scott


signature.asc
Description: PGP signature


Re: Toggle comments in Lyx->LaTeX Preamble

2018-02-22 Thread Paul A Rubin



On 02/22/2018 03:37 PM, Richard Heck wrote:

On 02/22/2018 03:05 PM, Joel Kulesza wrote:
On Thu, Feb 22, 2018 at 12:52 PM, Daniel Gómez Martínez 
mailto: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.


If one's preamble-related needs have become this sophisticated, then 
I'd recommend this approach. I don't think we really want to implement 
a full-fledged LaTeX editor inside LyX. What might be more plausible, 
and something I think we have considered, is to have some way to 
launch an external text editor and then read back whatever's provided, 
kind of like we do with graphics (say).
We already have line-begin, self-insert and char-delete-forward LFUNs. 
If someone were to add a "for-each-selected-line" LFUN (with a shorter 
name) that would take a command or command-sequence as its argument, 
block comment/uncomment could be done as a macro.


Paul



Re: Toggle comments in Lyx->LaTeX Preamble

2018-02-22 Thread Richard Heck
On 02/22/2018 03:05 PM, Joel Kulesza wrote:
> On Thu, Feb 22, 2018 at 12:52 PM, Daniel Gómez Martínez
> mailto: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.

If one's preamble-related needs have become this sophisticated, then I'd
recommend this approach. I don't think we really want to implement a
full-fledged LaTeX editor inside LyX. What might be more plausible, and
something I think we have considered, is to have some way to launch an
external text editor and then read back whatever's provided, kind of
like we do with graphics (say).

Richard



Re: Toggle comments in Lyx->LaTeX Preamble

2018-02-22 Thread Joel Kulesza
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


Toggle comments in Lyx->LaTeX Preamble

2018-02-22 Thread Daniel Gómez Martínez
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), 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 (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, I think
this would be a good feature to have in order to be more productive: we
could then toggle between the customization lines of our templates and
documents for different reasons, be them debugging or changes in document
appearance.

Best regards,


*Daniel Gómez Martínez | Profesional en ingeniería eléctrica*

*Universidad Nacional de Colombi​a​*