Re: [LyX/master] Foils.lyx: fix output of author

2016-08-26 Thread Scott Kostyshak
On Sat, Aug 20, 2016 at 12:29:52PM -0400, Scott Kostyshak wrote:
> On Sat, Aug 20, 2016 at 08:31:43AM +, Guenter Milde wrote:

> > Then, maybe,the remaining issues be summarized as enhancement request...
> 
> OK I will do this.

Done at #10347.

> >1. create a "minimal example" that has wrong output and sort as
> >
> >   >>   Sublabel: wrong_output
> >   
> >   giving the trac number in the comment.
> 
> Good idea. I will do this.

Done at 591e584b.

Thanks,

Scott


signature.asc
Description: PGP signature


Re: [LyX/master] Foils.lyx: fix output of author

2016-08-20 Thread Scott Kostyshak
On Sat, Aug 20, 2016 at 08:31:43AM +, Guenter Milde wrote:
> On 2016-08-18, Scott Kostyshak wrote:
> > On Fri, Aug 12, 2016 at 07:40:01PM +, Guenter Milde wrote:
> 
> >> The trac ticket can also be done before the decision: we know there is a 
> >> bug
> >> so this can be reported.
> 
> > True.
> 
> > Note that (in another part of this thread) I posted a patch to improve
> > things from the user perspective, I think.
> 
> Thanks.
> 
> Then, maybe,the remaining issues be summarized as enhancement request...

OK I will do this.

> >> (If LaTeX runs without error (and hence also the ctest), 
> >> add the pattern in "unreliableTests" under the
> 
> >>   Sublabel: wrong_output
> >>   # 
> >>   # Export does not fail but the resulting document has errors.
> 
> > But the output is not always wrong. 
> 
> Two possibilities:
> 
> a) if the output for the same document is not always wrong, use
>
>  Sublabel: erratic
>depending on local configuration, or the phase of the moon, use
>or
>  Sublabel: varying_versions
>Test depending on TeX distribution, package versions or OS
>
>
> b) if the issue does not lead to wrong output in all documents, 
> 
>1. create a trac-ticket saying that most documents work well but some may
>   have wrong output.
> 
>1. create a "minimal example" that has wrong output and sort as
>
>   >>   Sublabel: wrong_output
>   
>   giving the trac number in the comment.

Good idea. I will do this.

Thanks,

Scott


signature.asc
Description: PGP signature


Re: [LyX/master] Foils.lyx: fix output of author

2016-08-20 Thread Guenter Milde
On 2016-08-18, Scott Kostyshak wrote:
> On Fri, Aug 12, 2016 at 07:40:01PM +, Guenter Milde wrote:

>> The trac ticket can also be done before the decision: we know there is a bug
>> so this can be reported.

> True.

> Note that (in another part of this thread) I posted a patch to improve
> things from the user perspective, I think.

Thanks.

Then, maybe,the remaining issues be summarized as enhancement request...

...

>> (If LaTeX runs without error (and hence also the ctest), 
>> add the pattern in "unreliableTests" under the

>>   Sublabel: wrong_output
>>   # 
>>   # Export does not fail but the resulting document has errors.

> But the output is not always wrong. 

Two possibilities:

a) if the output for the same document is not always wrong, use
   
 Sublabel: erratic
   depending on local configuration, or the phase of the moon, use
   or
 Sublabel: varying_versions
   Test depending on TeX distribution, package versions or OS
   
   
b) if the issue does not lead to wrong output in all documents, 

   1. create a trac-ticket saying that most documents work well but some may
  have wrong output.

   1. create a "minimal example" that has wrong output and sort as
   
  >>   Sublabel: wrong_output
  
  giving the trac number in the comment.
  
  
Günter  



Re: [LyX/master] Foils.lyx: fix output of author

2016-08-18 Thread Scott Kostyshak
On Thu, Aug 18, 2016 at 06:19:53PM -0400, Richard Heck wrote:
> On 08/18/2016 06:07 PM, Scott Kostyshak wrote:
> > On Thu, Aug 18, 2016 at 05:03:58PM -0400, Richard Heck wrote:
> >> On 08/16/2016 11:43 PM, Scott Kostyshak wrote:
> >>> On Thu, Aug 11, 2016 at 06:19:46PM -0400, Scott Kostyshak wrote:
>  On Wed, Aug 10, 2016 at 05:42:45PM -0400, Richard Heck wrote:
> > Probably just a warning.
>  Just one warning or one for each? I think a total of one is best, and
>  say in the warning that there may be others.
> >>> Attached is a patch. Any comments?
> >> Looks reasonable.
> > It's in at 0b1cf133. I don't think we want it for stable, for the same 
> > reason we did not put the patch that reports BibTeX errors in stable, or 
> > the patch that reports missing characters.
> 
> Actually, I think this one is OK for stable. We have always given this
> warning, but only in the terminal, which of course does not help most
> people. It isn't actually an error that stops compilation, as the BibTeX
> one was.

OK it's in 2.2.x at deec5586 and b3a6f51f.

Scott


signature.asc
Description: PGP signature


Re: [LyX/master] Foils.lyx: fix output of author

2016-08-18 Thread Richard Heck
On 08/18/2016 06:07 PM, Scott Kostyshak wrote:
> On Thu, Aug 18, 2016 at 05:03:58PM -0400, Richard Heck wrote:
>> On 08/16/2016 11:43 PM, Scott Kostyshak wrote:
>>> On Thu, Aug 11, 2016 at 06:19:46PM -0400, Scott Kostyshak wrote:
 On Wed, Aug 10, 2016 at 05:42:45PM -0400, Richard Heck wrote:
> Probably just a warning.
 Just one warning or one for each? I think a total of one is best, and
 say in the warning that there may be others.
>>> Attached is a patch. Any comments?
>> Looks reasonable.
> It's in at 0b1cf133. I don't think we want it for stable, for the same reason 
> we did not put the patch that reports BibTeX errors in stable, or the patch 
> that reports missing characters.

Actually, I think this one is OK for stable. We have always given this
warning, but only in the terminal, which of course does not help most
people. It isn't actually an error that stops compilation, as the BibTeX
one was.

Richard



Re: [LyX/master] Foils.lyx: fix output of author

2016-08-18 Thread Scott Kostyshak
On Thu, Aug 18, 2016 at 05:03:58PM -0400, Richard Heck wrote:
> On 08/16/2016 11:43 PM, Scott Kostyshak wrote:
> > On Thu, Aug 11, 2016 at 06:19:46PM -0400, Scott Kostyshak wrote:
> >> On Wed, Aug 10, 2016 at 05:42:45PM -0400, Richard Heck wrote:
> >>> Probably just a warning.
> >> Just one warning or one for each? I think a total of one is best, and
> >> say in the warning that there may be others.
> > Attached is a patch. Any comments?
> 
> Looks reasonable.

It's in at 0b1cf133. I don't think we want it for stable, for the same
reason we did not put the patch that reports BibTeX errors in stable, or
the patch that reports missing characters.

Scott


signature.asc
Description: PGP signature


Re: [LyX/master] Foils.lyx: fix output of author

2016-08-18 Thread Richard Heck
On 08/16/2016 11:43 PM, Scott Kostyshak wrote:
> On Thu, Aug 11, 2016 at 06:19:46PM -0400, Scott Kostyshak wrote:
>> On Wed, Aug 10, 2016 at 05:42:45PM -0400, Richard Heck wrote:
>>> Probably just a warning.
>> Just one warning or one for each? I think a total of one is best, and
>> say in the warning that there may be others.
> Attached is a patch. Any comments?

Looks reasonable.

Richard



Re: [LyX/master] Foils.lyx: fix output of author

2016-08-17 Thread Scott Kostyshak
On Fri, Aug 12, 2016 at 07:40:01PM +, Guenter Milde wrote:

> The trac ticket can also be done before the decision: we know there is a bug
> so this can be reported.

True.

> > If we want a ctest, I suppose we could just check STDERR output from
> > exporting to LaTeX. I've actually been wondering if those would be good
> > tests for other reasons, but I imagine we'll pick up a lot of noise and
> > warnings we don't care about.
> 
> (If LaTeX runs without error (and hence also the ctest), 
> add the pattern in "unreliableTests" under the
> 
>   Sublabel: wrong_output
>   # 
>   # Export does not fail but the resulting document has errors.

But the output is not always wronge. Nonetheless, this might be the best
we can do for now.

Note that (in another part of this thread) I posted a patch to improve
things from the user perspective, I think.

Scott


signature.asc
Description: PGP signature


Re: [LyX/master] Foils.lyx: fix output of author

2016-08-16 Thread Scott Kostyshak
On Thu, Aug 11, 2016 at 06:19:46PM -0400, Scott Kostyshak wrote:
> On Wed, Aug 10, 2016 at 05:42:45PM -0400, Richard Heck wrote:

> > Probably just a warning.
> 
> Just one warning or one for each? I think a total of one is best, and
> say in the warning that there may be others.

Attached is a patch. Any comments?

Scott
From 7e9d4b021239afb7ccc9a6d0c63fe090b0094d30 Mon Sep 17 00:00:00 2001
From: Scott Kostyshak 
Date: Tue, 16 Aug 2016 22:09:57 -0400
Subject: [PATCH] Warn in GUI when mixing Title and InTitle layouts

Since we process layouts sequentially, we export LaTeX code for the
title once we arrive to a layout that has InTitle false. If the
document then later has a layout with InTitle true, we do not
(currently) go back to add it to the title and just output it
in-place. We previously warned with LYXERR0, but since this can
cause missing or unexpected output we now warn in the GUI.

For more information, see the following lyx-devel thread:
https://www.mail-archive.com/search?l=mid=a65ae226-d3bd-8fc5-a93b-7bb23f1cda82%40lyx.org
---
 src/output_latex.cpp | 17 +
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/src/output_latex.cpp b/src/output_latex.cpp
index b925496..9d58512 100644
--- a/src/output_latex.cpp
+++ b/src/output_latex.cpp
@@ -29,12 +29,15 @@
 #include "insets/InsetBibitem.h"
 #include "insets/InsetArgument.h"
 
+#include "frontends/alert.h"
+
 #include "support/lassert.h"
 #include "support/convert.h"
 #include "support/debug.h"
 #include "support/lstrings.h"
 #include "support/lyxalgo.h"
 #include "support/textutils.h"
+#include "support/gettext.h"
 
 #include 
 
@@ -1178,6 +1181,7 @@ void latexParagraphs(Buffer const & buf,
bool already_title = false;
DocumentClass const & tclass = bparams.documentClass();
 
+   bool gave_layout_warning = false;
for (; pit < runparams.par_end; ++pit) {
lastpit = pit;
ParagraphList::const_iterator par = 
paragraphs.constIterator(pit);
@@ -1189,10 +1193,15 @@ void latexParagraphs(Buffer const & buf,
 
if (layout.intitle) {
if (already_title) {
-   LYXERR0("Error in latexParagraphs: You"
-   " are using a layout (\"" << 
layout.name() << "\")"
-   " intended for the title, after using"
-   " non-title layouts.");
+   if (!gave_layout_warning) {
+   gave_layout_warning = true;
+   frontend::Alert::warning(_("Error in 
latexParagraphs"),
+   bformat(_("You are 
using at least one "
+ "layout (%1$s) 
intended for the title, "
+ "after using 
non-title layouts. This "
+ "could lead to 
missing or incorrect output."
+ ), layout.name()));
+   }
} else if (!was_title) {
was_title = true;
if (tclass.titletype() == TITLE_ENVIRONMENT) {
-- 
2.7.4



signature.asc
Description: PGP signature


Re: [LyX/master] Foils.lyx: fix output of author

2016-08-12 Thread Guenter Milde
On 2016-08-11, Scott Kostyshak wrote:

> [-- Type: text/plain, Encoding:  --]

> On Wed, Aug 10, 2016 at 11:43:26PM +0200, Kornel Benko wrote:

>> The only thing I would like is to have test files showing the wrong
>> behaviour. Hiding a symptom does not feel like a real cure.

Indeed. However, templates and examples should be error-free.

> True. We should decide what the ideal behavior is and make a trac
> ticket.

The trac ticket can also be done before the decision: we know there is a bug
so this can be reported.

> As for a test, we can take any .lyx file before the fixes I have put in.

Please make a *minimal example* that shows the problem and put this
in the "dedicated ctest examples" folder (export/export/).

Then, add a pattern in "suspiciousTests" under the "lyxbugs" subtag
together with a comment referencing the trac number and the issue at
hand.

Then, this is still tested but without noise in "normal" test runs.

> If we want a ctest, I suppose we could just check STDERR output from
> exporting to LaTeX. I've actually been wondering if those would be good
> tests for other reasons, but I imagine we'll pick up a lot of noise and
> warnings we don't care about.

(If LaTeX runs without error (and hence also the ctest), 
add the pattern in "unreliableTests" under the

  Sublabel: wrong_output
  # 
  # Export does not fail but the resulting document has errors.

)

Günter



Re: [LyX/master] Foils.lyx: fix output of author

2016-08-11 Thread Scott Kostyshak
On Wed, Aug 10, 2016 at 05:42:45PM -0400, Richard Heck wrote:
> On 08/10/2016 05:01 PM, Scott Kostyshak wrote:
> > On Wed, Aug 10, 2016 at 02:58:14PM -0400, Richard Heck wrote:
> >> On 08/10/2016 02:14 PM, Scott Kostyshak wrote:
> >>> On Wed, Aug 10, 2016 at 12:11:58PM -0400, Richard Heck wrote:
> >>>
> > 2. The behavior of what happens seems to depend on the LaTeX class. I'm 
> > not sure about this, but in some cases, it seems that nothing is wrong 
> > with e.g. outputting the date after making the title. In other cases 
> > there is something wrong -- it doesn't show up and there is no LaTeX 
> > error.
>  Some document classes put \title and \author in the premable. In that
>  case, having them come after non-InTitle stuff won't affect the
>  output---the preamble material is collected during the validation
>  process---but you may still get the warning.
> >>> Ah I see.
> >>>
>  In principle, we could process all the InTitle material during
>  validation, or we could just collect a bunch of pointers to those
>  paragraphs, and process them together at the beginning of the output
>  process, or who knows what. Then you wouldn't have to worry about where
>  those things go. But it's not clear to me whether that is worth the 
>  effort.
> >>> Indeed that seems like a lot of effort. What about making the error a GUI 
> >>> error?
> >> That's probably a good idea. The user may have no idea why the output
> >> isn't correct.
> > OK. I will add this to my TODO list if no one else gets to it. Should it be 
> > an error or a warning? 
> 
> Probably just a warning.

Just one warning or one for each? I think a total of one is best, and
say in the warning that there may be others.

For example, compile templates/aa.lyx and you will see the following:

output_latex.cpp (1195): Error in latexParagraphs: You are using a
layout ("Title") intended for the title, after using non-title layouts.
output_latex.cpp (1195): Error in latexParagraphs: You are using a
layout ("Subtitle") intended for the title, after using non-title
layouts.
output_latex.cpp (1195): Error in latexParagraphs: You are using a
layout ("Author") intended for the title, after using non-title layouts.
output_latex.cpp (1195): Error in latexParagraphs: You are using a
layout ("Address") intended for the title, after using non-title
layouts.
output_latex.cpp (1195): Error in latexParagraphs: You are using a
layout ("Offprint") intended for the title, after using non-title
layouts.
output_latex.cpp (1195): Error in latexParagraphs: You are using a
layout ("Date") intended for the title, after using non-title layouts.
output_latex.cpp (1195): Error in latexParagraphs: You are using a
layout ("Abstract (structured)") intended for the title, after using
non-title layouts.
output_latex.cpp (1195): Error in latexParagraphs: You are using a
layout ("Keywords") intended for the title, after using non-title
layouts.

In this case the issue is particularly bad because there is a duplicate
title layout so the real title is never shown. Subtitle and Author also
are not shown. I brought the issue up about duplicate layouts here:
https://www.mail-archive.com/search?l=mid=20160703232354.kwbvcdzlr4lukjtb%40steph

Scott


signature.asc
Description: PGP signature


Re: [LyX/master] Foils.lyx: fix output of author

2016-08-11 Thread Scott Kostyshak
On Wed, Aug 10, 2016 at 11:49:55PM +0200, Jean-Marc Lasgouttes wrote:
> Le 10 août 2016 23:01:55 UTC+02:00, Scott Kostyshak  a 
> écrit :
> >
> >> > Indeed that seems like a lot of effort. What about making the error
> >a GUI error?
> >> 
> >> That's probably a good idea. The user may have no idea why the output
> >> isn't correct.
> >
> >OK. I will add this to my TODO list if no one else gets to it. Should
> >it
> >be an error or a warning?
> 
> 
> We could also indicate on screen (like appendix) what layouts are intitle 
> (and which ones are at the wrong place) and maybe also mark where the 
> maketitle would be.

This would be nice.

Scott


signature.asc
Description: PGP signature


Re: [LyX/master] Foils.lyx: fix output of author

2016-08-11 Thread Scott Kostyshak
On Wed, Aug 10, 2016 at 11:43:26PM +0200, Kornel Benko wrote:

> No objections.
> The only thing I would like is to have test files showing the wrong behaviour.
> Hiding a symptom does not feel like a real cure.

True. We should decide what the ideal behavior is and make a trac
ticket.

As for a test, we can take any .lyx file before the fixes I have put in.
If we want a ctest, I suppose we could just check STDERR output from
exporting to LaTeX. I've actually been wondering if those would be good
tests for other reasons, but I imagine we'll pick up a lot of noise and
warnings we don't care about.

Scott


signature.asc
Description: PGP signature


Re: [LyX/master] Foils.lyx: fix output of author

2016-08-10 Thread Jean-Marc Lasgouttes
Le 10 août 2016 23:01:55 UTC+02:00, Scott Kostyshak  a écrit :
>
>> > Indeed that seems like a lot of effort. What about making the error
>a GUI error?
>> 
>> That's probably a good idea. The user may have no idea why the output
>> isn't correct.
>
>OK. I will add this to my TODO list if no one else gets to it. Should
>it
>be an error or a warning?


We could also indicate on screen (like appendix) what layouts are intitle (and 
which ones are at the wrong place) and maybe also mark where the maketitle 
would be.

Instead of validate, it could be done in the update mechanism.

JMarc


Re: [LyX/master] Foils.lyx: fix output of author

2016-08-10 Thread Kornel Benko
Am Mittwoch, 10. August 2016 um 17:01:55, schrieb Scott Kostyshak 

> On Wed, Aug 10, 2016 at 02:58:14PM -0400, Richard Heck wrote:
> > On 08/10/2016 02:14 PM, Scott Kostyshak wrote:
> > > On Wed, Aug 10, 2016 at 12:11:58PM -0400, Richard Heck wrote:
> > >
> > >>> 2. The behavior of what happens seems to depend on the LaTeX class. I'm 
> > >>> not sure about this, but in some cases, it seems that nothing is wrong 
> > >>> with e.g. outputting the date after making the title. In other cases 
> > >>> there is something wrong -- it doesn't show up and there is no LaTeX 
> > >>> error.
> > >> Some document classes put \title and \author in the premable. In that
> > >> case, having them come after non-InTitle stuff won't affect the
> > >> output---the preamble material is collected during the validation
> > >> process---but you may still get the warning.
> > > Ah I see.
> > >
> > >> In principle, we could process all the InTitle material during
> > >> validation, or we could just collect a bunch of pointers to those
> > >> paragraphs, and process them together at the beginning of the output
> > >> process, or who knows what. Then you wouldn't have to worry about where
> > >> those things go. But it's not clear to me whether that is worth the 
> > >> effort.
> > > Indeed that seems like a lot of effort. What about making the error a GUI 
> > > error?
> > 
> > That's probably a good idea. The user may have no idea why the output
> > isn't correct.
> 
> OK. I will add this to my TODO list if no one else gets to it. Should it
> be an error or a warning?
> 
> Kornel, after this discussion do you have any objection if I make
> further corrections like the one in this commit?

No objections.
The only thing I would like is to have test files showing the wrong behaviour.
Hiding a symptom does not feel like a real cure.

> Scott

Kornel

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


Re: [LyX/master] Foils.lyx: fix output of author

2016-08-10 Thread Richard Heck
On 08/10/2016 05:01 PM, Scott Kostyshak wrote:
> On Wed, Aug 10, 2016 at 02:58:14PM -0400, Richard Heck wrote:
>> On 08/10/2016 02:14 PM, Scott Kostyshak wrote:
>>> On Wed, Aug 10, 2016 at 12:11:58PM -0400, Richard Heck wrote:
>>>
> 2. The behavior of what happens seems to depend on the LaTeX class. I'm 
> not sure about this, but in some cases, it seems that nothing is wrong 
> with e.g. outputting the date after making the title. In other cases 
> there is something wrong -- it doesn't show up and there is no LaTeX 
> error.
 Some document classes put \title and \author in the premable. In that
 case, having them come after non-InTitle stuff won't affect the
 output---the preamble material is collected during the validation
 process---but you may still get the warning.
>>> Ah I see.
>>>
 In principle, we could process all the InTitle material during
 validation, or we could just collect a bunch of pointers to those
 paragraphs, and process them together at the beginning of the output
 process, or who knows what. Then you wouldn't have to worry about where
 those things go. But it's not clear to me whether that is worth the effort.
>>> Indeed that seems like a lot of effort. What about making the error a GUI 
>>> error?
>> That's probably a good idea. The user may have no idea why the output
>> isn't correct.
> OK. I will add this to my TODO list if no one else gets to it. Should it be 
> an error or a warning? 

Probably just a warning.

rh



Re: [LyX/master] Foils.lyx: fix output of author

2016-08-10 Thread Scott Kostyshak
On Wed, Aug 10, 2016 at 02:58:14PM -0400, Richard Heck wrote:
> On 08/10/2016 02:14 PM, Scott Kostyshak wrote:
> > On Wed, Aug 10, 2016 at 12:11:58PM -0400, Richard Heck wrote:
> >
> >>> 2. The behavior of what happens seems to depend on the LaTeX class. I'm 
> >>> not sure about this, but in some cases, it seems that nothing is wrong 
> >>> with e.g. outputting the date after making the title. In other cases 
> >>> there is something wrong -- it doesn't show up and there is no LaTeX 
> >>> error.
> >> Some document classes put \title and \author in the premable. In that
> >> case, having them come after non-InTitle stuff won't affect the
> >> output---the preamble material is collected during the validation
> >> process---but you may still get the warning.
> > Ah I see.
> >
> >> In principle, we could process all the InTitle material during
> >> validation, or we could just collect a bunch of pointers to those
> >> paragraphs, and process them together at the beginning of the output
> >> process, or who knows what. Then you wouldn't have to worry about where
> >> those things go. But it's not clear to me whether that is worth the effort.
> > Indeed that seems like a lot of effort. What about making the error a GUI 
> > error?
> 
> That's probably a good idea. The user may have no idea why the output
> isn't correct.

OK. I will add this to my TODO list if no one else gets to it. Should it
be an error or a warning?

Kornel, after this discussion do you have any objection if I make
further corrections like the one in this commit?

Scott


signature.asc
Description: PGP signature


Re: [LyX/master] Foils.lyx: fix output of author

2016-08-10 Thread Richard Heck
On 08/10/2016 02:14 PM, Scott Kostyshak wrote:
> On Wed, Aug 10, 2016 at 12:11:58PM -0400, Richard Heck wrote:
>
>>> 2. The behavior of what happens seems to depend on the LaTeX class. I'm not 
>>> sure about this, but in some cases, it seems that nothing is wrong with 
>>> e.g. outputting the date after making the title. In other cases there is 
>>> something wrong -- it doesn't show up and there is no LaTeX error.
>> Some document classes put \title and \author in the premable. In that
>> case, having them come after non-InTitle stuff won't affect the
>> output---the preamble material is collected during the validation
>> process---but you may still get the warning.
> Ah I see.
>
>> In principle, we could process all the InTitle material during
>> validation, or we could just collect a bunch of pointers to those
>> paragraphs, and process them together at the beginning of the output
>> process, or who knows what. Then you wouldn't have to worry about where
>> those things go. But it's not clear to me whether that is worth the effort.
> Indeed that seems like a lot of effort. What about making the error a GUI 
> error?

That's probably a good idea. The user may have no idea why the output
isn't correct.

Richard



Re: [LyX/master] Foils.lyx: fix output of author

2016-08-10 Thread Scott Kostyshak
On Wed, Aug 10, 2016 at 12:11:58PM -0400, Richard Heck wrote:

> > 2. The behavior of what happens seems to depend on the LaTeX class. I'm not 
> > sure about this, but in some cases, it seems that nothing is wrong with 
> > e.g. outputting the date after making the title. In other cases there is 
> > something wrong -- it doesn't show up and there is no LaTeX error.
> 
> Some document classes put \title and \author in the premable. In that
> case, having them come after non-InTitle stuff won't affect the
> output---the preamble material is collected during the validation
> process---but you may still get the warning.

Ah I see.

> In principle, we could process all the InTitle material during
> validation, or we could just collect a bunch of pointers to those
> paragraphs, and process them together at the beginning of the output
> process, or who knows what. Then you wouldn't have to worry about where
> those things go. But it's not clear to me whether that is worth the effort.

Indeed that seems like a lot of effort. What about making the error a
GUI error?

Scott


signature.asc
Description: PGP signature


Re: [LyX/master] Foils.lyx: fix output of author

2016-08-10 Thread Richard Heck
On 08/09/2016 10:57 PM, Scott Kostyshak wrote:
> On Tue, Aug 09, 2016 at 11:05:21PM +0200, Kornel Benko wrote:
>> Am Dienstag, 9. August 2016 um 18:57:50, schrieb Scott Kostyshak 
>> 
>>> commit e7a64949ad0562764a3d1db3698103ee2b91e3ce
>>> Author: Scott Kostyshak 
>>> Date:   Tue Aug 9 12:53:56 2016 -0400
>>>
>>> Foils.lyx: fix output of author
>>> 
>>> By moving date and author above the standard layouts, author is now
>>> output in the PDF and the terminal error from LyX about mixing an
>>> InTitle layout with non-InTitle layouts is gone.
>>> ---
>>>  lib/examples/Foils.lyx|   20 ++--
>>>  lib/examples/fr/Foils.lyx |   26 +-
>>>  2 files changed, 23 insertions(+), 23 deletions(-)
>>>
>> From my POV, this should be handled by lyx itself. Why is it important to 
>> the user
>> in where to add author or date data?
> Good point. I hope one of our layout experts joins in this conversation.
>
> My first reaction is the same as yours. However, after studying the code it 
> seemed to indicate that we do this on purpose, so I decided to at least fix 
> it at the higher level.
>
> A couple of thoughts come to mind for why things are this way:
>
> 1. Do we process the layouts sequentially? If so, it might just be
> difficult to see a date layout after the code to make the title is
> written and go back. Perhaps we would need two runs?

The export process just goes through the document sequentially. In the
most common case, when we hit something that isn't "InTitle", that's
when we output \maketitle. So you can think of "InTitle" as really
meaning: Before \maketitle.

> 2. The behavior of what happens seems to depend on the LaTeX class. I'm not 
> sure about this, but in some cases, it seems that nothing is wrong with e.g. 
> outputting the date after making the title. In other cases there is something 
> wrong -- it doesn't show up and there is no LaTeX error.

Some document classes put \title and \author in the premable. In that
case, having them come after non-InTitle stuff won't affect the
output---the preamble material is collected during the validation
process---but you may still get the warning.

In principle, we could process all the InTitle material during
validation, or we could just collect a bunch of pointers to those
paragraphs, and process them together at the beginning of the output
process, or who knows what. Then you wouldn't have to worry about where
those things go. But it's not clear to me whether that is worth the effort.

Richard



Re: [LyX/master] Foils.lyx: fix output of author

2016-08-09 Thread Scott Kostyshak
On Tue, Aug 09, 2016 at 11:05:21PM +0200, Kornel Benko wrote:
> Am Dienstag, 9. August 2016 um 18:57:50, schrieb Scott Kostyshak 
> 
> > commit e7a64949ad0562764a3d1db3698103ee2b91e3ce
> > Author: Scott Kostyshak 
> > Date:   Tue Aug 9 12:53:56 2016 -0400
> > 
> > Foils.lyx: fix output of author
> > 
> > By moving date and author above the standard layouts, author is now
> > output in the PDF and the terminal error from LyX about mixing an
> > InTitle layout with non-InTitle layouts is gone.
> > ---
> >  lib/examples/Foils.lyx|   20 ++--
> >  lib/examples/fr/Foils.lyx |   26 +-
> >  2 files changed, 23 insertions(+), 23 deletions(-)
> > 
> 
> From my POV, this should be handled by lyx itself. Why is it important to the 
> user
> in where to add author or date data?

Good point. I hope one of our layout experts joins in this conversation.
My first reaction is the same as yours. However, after studying the code
it seemed to indicate that we do this on purpose, so I decided to at
least fix it at the higher level.

A couple of thoughts come to mind for why things are this way:

1. Do we process the layouts sequentially? If so, it might just be
difficult to see a date layout after the code to make the title is
written and go back. Perhaps we would need two runs?

2. The behavior of what happens seems to depend on the LaTeX class. I'm
not sure about this, but in some cases, it seems that nothing is wrong 
with e.g. outputting the date after making the title. In other cases
there is something wrong -- it doesn't show up and there is no LaTeX
error.

Hopefully someone else can enlighten us.

Scott


signature.asc
Description: PGP signature


Re: [LyX/master] Foils.lyx: fix output of author

2016-08-09 Thread Kornel Benko
Am Dienstag, 9. August 2016 um 18:57:50, schrieb Scott Kostyshak 

> commit e7a64949ad0562764a3d1db3698103ee2b91e3ce
> Author: Scott Kostyshak 
> Date:   Tue Aug 9 12:53:56 2016 -0400
> 
> Foils.lyx: fix output of author
> 
> By moving date and author above the standard layouts, author is now
> output in the PDF and the terminal error from LyX about mixing an
> InTitle layout with non-InTitle layouts is gone.
> ---
>  lib/examples/Foils.lyx|   20 ++--
>  lib/examples/fr/Foils.lyx |   26 +-
>  2 files changed, 23 insertions(+), 23 deletions(-)
> 

From my POV, this should be handled by lyx itself. Why is it important to the 
user
in where to add author or date data?

Kornel

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