Re: Flexible text fields

2020-06-29 Thread Richard Kimberly Heck
On 6/29/20 4:48 AM, Daniel wrote:
> On 27/6/20 17:34, Richard Kimberly Heck wrote:
>> On 6/26/20 3:20 PM, Daniel wrote:
>>> On 2020-06-26 17:49, Richard Kimberly Heck wrote:
>>>> On 6/26/20 3:35 AM, Jürgen Spitzmüller wrote:
>>>>> Am Freitag, den 26.06.2020, 09:25 +0200 schrieb Jürgen Spitzmüller:
>>>>>> Am Freitag, den 26.06.2020, 07:40 +0200 schrieb Daniel:
>>>>>>> The upcoming flexible text fields sound very interesting to me
>>>>>>>
>>>>>>> (https://wiki.lyx.org/LyX/NewInLyX24#textfields). Is it possible
>>>>>>> to
>>>>>>>
>>>>>>> create an arbitrary custom text with it that can be re-used in
>>>>>>> sentences all over the document?
>>>>>> No.
>>>>> What you are referring to is a long-standing feature request (and I
>>>>> would love to use it myself). I am not sure it fits into the text
>>>>> field
>>>>> infrastructure (which is more like context-dependent information such
>>>>> as date, file name, author name etc.), but probably more into
>>>>> something
>>>>> you could call "text macros" in analogy to "math macros":
>>>>> https://www.lyx.org/trac/ticket/1704
>>>>
>>>> I dream about this one every once in a while but am not sure I am
>>>> up to
>>>> the challenge. I keep thinking there must be some way to adapt the
>>>> math
>>>> macro infrastructure to do it, though.
>>>>
>>>> Riki
>>>
>>> I guess a problem with the macro infrastructure is that it relies on
>>> defining a LaTeX command. But in contrast to LyX's math mode, its text
>>> mode does not understand LaTeX commands.
>>
>> Well, the point would be to change that, so you could have 'text insets'
>> that work like math insets. Then you could do the kind of thing you
>> mention, but also have more complex macros.
>>
>> Riki
>
> So, the idea is to define a command, e.g. \xyz, and then being able to
> insert it in text mode via a text inset. I still tend to think it
> would be nicer if one could skip the text inset part and just use some
> UI, like cross-references, to insert the text.

That is much less general. You don't have arguments, you can't control
formatting, etc.


> Being able to show a snippet of LyX text would also be nice in other
> context, e.g. for showing the content of an input child document
> (instead of generating a preview) or to show the text passage around
> some label when hovering over a cross-reference (instead of having to
> click "Go To Label").

These are all reasonable requests, but seem orthogonal to the original one.

Riki


-- 
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users


Re: Flexible text fields

2020-06-29 Thread Daniel

On 27/6/20 17:34, Richard Kimberly Heck wrote:

On 6/26/20 3:20 PM, Daniel wrote:

On 2020-06-26 17:49, Richard Kimberly Heck wrote:

On 6/26/20 3:35 AM, Jürgen Spitzmüller wrote:

Am Freitag, den 26.06.2020, 09:25 +0200 schrieb Jürgen Spitzmüller:

Am Freitag, den 26.06.2020, 07:40 +0200 schrieb Daniel:

The upcoming flexible text fields sound very interesting to me

(https://wiki.lyx.org/LyX/NewInLyX24#textfields). Is it possible
to

create an arbitrary custom text with it that can be re-used in
sentences all over the document?

No.

What you are referring to is a long-standing feature request (and I
would love to use it myself). I am not sure it fits into the text field
infrastructure (which is more like context-dependent information such
as date, file name, author name etc.), but probably more into something
you could call "text macros" in analogy to "math macros":
https://www.lyx.org/trac/ticket/1704


I dream about this one every once in a while but am not sure I am up to
the challenge. I keep thinking there must be some way to adapt the math
macro infrastructure to do it, though.

Riki


I guess a problem with the macro infrastructure is that it relies on
defining a LaTeX command. But in contrast to LyX's math mode, its text
mode does not understand LaTeX commands.


Well, the point would be to change that, so you could have 'text insets'
that work like math insets. Then you could do the kind of thing you
mention, but also have more complex macros.

Riki


So, the idea is to define a command, e.g. \xyz, and then being able to 
insert it in text mode via a text inset. I still tend to think it would 
be nicer if one could skip the text inset part and just use some UI, 
like cross-references, to insert the text.


Being able to show a snippet of LyX text would also be nice in other 
context, e.g. for showing the content of an input child document 
(instead of generating a preview) or to show the text passage around 
some label when hovering over a cross-reference (instead of having to 
click "Go To Label").


Daniel


--
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users


Re: Flexible text fields

2020-06-29 Thread Daniel

On 27/6/20 10:00, Kornel Benko wrote:

Am Sat, 27 Jun 2020 09:02:25 +0200
schrieb Kornel Benko :


Am Sat, 27 Jun 2020 06:35:14 +0200
schrieb Daniel :


But then the plain name will go to the list of cross-references from
where it could be inserted. I kind of like the way the bookmarks are
just part of the text in Word (and Writer) but that might fit well into
LyX's (current) infrastructure.

Daniel


Just a question. How should 'find' handle this situation?
Should it search for content or for the label?

Kornel


Replying to myself:
Since the source with which 'find' works is more or less latex, we can only 
search for
content.

Kornel


I am not sure what's the "content" here. But if I define a math macro 
\xyz as \sum, then Advanced Find & Replace does not find \sum only the 
definition, \xyz.


Daniel

--
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users


Re: Flexible text fields

2020-06-27 Thread Richard Kimberly Heck
On 6/26/20 3:20 PM, Daniel wrote:
> On 2020-06-26 17:49, Richard Kimberly Heck wrote:
>> On 6/26/20 3:35 AM, Jürgen Spitzmüller wrote:
>>> Am Freitag, den 26.06.2020, 09:25 +0200 schrieb Jürgen Spitzmüller:
>>>> Am Freitag, den 26.06.2020, 07:40 +0200 schrieb Daniel:
>>>>> The upcoming flexible text fields sound very interesting to me
>>>>>
>>>>> (https://wiki.lyx.org/LyX/NewInLyX24#textfields). Is it possible
>>>>> to
>>>>>
>>>>> create an arbitrary custom text with it that can be re-used in
>>>>> sentences all over the document?
>>>> No.
>>> What you are referring to is a long-standing feature request (and I
>>> would love to use it myself). I am not sure it fits into the text field
>>> infrastructure (which is more like context-dependent information such
>>> as date, file name, author name etc.), but probably more into something
>>> you could call "text macros" in analogy to "math macros":
>>> https://www.lyx.org/trac/ticket/1704
>>
>> I dream about this one every once in a while but am not sure I am up to
>> the challenge. I keep thinking there must be some way to adapt the math
>> macro infrastructure to do it, though.
>>
>> Riki
>
> I guess a problem with the macro infrastructure is that it relies on
> defining a LaTeX command. But in contrast to LyX's math mode, its text
> mode does not understand LaTeX commands. 

Well, the point would be to change that, so you could have 'text insets'
that work like math insets. Then you could do the kind of thing you
mention, but also have more complex macros.

Riki



-- 
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users


Re: Flexible text fields

2020-06-27 Thread Kornel Benko
Am Sat, 27 Jun 2020 09:02:25 +0200
schrieb Kornel Benko :

> Am Sat, 27 Jun 2020 06:35:14 +0200
> schrieb Daniel :
> 
> > But then the plain name will go to the list of cross-references from 
> > where it could be inserted. I kind of like the way the bookmarks are 
> > just part of the text in Word (and Writer) but that might fit well into 
> > LyX's (current) infrastructure.
> > 
> > Daniel  
> 
> Just a question. How should 'find' handle this situation?
> Should it search for content or for the label?
> 
>   Kornel

Replying to myself:
Since the source with which 'find' works is more or less latex, we can only 
search for
content.

Kornel


pgp_AaWesTzeU.pgp
Description: Digitale Signatur von OpenPGP
-- 
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users


Re: Flexible text fields

2020-06-27 Thread Kornel Benko
Am Sat, 27 Jun 2020 06:35:14 +0200
schrieb Daniel :

> But then the plain name will go to the list of cross-references from 
> where it could be inserted. I kind of like the way the bookmarks are 
> just part of the text in Word (and Writer) but that might fit well into 
> LyX's (current) infrastructure.
> 
> Daniel

Just a question. How should 'find' handle this situation?
Should it search for content or for the label?

Kornel


pgp2AD7z3maC6.pgp
Description: Digitale Signatur von OpenPGP
-- 
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users


Re: Flexible text fields

2020-06-26 Thread Daniel

On 2020-06-26 21:20, Daniel wrote:

On 2020-06-26 17:49, Richard Kimberly Heck wrote:

On 6/26/20 3:35 AM, Jürgen Spitzmüller wrote:

Am Freitag, den 26.06.2020, 09:25 +0200 schrieb Jürgen Spitzmüller:

Am Freitag, den 26.06.2020, 07:40 +0200 schrieb Daniel:

The upcoming flexible text fields sound very interesting to me

(https://wiki.lyx.org/LyX/NewInLyX24#textfields). Is it possible
to

create an arbitrary custom text with it that can be re-used in
sentences all over the document?

No.

What you are referring to is a long-standing feature request (and I
would love to use it myself). I am not sure it fits into the text field
infrastructure (which is more like context-dependent information such
as date, file name, author name etc.), but probably more into something
you could call "text macros" in analogy to "math macros":
https://www.lyx.org/trac/ticket/1704


I dream about this one every once in a while but am not sure I am up to
the challenge. I keep thinking there must be some way to adapt the math
macro infrastructure to do it, though.

Riki


I guess a problem with the macro infrastructure is that it relies on 
defining a LaTeX command. But in contrast to LyX's math mode, its text 
mode does not understand LaTeX commands. So, I think a better approach 
would be along the bookmarks & cross-references feature in Writer and Word.


1. In order to create the bookmark, you select a text piece, click on 
Bookmark..., and give it a label.


2. In order to insert the cross-reference to the bookmark, you just 
click on Cross-reference... and select the bookmark-label.


Writer and Word show the actual text from the bookmark with a gray 
background which is very handy for reading too. Word inserts the 
bookmark as it is formatted (font, color, etc.) while Writer just 
inserts the plain text (which can be formatted as a whole). But it seems 
LyX style would be to show the label-name. Might be a performance issue 
(at least for now). In that regard, Writer updates the cross-references 
automatically as one changes the bookmark, while Word only on the 
"update fields" command. (I guess that "fields" are at play here might 
have been what triggered my association with LyX's new fields.)


I just noticed that Word (but not Writer) supports even creating a 
bookmark from a table and other complex elements. So, one needs to 
create a table only at one place and can easily repeat it later. That's 
very nice!


I guess having the format inserted might not always be the best. For 
example, if a term that is emphasized where it is defined and then 
re-used later where it should not be emphasized. So, it would be nice to 
have the option to re-use with or without formatting.


Maybe I was too quick to dismiss the idea that the macro (similar) 
infrastructure could be used. I guess one could have two fields, one for 
the plain name of the definition (which replaces the LaTeX command) and 
one for some LyX snippet (like the Advanced Find and Search snippet 
which replaces the math inset). I guess that was Riki's idea.


But then the plain name will go to the list of cross-references from 
where it could be inserted. I kind of like the way the bookmarks are 
just part of the text in Word (and Writer) but that might fit well into 
LyX's (current) infrastructure.


Daniel

--
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users


Re: Flexible text fields

2020-06-26 Thread Daniel

On 2020-06-26 17:49, Richard Kimberly Heck wrote:

On 6/26/20 3:35 AM, Jürgen Spitzmüller wrote:

Am Freitag, den 26.06.2020, 09:25 +0200 schrieb Jürgen Spitzmüller:

Am Freitag, den 26.06.2020, 07:40 +0200 schrieb Daniel:

The upcoming flexible text fields sound very interesting to me

(https://wiki.lyx.org/LyX/NewInLyX24#textfields). Is it possible
to

create an arbitrary custom text with it that can be re-used in
sentences all over the document?

No.

What you are referring to is a long-standing feature request (and I
would love to use it myself). I am not sure it fits into the text field
infrastructure (which is more like context-dependent information such
as date, file name, author name etc.), but probably more into something
you could call "text macros" in analogy to "math macros":
https://www.lyx.org/trac/ticket/1704


I dream about this one every once in a while but am not sure I am up to
the challenge. I keep thinking there must be some way to adapt the math
macro infrastructure to do it, though.

Riki


I guess a problem with the macro infrastructure is that it relies on 
defining a LaTeX command. But in contrast to LyX's math mode, its text 
mode does not understand LaTeX commands. So, I think a better approach 
would be along the bookmarks & cross-references feature in Writer and Word.


1. In order to create the bookmark, you select a text piece, click on 
Bookmark..., and give it a label.


2. In order to insert the cross-reference to the bookmark, you just 
click on Cross-reference... and select the bookmark-label.


Writer and Word show the actual text from the bookmark with a gray 
background which is very handy for reading too. Word inserts the 
bookmark as it is formatted (font, color, etc.) while Writer just 
inserts the plain text (which can be formatted as a whole). But it seems 
LyX style would be to show the label-name. Might be a performance issue 
(at least for now). In that regard, Writer updates the cross-references 
automatically as one changes the bookmark, while Word only on the 
"update fields" command. (I guess that "fields" are at play here might 
have been what triggered my association with LyX's new fields.)


Daniel

--
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users


Re: Flexible text fields

2020-06-26 Thread Richard Kimberly Heck
On 6/26/20 3:35 AM, Jürgen Spitzmüller wrote:
> Am Freitag, den 26.06.2020, 09:25 +0200 schrieb Jürgen Spitzmüller:
>> Am Freitag, den 26.06.2020, 07:40 +0200 schrieb Daniel:
>>> The upcoming flexible text fields sound very interesting to me
>>>
>>> (https://wiki.lyx.org/LyX/NewInLyX24#textfields). Is it possible
>>> to 
>>>
>>> create an arbitrary custom text with it that can be re-used in
>>> sentences all over the document?
>> No.
> What you are referring to is a long-standing feature request (and I
> would love to use it myself). I am not sure it fits into the text field
> infrastructure (which is more like context-dependent information such
> as date, file name, author name etc.), but probably more into something
> you could call "text macros" in analogy to "math macros":
> https://www.lyx.org/trac/ticket/1704

I dream about this one every once in a while but am not sure I am up to
the challenge. I keep thinking there must be some way to adapt the math
macro infrastructure to do it, though.

Riki


-- 
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users


Re: Flexible text fields

2020-06-26 Thread Jürgen Spitzmüller
Am Freitag, den 26.06.2020, 09:25 +0200 schrieb Jürgen Spitzmüller:
> Am Freitag, den 26.06.2020, 07:40 +0200 schrieb Daniel:
> > The upcoming flexible text fields sound very interesting to me
> > 
> > (https://wiki.lyx.org/LyX/NewInLyX24#textfields). Is it possible
> > to 
> > 
> > create an arbitrary custom text with it that can be re-used in
> > sentences all over the document?
> 
> No.

What you are referring to is a long-standing feature request (and I
would love to use it myself). I am not sure it fits into the text field
infrastructure (which is more like context-dependent information such
as date, file name, author name etc.), but probably more into something
you could call "text macros" in analogy to "math macros":
https://www.lyx.org/trac/ticket/1704

Jürgen

> 
> Jürgen


signature.asc
Description: This is a digitally signed message part
-- 
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users


Re: Flexible text fields

2020-06-26 Thread Jürgen Spitzmüller
Am Freitag, den 26.06.2020, 07:40 +0200 schrieb Daniel:
> The upcoming flexible text fields sound very interesting to me
> 
> (https://wiki.lyx.org/LyX/NewInLyX24#textfields). Is it possible to 
> 
> create an arbitrary custom text with it that can be re-used in
> sentences all over the document?

No.

Jürgen


signature.asc
Description: This is a digitally signed message part
-- 
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users


Flexible text fields

2020-06-25 Thread Daniel

Hi,

The upcoming flexible text fields sound very interesting to me
(https://wiki.lyx.org/LyX/NewInLyX24#textfields). Is it possible to 
create an arbitrary custom text with it that can be re-used in sentences 
all over the document?


For example, I decide to define a term, say, "the Strange Hypothesis" 
and insert this field throughout the document. But later on I change my 
mind, and would rather like to use a different name, say, "the Bizarre 
Hypothesis". Could I do this without having to change the definition all 
over the place. And there is another thing that would be nice. As I 
don't capitalize all the words in the name ("the"), it would be great if 
one could choose to (manually) capitalize the name, e.g. at the 
beginning of sentences. Maybe from the field's context menu, similarly 
as with formatted references.


Kind regards,
Daniel

--
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users