Re: Bad Citation Bug in 2.3dev

2017-06-03 Thread Richard Heck
On 06/01/2017 05:57 PM, Jürgen Spitzmüller wrote:
> 2017-05-31 17:47 GMT+02:00 Richard Heck  >:
>
>
> PS It's probably too late for this, but is there really a good use
> case
> for mixing 'literal' and 'non-literal' citations in a single document?
> I.e., might this not make more sense as a document-level setting?
>
>
> Probably depends on the personal workflow. For me, it will probably be
> the default way now to use the non-literal way and just to enable
> literal for specific insets as I need it (i.e., have to enter LaTeX
> code). I would even prefer a setting per widget (not per dialog), but
> this turned out too complicated to implement.
>
> But maybe a preference setting for the default of new insets would fit
> both workflows?

It is probably fine as it is for now. Once literal is set once, it stays
that way unless you change it, so people who prefer it one way or the
other can just leave it that way. If we get complaints, we can do
something for 2.4.x.

Richard



Re: Bad Citation Bug in 2.3dev

2017-06-01 Thread Jürgen Spitzmüller
2017-05-31 17:47 GMT+02:00 Richard Heck :

> I see what's worrying you.
>
> The way I did the code, what we record are only *manual* changes to the
> 'literal' value. Simply opening a dialog that has literal checked does
> not change the recorded setting. If you *manually* set or unset it, then
> we will remember that, and that will become the default. So we are not
> really remembering the last value that was 'used', but only the last
> value that was 'set'. This seems right to me. Just because I happen to
> open the one citation in which I do not have 'literal' set, to modify
> something else, shouldn't mean that becomes the default.
>

I see. This strikes me sensible and sane, then.


>
> Note also that we only use the remembered value for 'new' citations
> (which we detect by seeing if the key field is empty).
>
> I still think that people are going to run into the same problem I did:
> a mix of literal and non-literal dialogs causing unexpected output. So,
> in fact, I think it would be best if, for old documents (at least), we
> did default to 'literal'. But we don't do that now. We could perhaps do
> this by checking the original file format, which is held by Buffer.cpp.
> Even then, though, once the document has been saved and re-opened, so is
> now in 2.3 format, manual action will have to be taken to avoid the
> mentioned problem.
>

Hm. I see what you mean, but don't see an elegant solution.


>
> Richard
>
> PS It's probably too late for this, but is there really a good use case
> for mixing 'literal' and 'non-literal' citations in a single document?
> I.e., might this not make more sense as a document-level setting?
>

Probably depends on the personal workflow. For me, it will probably be the
default way now to use the non-literal way and just to enable literal for
specific insets as I need it (i.e., have to enter LaTeX code). I would even
prefer a setting per widget (not per dialog), but this turned out too
complicated to implement.

But maybe a preference setting for the default of new insets would fit both
workflows?

Jürgen


Re: Bad Citation Bug in 2.3dev

2017-05-31 Thread Richard Heck
On 05/31/2017 12:55 AM, Jürgen Spitzmüller wrote:
> Am Dienstag, den 30.05.2017, 15:11 -0400 schrieb Richard Heck:
>>> OK. Thanks. Since this is used as a session setting, we might have the 
>>> unwanted side-effect that it is now off by default for everybody starting 
>>> LyX 2.3 with an old document.
>>  
>> But it was off by default, anyway, I believe, since the default for literal 
>> is false. That's how I got the non-literal insets that started this thread.
> I mean the reverse. If people start with an old document, their session will 
> default them to "literal".

I see what's worrying you.

The way I did the code, what we record are only *manual* changes to the
'literal' value. Simply opening a dialog that has literal checked does
not change the recorded setting. If you *manually* set or unset it, then
we will remember that, and that will become the default. So we are not
really remembering the last value that was 'used', but only the last
value that was 'set'. This seems right to me. Just because I happen to
open the one citation in which I do not have 'literal' set, to modify
something else, shouldn't mean that becomes the default.

Note also that we only use the remembered value for 'new' citations
(which we detect by seeing if the key field is empty).

I still think that people are going to run into the same problem I did:
a mix of literal and non-literal dialogs causing unexpected output. So,
in fact, I think it would be best if, for old documents (at least), we
did default to 'literal'. But we don't do that now. We could perhaps do
this by checking the original file format, which is held by Buffer.cpp.
Even then, though, once the document has been saved and re-opened, so is
now in 2.3 format, manual action will have to be taken to avoid the
mentioned problem.

Richard

PS It's probably too late for this, but is there really a good use case
for mixing 'literal' and 'non-literal' citations in a single document?
I.e., might this not make more sense as a document-level setting?



Re: Bad Citation Bug in 2.3dev

2017-05-30 Thread Jürgen Spitzmüller
Am Dienstag, den 30.05.2017, 15:11 -0400 schrieb Richard Heck:
> > OK. Thanks. Since this is used as a session setting, we might have
> > the unwanted side-effect that it is now off by default for
> > everybody starting LyX 2.3 with an old document.
>  
> But it was off by default, anyway, I believe, since the default for
> literal is false. That's how I got the non-literal insets that
> started this thread.

I mean the reverse. If people start with an old document, their session
will default them to "literal".

Jürgen

signature.asc
Description: This is a digitally signed message part


Re: Bad Citation Bug in 2.3dev

2017-05-30 Thread Richard Heck
On 05/30/2017 07:04 AM, Jürgen Spitzmüller wrote:
> 2017-05-30 4:54 GMT+02:00 Richard Heck  >:
>
> >> Another question: Should the "literal" flag default to true or
> false?
> >> Having it default to true would be consistent with pre-2.3
> behavior.
> >> People who wanted it otherwise could set it once and then it would
> >> (should) be remembered.
> > The argument for setting it to false was that novices tend to
> run into
> > more severe problems if they enter text that is interpreted as a
> > command and might not know what happens (as opposed to LaTeX
> > literates).
> >
> > For people who are used to the current situation, there will
> certainly
> > a learning process. But on the other hand, the situation was not
> very
> > clear at all, since some dialogs were outputting verbatim texts,
> some
> > not, some partially.
>
> Having the checkbox is fine with me. I just don't want to have to keep
> checking it.
>
> I've committed something along these lines.
>
>
> OK. Thanks. Since this is used as a session setting, we might have the
> unwanted side-effect that it is now off by default for everybody
> starting LyX 2.3 with an old document.

But it was off by default, anyway, I believe, since the default for
literal is false. That's how I got the non-literal insets that started
this thread.

Richard



Re: Bad Citation Bug in 2.3dev

2017-05-30 Thread Jürgen Spitzmüller
2017-05-30 4:54 GMT+02:00 Richard Heck :

> BibTeX bst files do not control the output of citations, only of
> bibliography references. Right?
>

Right. You'd need to set it on package level (natbib's \setcitestyle or
\bibpunct, for instance or cite.sty's \citemid).


> >> Another question: Should the "literal" flag default to true or false?
> >> Having it default to true would be consistent with pre-2.3 behavior.
> >> People who wanted it otherwise could set it once and then it would
> >> (should) be remembered.
> > The argument for setting it to false was that novices tend to run into
> > more severe problems if they enter text that is interpreted as a
> > command and might not know what happens (as opposed to LaTeX
> > literates).
> >
> > For people who are used to the current situation, there will certainly
> > a learning process. But on the other hand, the situation was not very
> > clear at all, since some dialogs were outputting verbatim texts, some
> > not, some partially.
>
> Having the checkbox is fine with me. I just don't want to have to keep
> checking it.
>
> I've committed something along these lines.
>

OK. Thanks. Since this is used as a session setting, we might have the
unwanted side-effect that it is now off by default for everybody starting
LyX 2.3 with an old document.

Jürgen


>
> Richard
>
>


Re: Bad Citation Bug in 2.3dev

2017-05-29 Thread Richard Heck
On 05/28/2017 12:38 PM, Jürgen Spitzmüller wrote:
> Am Sonntag, den 28.05.2017, 12:32 -0400 schrieb Richard Heck:
>> Some do, not all. 
> But if a given style requests a pagination prefix, the bst (or biblatex
> cbx) can and should be configured to output that. This is a
> prerequisite for portability between different styles (and languages).

BibTeX bst files do not control the output of citations, only of
bibliography references. Right?

>> Another question: Should the "literal" flag default to true or false?
>> Having it default to true would be consistent with pre-2.3 behavior.
>> People who wanted it otherwise could set it once and then it would
>> (should) be remembered.
> The argument for setting it to false was that novices tend to run into
> more severe problems if they enter text that is interpreted as a
> command and might not know what happens (as opposed to LaTeX
> literates).
>
> For people who are used to the current situation, there will certainly
> a learning process. But on the other hand, the situation was not very
> clear at all, since some dialogs were outputting verbatim texts, some
> not, some partially. 

Having the checkbox is fine with me. I just don't want to have to keep
checking it.

I've committed something along these lines.

Richard



Re: Bad Citation Bug in 2.3dev

2017-05-28 Thread Jürgen Spitzmüller
Am Sonntag, den 28.05.2017, 12:32 -0400 schrieb Richard Heck:
> Some do, not all. 

But if a given style requests a pagination prefix, the bst (or biblatex
cbx) can and should be configured to output that. This is a
prerequisite for portability between different styles (and languages).

> And of course there are other LaTeX constructs you
> might want in such places.

Sure.

> Another question: Should the "literal" flag default to true or false?
> Having it default to true would be consistent with pre-2.3 behavior.
> People who wanted it otherwise could set it once and then it would
> (should) be remembered.

The argument for setting it to false was that novices tend to run into
more severe problems if they enter text that is interpreted as a
command and might not know what happens (as opposed to LaTeX
literates).

For people who are used to the current situation, there will certainly
a learning process. But on the other hand, the situation was not very
clear at all, since some dialogs were outputting verbatim texts, some
not, some partially. 

Jürgen

> 
> Richard
> 

signature.asc
Description: This is a digitally signed message part


Re: Bad Citation Bug in 2.3dev

2017-05-28 Thread Richard Heck
On 05/27/2017 03:47 AM, Jürgen Spitzmüller wrote:
> Am Freitag, den 26.05.2017, 18:22 -0400 schrieb Richard Heck:
>> So, question: Shouldn't there be some way to set "literal true" as default? 
>> Or shouldn't this setting be remembered? It's annoying to have to set it 
>> every time.
> We could remember the setting via session.

I'd settle for it being remembered during a session, though that would
be a bonus.

> OTOH, writing things such as p.\ 22 into the citation post field
> strikes me odd. The pagination prefix is something the citation style should 
> care about.

Some do, not all. And of course there are other LaTeX constructs you
might want in such places.

Another question: Should the "literal" flag default to true or false?
Having it default to true would be consistent with pre-2.3 behavior.
People who wanted it otherwise could set it once and then it would
(should) be remembered.

Richard



Re: Bad Citation Bug in 2.3dev

2017-05-27 Thread Jürgen Spitzmüller
Am Freitag, den 26.05.2017, 18:22 -0400 schrieb Richard Heck:
> So, question: Shouldn't there be some way to set "literal true" as
> default? Or shouldn't this setting be remembered? It's annoying to
> have
> to set it every time.

We could remember the setting via session.

OTOH, writing things such as p.\ 22 into the citation post field
strikes me odd. The pagination prefix is something the citation style
should care about.

Jürgen

> 
> Richard
> 

signature.asc
Description: This is a digitally signed message part


Re: Bad Citation Bug in 2.3dev

2017-05-26 Thread Richard Heck
On 05/26/2017 12:40 PM, Richard Heck wrote:
> I am seeing the following bug: If I put, e.g., "pp.\ 22" into the text after 
> field in the citation dialog, I sometimes get as output: pp.\textbackslash{} 
> 22. This does not seem to happen with every
> citation, and I cannot figure out what is causing it to happen with the ones 
> it does. This does not happen in 2.2.x.

OK, I have found the cause of the odd behavior. Some of the citations
seem to have the "literal" flag set, and some do not. It seems to be the
new citations, added recently, that don't have it set, which makes
sense, in a way, since the old ones are converted to "literal true" by
lyx2lyx.

So, question: Shouldn't there be some way to set "literal true" as
default? Or shouldn't this setting be remembered? It's annoying to have
to set it every time.

Richard