Re: Supporting the cleverref package?

2018-09-19 Thread Klaus-Dieter Bauer
Another nice aspect of cleveref is, that it automatically calls references
to appendix sections "appendix". This may become important, when I later
decide to move whole sections to the appendix.

On Wed, Sep 19, 2018 at 3:32 PM Klaus-Dieter Bauer <
bauer.klaus.die...@gmail.com> wrote:

> On Mon, Sep 17, 2018 at 5:09 PM Richard Kimberly Heck 
> wrote:
>
>> On 9/17/18 6:11 AM, Klaus-Dieter Bauer wrote:
>> > Thanks, I wasn't aware of \prettyref support :)
>> >
>> > For my purposes this fits the bill, as the commands seem to be
>> > effectively interchangeable and only really differ in how the
>> > formatting is determined.
>> > Well, except for a possibility to make \cref automatically capitalize
>> > at the beginning of sentences, as done by \prettyref, but I found that
>> > sentences rarely start with references anyway.
>>
>>
>> Well, refstyle does support the capitalization thing, and plurals too.
>> Is there some reason you don't want to use it?
>>
>> Riki
>>
>
> Mostly cross-compatibility with latex export/import and editing the plain
> latex later.
>
> The cleveref package currently implements the best logic, as it bases the
> formatting on the actual target of the reference, rather than the name of
> the label. For instance, if I decide to change a theorem to a result
> environment while end-formatting the plain LaTeX source, both refstyle and
> prettyref would either
>
>- require replacing all references in the document (error-prone for
>multi-file documents), or
>- produce incorrectly formatted references.
>
> - Klaus
>
>


Re: Supporting the cleverref package?

2018-09-19 Thread Klaus-Dieter Bauer
On Mon, Sep 17, 2018 at 5:09 PM Richard Kimberly Heck 
wrote:

> On 9/17/18 6:11 AM, Klaus-Dieter Bauer wrote:
> > Thanks, I wasn't aware of \prettyref support :)
> >
> > For my purposes this fits the bill, as the commands seem to be
> > effectively interchangeable and only really differ in how the
> > formatting is determined.
> > Well, except for a possibility to make \cref automatically capitalize
> > at the beginning of sentences, as done by \prettyref, but I found that
> > sentences rarely start with references anyway.
>
>
> Well, refstyle does support the capitalization thing, and plurals too.
> Is there some reason you don't want to use it?
>
> Riki
>

Mostly cross-compatibility with latex export/import and editing the plain
latex later.

The cleveref package currently implements the best logic, as it bases the
formatting on the actual target of the reference, rather than the name of
the label. For instance, if I decide to change a theorem to a result
environment while end-formatting the plain LaTeX source, both refstyle and
prettyref would either

   - require replacing all references in the document (error-prone for
   multi-file documents), or
   - produce incorrectly formatted references.

- Klaus


Re: Supporting the cleverref package?

2018-09-17 Thread Daniel

On 2018-09-17 17:09, Richard Kimberly Heck wrote:

On 9/17/18 6:11 AM, Klaus-Dieter Bauer wrote:

Thanks, I wasn't aware of \prettyref support :)

For my purposes this fits the bill, as the commands seem to be
effectively interchangeable and only really differ in how the
formatting is determined.
Well, except for a possibility to make \cref automatically capitalize
at the beginning of sentences, as done by \prettyref, but I found that
sentences rarely start with references anyway.



Well, refstyle does support the capitalization thing, and plurals too.
Is there some reason you don't want to use it?


How do I set refstyle to *automatically* capitalize?

Daniel



Re: Supporting the cleverref package?

2018-09-17 Thread Richard Kimberly Heck
On 9/17/18 6:11 AM, Klaus-Dieter Bauer wrote:
> Thanks, I wasn't aware of \prettyref support :) 
>
> For my purposes this fits the bill, as the commands seem to be
> effectively interchangeable and only really differ in how the
> formatting is determined. 
> Well, except for a possibility to make \cref automatically capitalize
> at the beginning of sentences, as done by \prettyref, but I found that
> sentences rarely start with references anyway.


Well, refstyle does support the capitalization thing, and plurals too.
Is there some reason you don't want to use it?

Riki




Re: Supporting the cleverref package?

2018-09-17 Thread Klaus-Dieter Bauer
Thanks, I wasn't aware of \prettyref support :)

For my purposes this fits the bill, as the commands seem to be effectively
interchangeable and only really differ in how the formatting is determined.
Well, except for a possibility to make \cref automatically capitalize at
the beginning of sentences, as done by \prettyref, but I found that
sentences rarely start with references anyway.

On Thu, Sep 13, 2018 at 10:36 PM Richard Kimberly Heck 
wrote:

> On 09/13/2018 05:31 AM, Klaus-Dieter Bauer wrote:
>
> Hello!
>
> Is there any way wiith LyX's current customization/module interface to add
> support for the cleveref package's \cref{LABEL} command?
>
> The easiest form I can come up with would be an inset style, that is
> exported as \cref{...}, and using the "label-only" setting of the Insert ->
> Cross-Reference dialog. This approach is however cumbersome in two
> important ways:
>
>- It requires adding insert in label in two separate steps.
>- When using tex2lyx, the \cref inset would be correctly created, but
>the label would be inserted as plain-text instead of a cross-reference
>object.
>
> Hence I am looking for a better solution.
>
>
> Obviously, the best option would be to add native support for cleveref.
> This would not be difficult. We already support prettyref and refstyle, so
> it would just be one more option for how "formatted" references are output.
> Feel free to file an enhancement request (cc'ing me), but it is a format
> change so will not happen until 2.4.0.
>
> For now, if all you want is \cref *and do not want to use other types of
> formatted references*, then you can do this. In Document Settings:
>
> 1. Under Document Class, uncheck "Use refstyle"(so you use prettyref).
> 2. In the LaTeX preamble:
> \usepakcage{cleveref}
> \let\prettyref\cref
> 3. In Local Layout:
> Provides prettyref 1
>
> An ugly hack, but it should work. I.e., 'formatted' references are not se
> by cleveref. (The last prevents LyX from loading prettyref.)
>
> Riki
>
>
>


Re: Supporting the cleverref package?

2018-09-13 Thread Richard Kimberly Heck
On 09/13/2018 05:31 AM, Klaus-Dieter Bauer wrote:
> Hello!
>
> Is there any way wiith LyX's current customization/module interface to
> add support for the cleveref package's \cref{LABEL} command?
>
> The easiest form I can come up with would be an inset style, that is
> exported as \cref{...}, and using the "label-only" setting of the
> Insert -> Cross-Reference dialog. This approach is however cumbersome
> in two important ways:
>
>   * It requires adding insert in label in two separate steps.
>   * When using tex2lyx, the \cref inset would be correctly created,
> but the label would be inserted as plain-text instead of a
> cross-reference object.
>
> Hence I am looking for a better solution.

Obviously, the best option would be to add native support for cleveref.
This would not be difficult. We already support prettyref and refstyle,
so it would just be one more option for how "formatted" references are
output. Feel free to file an enhancement request (cc'ing me), but it is
a format change so will not happen until 2.4.0.

For now, if all you want is \cref *and do not want to use other types of
formatted references*, then you can do this. In Document Settings:

1. Under Document Class, uncheck "Use refstyle"(so you use prettyref).
2. In the LaTeX preamble:
    \usepakcage{cleveref}
    \let\prettyref\cref
3. In Local Layout:
    Provides prettyref 1

An ugly hack, but it should work. I.e., 'formatted' references are not
se by cleveref. (The last prevents LyX from loading prettyref.)

Riki




Supporting the cleverref package?

2018-09-13 Thread Klaus-Dieter Bauer
Hello!

Is there any way wiith LyX's current customization/module interface to add
support for the cleveref package's \cref{LABEL} command?

The easiest form I can come up with would be an inset style, that is
exported as \cref{...}, and using the "label-only" setting of the Insert ->
Cross-Reference dialog. This approach is however cumbersome in two
important ways:

   - It requires adding insert in label in two separate steps.
   - When using tex2lyx, the \cref inset would be correctly created, but
   the label would be inserted as plain-text instead of a cross-reference
   object.

Hence I am looking for a better solution.

- Klaus