Re: Make the math package loading automatic

2017-10-23 Thread Jean-Pierre Chrétien

Le 23/10/2017 à 08:28, Scott Kostyshak a écrit :

On Fri, Oct 20, 2017 at 09:01:02PM +, Scott Kostyshak wrote:


That way I can run the ctests just to double-check.


Thanks for sending me the patch. I checked and there are no changes in
ctests (with respect to 71a35ea) so I think we are good to go.


Done at 95f60915a7 (2.3.x) and 1720f54b41 (master).

--
Jean-Pierre



Re: Make the math package loading automatic

2017-10-23 Thread Scott Kostyshak
On Fri, Oct 20, 2017 at 09:01:02PM +, Scott Kostyshak wrote:

> That way I can run the ctests just to double-check.

Thanks for sending me the patch. I checked and there are no changes in
ctests (with respect to 71a35ea) so I think we are good to go.

Scott


signature.asc
Description: PGP signature


Re: Make the math package loading automatic

2017-10-20 Thread Scott Kostyshak
On Thu, Oct 19, 2017 at 01:07:29PM +, Jean-Pierre Chrétien wrote:
> Le 07/05/2017 à 21:58, Jean-Pierre Chrétien a écrit :
> 
> > 
> > What do you think? Should I parse the files to find \usepackage{xxx}
> > command in preambles, where xxx is one of the ten math packages managed
> > by math options
> 
> I did not find any occurrence.
> 
> > or is it sufficient to have no ctest failure?
> > 
> 
> I reran the test procedure of these changes in math options on recent master
> and documented it precisely in ticket #10661. The changes seem safe to me,
> and below is the beginning of a commit appropriate to perform them. Can it
> go to master ?
> It is also candidate to 2.3.x (and maybe to 2.2.x too).

Thanks for your work on this, Jean-Pierre, and for your detailed notes
on the ticket. Do you have a full patch for the 2.3.x branch? If you do
not want to send a large file to the list, you can send it to me
privately.

That way I can run the ctests just to double-check.

Scott


signature.asc
Description: PGP signature


Re: Make the math package loading automatic

2017-10-19 Thread Jean-Pierre Chrétien

Le 07/05/2017 à 21:58, Jean-Pierre Chrétien a écrit :



What do you think? Should I parse the files to find \usepackage{xxx} command in 
preambles, where xxx is one of the ten math packages managed by math options


I did not find any occurrence.


or is it sufficient to have no ctest failure?



I reran the test procedure of these changes in math options on recent master and 
documented it precisely in ticket #10661. The changes seem safe to me, and below 
is the beginning of a commit appropriate to perform them. Can it go to master ?

It is also candidate to 2.3.x (and maybe to 2.2.x too).


Jean-Pierre


commit ee85f40c1f7a2938515ff82853c3bf00130d862b
Author: jpc 
Date:   Thu Oct 19 14:47:51 2017 +0200

 Turn 'Do not load' math option to 'Automatic' (ticket 10661)

diff --git a/lib/doc/Additional.lyx b/lib/doc/Additional.lyx
index f3c23a515d..57f948fc45 100644
--- a/lib/doc/Additional.lyx
+++ b/lib/doc/Additional.lyx
@@ -86,14 +86,14 @@ shapepar
 \use_geometry false
 \use_package amsmath 1
 \use_package amssymb 1
-\use_package cancel 0
-\use_package esint 0
+\use_package cancel 1
+\use_package esint 1
 \use_package mathdots 1
-\use_package mathtools 0
+\use_package mathtools 1
 \use_package mhchem 1
-\use_package stackrel 0
-\use_package stmaryrd 0
-\use_package undertilde 0
+\use_package stackrel 1
+\use_package stmaryrd 1
+\use_package undertilde 1
 \cite_engine basic
 \cite_engine_type default
 \biblio_style plain
diff --git a/lib/doc/Customization.lyx b/lib/doc/Customization.lyx
index ed456e0619..cb81a847e8 100644
--- a/lib/doc/Customization.lyx
+++ b/lib/doc/Customization.lyx
@@ -82,16 +82,16 @@ logicalmkup
 \pdf_quoted_options "linkcolor=black, citecolor=black, urlcolor=blue, 
filecolor=blue,pdfpagelayout=OneColumn, pdfnewwindow=true, pdfstartview=XYZ, 
plainpages=false"

 \papersize default
 \use_geometry false
-\use_package amsmath 0
-\use_package amssymb 0
-\use_package cancel 0
-\use_package esint 0
+\use_package amsmath 1
+\use_package amssymb 1
+\use_package cancel 1
+\use_package esint 1
 \use_package mathdots 1
-\use_package mathtools 0
-\use_package mhchem 0
-\use_package stackrel 0
-\use_package stmaryrd 0
-\use_package undertilde 0
+\use_package mathtools 1
+\use_package mhchem 1
+\use_package stackrel 1
+\use_package stmaryrd 1
+\use_package undertilde 1
 \cite_engine basic
 \cite_engine_type default
 \biblio_style plain
diff --git a/lib/doc/Development.lyx b/lib/doc/Development.lyx
index 845f22aaa6..2998d0596f 100644
[snip]


Make the math package loading automatic

2017-05-07 Thread Jean-Pierre Chrétien

Dear developers

I finally ended with no errors with the ctest of the 335 files in doc, examples 
and templates directories containing one or more of the ten math options set to 
"Do not load".


Then I ran the following filter on the files

s/use_package amsmath 0/use_package amsmath 1/;
s/use_package amssymb 0/use_package amssymb 1/;
s/use_package cancel 0/use_package cancel 1/;
s/use_package esint 0/use_package esint 1/;
s/use_package mathdots 0/use_package mathdots 1/;
s/use_package mathtools 0/use_package mathtools  1/;
s/use_package mhchem 0/use_package mhchem 1/;
s/use_package stackrel 0/use_package stackrel 1/;
s/use_package stmaryrd 0/use_package stmaryrd 1/;
s/use_package undertilde 0/use_package undertilde 1/;

to make the loading automatic.

Then I reran the ctest command (I run ctest only on xhtml, pdf and pdf2 export 
formats).


I got 5 errors, which in fact are two:
 - export of doc/Math.lyx (and the 3 translations of the doc file in German, 
Spanish and French). This is due to the fact that unlike the code added in the 
preamble to create the boolean \ifundertilde, what is added by the math options 
mechanism is an unconditional \usepackage{undertilde} command.
As undertilde is not installed on my system, compilation stops with a fatal 
error. This is clearly a situation where the math option panel has been 
superseded by code in the preamble, so that "Do not load" should remain enforced.
 - export of file templates/IOP-article.lyx, because as it is said in the 
LyX-note of the file:



* the two options Use AMS math package in the document settings under Math 
Options are not used

* you do not use AMS Math Environments


This case is not clear, because if no ams construct are used in the document,
amssymb and amsmath should not be loaded if the automatic loading option is 
checked. But amsmath is loaded all right, and a lot of conflicts happen between 
the IOP class and amsmath.sty.


I do not get any error with the remaining ctested 330 files.

I reverted the changes in the 4 Math.lyx files and the IOP-article.lyx file, I 
can commit the changes that I made to the other files, but this raises two questions
 - why does automatic loading load a package that the file does not request? 
How does this automatic loading feature exactly work?
 - are there other files than Math.lyx where the preamble supersedes the 
automatic loading mechanism?


What do you think? Should I parse the files to find \usepackage{xxx} command in 
preambles, where xxx is one of the ten math packages managed by math options, or 
is it sufficient to have no ctest failure?


--
Jean-Pierre