Re: Standalone Math Editor

2017-02-18 Thread Guillaume Munch

Le 18/02/2017 à 06:44, Guenter Milde a écrit :

On 2017-02-18, Wei-Ting Lin wrote:


Your suggestions are valuable and important for me.



I never think Lyx is not lightweight. Actually, I'm always satisfied
with its speed. I just think to type math equations we don't need a
full Lyx. But you're right. The first step should be the input/output
function.



I'm thinking to implement the following function:



(1)When I'm editing an equation, say \[ f(x)= \], I can open Lyx with,
say Ctrl+C.



(2)Lyx is initiated with a display math mode, so I can edit the equation.



(3)After finishing editing, push some keybinding to hide the Lyx
window and return the Latex code to the editor.



(4)The editor can receive the Latex code and insert it into my file.



I think (1) and (4) involve the editor's functions, and should be put
aside at the beginning.



For (2) and (3), do you have any suggestions? I've checked the source
code, and kind of overwhelmed.


For 2), you can write a template file and open lyx with that.
I don't see a "--new-from" (or similar) command line option, so this
seems like a task for the "lyxserver"¹.

3) hiding the lyx window is a function for the window manager, again the
   lyxserver may help.

   pushing the content to the clipboard would be simply:
   command-sequence; select-all; copy;
   Alternatively, the lyxpipe can receive the content.



In addition, I am thinking about a LFUN that sends the LaTeX contents of 
the math hull at the cursor location to wherever LyX has been instructed 
to at step 2) (and will do the closing/hiding).


What I am not familiar with is the lyxserver side.






Re: CI job to run 'doxygen': Does the build enviornment matter?

2017-02-18 Thread Christian Ridderström
On 18 February 2017 at 09:18, Pavel Sanda  wrote:

> > > Christian Ridderström wrote:
> > > > But some HTML-stuff doesn't look right when served from the CI
> server, so
> > > > I've placed a copy for review on the lyx server here:
> > > >http://www.lyx.org/test/sourcedoc/index.html
>
> I see. If you have way how atomatize run and transfer result to lyx.org
> once a month
> that would be nice.
>

Here's one (pretty crude) way to do it:

- The CI job each Monday checks if the LyX repository has changed since
last Monday.
  (I just changed to Mondays, was once a day before)

- The CI job triggers if the repo has changed and builds the docs,
resulting in:

https://ci.inria.fr/lyx/job/build-master-head/job/make-lyx-doxygen-docs/ws/sourcedoc/html.tar.gz


- A cron job on the LyX server executes a script on Tuesdays that
  - Wgets the html.tar.gz
  - Checks if new archive is different from previous,
  - and also if the size of the new archive is greater than some minimum
threshold,
(to detect if a failed empty archive was generated)
  - and then extracts the doxygen files to  ?

This is basically where it's stopped right now. Suggestion for URL for the
docs on the server?
   http://www.lyx.org/sourcedoc/index.html   ?


> Do I understand correctly that we do make distcheck everyday with
> triggered error mail forwarded to dev list now?


Yes, except it's up to three times a day.

The details. This CI  job:

https://ci.inria.fr/lyx/job/build-master-head/job/ubuntu-xenial-qt4-autotools-extended/
polls the LyX repo every eight hours and if the repo has changed, it
executes

https://github.com/DrChr/build-lyx-using-ubuntu-xenial-qt4-autotools/blob/master/build/build_lyx_extended.sh
which does end with
   make distcheck

If the CI job fails, the CI job is configured to send an e-mail to:
lyx-devel@lists.lyx.org

It might be prudent to fail a build on purpose, to check that the list
actually (still) receives such e-mails.
However, there's also an RSS feed I'm subscribed to in my news reader, e.g.
this:
   RSS for all 

The CI job has built 62 times.

There's also a cmake-based CI job, but it's generating empty source
archives although it otherwise builds.
/Christian


Re: CopyrightYear is the correct command name in acmsiggraph-0.92.layout

2017-02-18 Thread Jürgen Spitzmüller
Am Freitag, den 17.02.2017, 21:27 +0100 schrieb Jürgen Spitzmüller:
> > I tried this on master, I had to change the InPreamble directive to
> 0
> > for the
> > Copyright_Year style, otherwise the AddToPreamble inserted code is
> > exported by 
> > LyX after the copyrightyear command.
> 
> You should use the Preamble tag of the style. Then you should not
> need
> to alter InPreamble. Also, this only inserts the code when needed.

OK, I see what you mean now. The following bug needs to be fixed first.
http://www.lyx.org/trac/ticket/10215

Jürgen

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


Re: Errors compiling some beamer files

2017-02-18 Thread Kornel Benko
Am Samstag, 18. Februar 2017 um 08:49:10, schrieb Jürgen Spitzmüller 

> Am Freitag, den 17.02.2017, 18:53 +0100 schrieb Jürgen Spitzmüller:
> > I'll have a look tomorrow if noone beats me to it.
> 
> Should be fixed in master.

It is. Perfect.

> Jürgen

Kornel

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


Re: [patch] Theorem environment: set NextNoIndent to 0

2017-02-18 Thread Richard Heck
On 02/16/2017 04:04 AM, Jürgen Spitzmüller wrote:
> Am Donnerstag, den 16.02.2017, 00:22 -0500 schrieb Scott Kostyshak:
>> Probably the ideal approach is to maximize a weighted average, where
>> the
>> weights are how often the document classes are used. Unfortunately, I
>> don't know how to calculate the weights.
> This would be an application of the IfStyle tag Richard once proposed
> (but never implemented apparently):
> http://marc.info/?l=lyx-devel=124967798121429=2
>
> You could use the most frequent setting in the module, and then in the
> diverging classes:
>
> IfStyle Theorem
>   NextNoIndent  0
> End

This is called "ModifyStyle" now.

ModifyStyle Theorem
  NextNoIndent  0
End

Richard



Export tests: Improper alphabetic constant.

2017-02-18 Thread Kornel Benko
This is for export with xelatex/lualatex using tex fonts of 
lib/doc/attic/eu_Additional.lyx.
E.g. for 'export/doc/attic/eu_Additional_pdf4_texF' I get
! Improper alphabetic constant.
 
\@umlaut 
l.146 ...\char `\@umlaut . }}{68}{subsection.4.17.3}
  
A one-character control sequence belongs after a ` mark.
So I'm essentially inserting \0 here.

! Improper alphabetic constant.
 
\@umlaut 
l.146 ...\char `\@umlaut . }}{68}{subsection.4.17.3}
  
A one-character control sequence belongs after a ` mark.
So I'm essentially inserting \0 here.

The next 4 errors have same messages.

Lyx converts the character '"' in footnote as
\char`\"
Correcting the double quotes cures the compilation.

Kornel


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


Re: Export tests: Improper alphabetic constant.

2017-02-18 Thread Kornel Benko
Am Samstag, 18. Februar 2017 um 10:19:52, schrieb Jürgen Spitzmüller 

> > Lyx converts the character '"' in footnote as
> >   \char`\"
> > Correcting the double quotes cures the compilation.
> 
> Please try again.
> 
> Jürgen
> 

OK for this test now. Thanks Jürgen.
Starting a full export test (but without xhtml). This takes a while, I'll 
report later.

Kornel

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


Re: Export tests: Improper alphabetic constant.

2017-02-18 Thread Kornel Benko
Am Samstag, 18. Februar 2017 um 10:38:27, schrieb Kornel Benko 
> Am Samstag, 18. Februar 2017 um 10:19:52, schrieb Jürgen Spitzmüller 
> 
> > > Lyx converts the character '"' in footnote as
> > >   \char`\"
> > > Correcting the double quotes cures the compilation.
> > 
> > Please try again.
> > 
> > Jürgen
> > 
> 
> OK for this test now. Thanks Jürgen.
> Starting a full export test (but without xhtml). This takes a while, I'll 
> report later.

The only one remaining test is now 'export/doc/ar/Intro_pdf4_systemF'.

Kornel

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


Re: Standalone Math Editor

2017-02-18 Thread Pavel Sanda
Wei-Ting Lin wrote:
> I have no idea where to start from.

Yeah, that will take a little time.

Attached are few patches I used some time ago
when I created quick and dirty lyx math calculator
which launches external app (maxima) when equation
is finished.

I don't think you can apply those patches right away
with nowadays master, but at least they might give
you few inspirational points what and where to touch
few things. No IO there though.

Pavel
commit 5ede0161b732f33426535c0e467b0ed43093d26c
Author: Pavel Sanda 
Date:   Mon May 16 22:26:49 2011 +0200

Revert my older commit in branch which allows usage of command alternatives 
inside mathull.
We should migrate to user binding instead of enter hardcoding one non lazy 
day.

diff --git a/src/mathed/InsetMathHull.cpp b/src/mathed/InsetMathHull.cpp
index b28142c..fde47dd 100644
--- a/src/mathed/InsetMathHull.cpp
+++ b/src/mathed/InsetMathHull.cpp
@@ -1549,11 +1549,6 @@ bool InsetMathHull::getStatus(Cursor & cur, FuncRequest 
const & cmd,
status.setEnabled(true);
return true;
 
-   // we never allow this in math, and we want to bind enter
-   // to another actions in command-alternatives
-   case LFUN_BREAK_PARAGRAPH:
-   status.setEnabled(false);
-   return true;
case LFUN_MATH_MUTATE: {
HullType const ht = hullType(cmd.argument());
status.setOnOff(type_ == ht);

commit c628b6cb6510a23f85d6f4840402617c39a41a5d
Author: Pavel Sanda 
Date:   Sat Dec 11 18:33:43 2010 +0100

More general esc

diff --git a/src/mathed/InsetMathNest.cpp b/src/mathed/InsetMathNest.cpp
index 8ffd80c..5a835fb 100644
--- a/src/mathed/InsetMathNest.cpp
+++ b/src/mathed/InsetMathNest.cpp
@@ -834,7 +834,7 @@ void InsetMathNest::doDispatch(Cursor & cur, FuncRequest & 
cmd)
else  {
//cmd = FuncRequest(LFUN_FINISHED_FORWARD);
//cur.undispatched();
-   lyx::dispatch(FuncRequest(LFUN_COMMAND_SEQUENCE, 
"inset-select-all;char-delete-backward;math-mode on"));
+   lyx::dispatch(FuncRequest(LFUN_COMMAND_SEQUENCE, 
"buffer-begin;buffer-end-select;char-delete-backward;math-mode on"));
}
break;
 

commit 058b2d6c52ab270282081d9791651873f50922ed
Author: Pavel Sanda 
Date:   Sat Dec 11 17:22:42 2010 +0100

Allow smaller size of window

diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp
index e30ad41..8bd7a34 100644
--- a/src/frontends/qt4/GuiView.cpp
+++ b/src/frontends/qt4/GuiView.cpp
@@ -491,7 +491,7 @@ GuiView::GuiView(int id)
 
// Forbid too small unresizable window because it can happen
// with some window manager under X11.
-   setMinimumSize(300, 200);
+   setMinimumSize(30, 20);
 
if (lyxrc.allow_geometry_session) {
// Now take care of session management.

commit a637afc3a9874418277a24bd4630e074031eb07e
Author: Pavel Sanda 
Date:   Sat Dec 11 16:59:14 2010 +0100

Escape for reseting calc

diff --git a/src/mathed/InsetMathNest.cpp b/src/mathed/InsetMathNest.cpp
index 21bfdfe..8ffd80c 100644
--- a/src/mathed/InsetMathNest.cpp
+++ b/src/mathed/InsetMathNest.cpp
@@ -832,8 +832,9 @@ void InsetMathNest::doDispatch(Cursor & cur, FuncRequest & 
cmd)
if (cur.selection())
cur.clearSelection();
else  {
-   cmd = FuncRequest(LFUN_FINISHED_FORWARD);
-   cur.undispatched();
+   //cmd = FuncRequest(LFUN_FINISHED_FORWARD);
+   //cur.undispatched();
+   lyx::dispatch(FuncRequest(LFUN_COMMAND_SEQUENCE, 
"inset-select-all;char-delete-backward;math-mode on"));
}
break;
 

commit e23a7c369a6012322810e35065962113cc253403
Author: Pavel Sanda 
Date:   Sat Dec 11 16:44:59 2010 +0100

Do not ask for save at the end

diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp
index 04b3ce9..e30ad41 100644
--- a/src/frontends/qt4/GuiView.cpp
+++ b/src/frontends/qt4/GuiView.cpp
@@ -2474,6 +2474,7 @@ bool GuiView::closeBuffer(Buffer & buf)
// so no need to do it here. This will ensure that the children end up
// in the session file in the correct order. If we close the master
// buffer, we can close or release the child buffers here too.
+   lyx::dispatch(FuncRequest(LFUN_BUFFER_WRITE));
bool success = true;
if (!closing_) {
ListOfBuffers clist = buf.getChildren();

commit 8b3431e29ab5eae0a28e479507f323341a2a6039
Author: Pavel Sanda 
Date:   Sat Dec 11 16:18:19 2010 +0100

Setup new window and proper inset

diff --git a/src/LyX.cpp b/src/LyX.cpp
index 5ae488d..fbcb8ca 100644
--- a/src/LyX.cpp
+++ 

Re: CI job to run 'doxygen': Does the build enviornment matter?

2017-02-18 Thread Pavel Sanda
Christian Ridderström wrote:
> On 14 February 2017 at 01:17, Pavel Sanda  wrote:
> 
> > Christian Ridderström wrote:
> > > But some HTML-stuff doesn't look right when served from the CI server, so
> > > I've placed a copy for review on the lyx server here:
> > >http://www.lyx.org/test/sourcedoc/index.html
> >
> > I randomly looked at http://www.lyx.org/test/sourcedoc/classlyx_1_
> > 1frontend_1_1GuiBibtex.html
> > and haven't seen any apparent issue. What stuff you refer to?
> 
> 
> It's only an issue when the docs are served from the _CI server_, it's fine
> when served from lyx.org.
> (I presume the CI server blocks some links to external javascripts or
> something).

I see. If you have way how atomatize run and transfer result to lyx.org once a 
month
that would be nice.

Do I understand correctly that we do make distcheck everyday with
triggered error mail forwarded to dev list now?

Pavel


Re: Export tests: Improper alphabetic constant.

2017-02-18 Thread Jürgen Spitzmüller
Am Samstag, den 18.02.2017, 09:35 +0100 schrieb Kornel Benko:
> This is for export with xelatex/lualatex using tex fonts of
> lib/doc/attic/eu_Additional.lyx.
> E.g. for 'export/doc/attic/eu_Additional_pdf4_texF' I get
>   ! Improper alphabetic constant.
>    
>   \@umlaut 
>   l.146 ...\char `\@umlaut . }}{68}{subsection.4.17.3}
>   
>   A one-character control sequence belongs after a ` mark.
>   So I'm essentially inserting \0 here.
> 
>   ! Improper alphabetic constant.
>    
>   \@umlaut 
>   l.146 ...\char `\@umlaut . }}{68}{subsection.4.17.3}
>   
>   A one-character control sequence belongs after a ` mark.
>   So I'm essentially inserting \0 here.
> 
> The next 4 errors have same messages.
> 
> Lyx converts the character '"' in footnote as
>   \char`\"
> Correcting the double quotes cures the compilation.

Please try again.

Jürgen

> 
>   Kornel

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


Re: Export tests: Improper alphabetic constant.

2017-02-18 Thread Kornel Benko
Am Samstag, 18. Februar 2017 um 11:43:06, schrieb Kornel Benko 
> Am Samstag, 18. Februar 2017 um 10:38:27, schrieb Kornel Benko 
> 
> > Am Samstag, 18. Februar 2017 um 10:19:52, schrieb Jürgen Spitzmüller 
> > 
> > > > Lyx converts the character '"' in footnote as
> > > >   \char`\"
> > > > Correcting the double quotes cures the compilation.
> > >
> > > Please try again.
> > >
> > > Jürgen
> > >
> >
> > OK for this test now. Thanks Jürgen.
> > Starting a full export test (but without xhtml). This takes a while, I'll 
> > report later.
>
> The only one remaining test is now 'export/doc/ar/Intro_pdf4_systemF'.
>

Found the reason. The formulas in the table in 'doc/ar/Intro.lyx' are wrong. 
Correcting them this file starts to compile.
See attached examples. Displayed in lyx one does not see a difference, but 
compiled with xelatex
ar_OK.lyx compiles.

Kornel

ar_OK.lyx
Description: application/lyx


ar_FAIL.lyx
Description: application/lyx


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


Re: Export tests: Improper alphabetic constant.

2017-02-18 Thread Kornel Benko
Am Samstag, 18. Februar 2017 um 12:36:13, schrieb Kornel Benko 
> Am Samstag, 18. Februar 2017 um 11:43:06, schrieb Kornel Benko 
> 
> > Am Samstag, 18. Februar 2017 um 10:38:27, schrieb Kornel Benko 
> > 
> > > Am Samstag, 18. Februar 2017 um 10:19:52, schrieb Jürgen Spitzmüller 
> > > 
> > > > > Lyx converts the character '"' in footnote as
> > > > >   \char`\"
> > > > > Correcting the double quotes cures the compilation.
> > > >
> > > > Please try again.
> > > >
> > > > Jürgen
> > > >
> > >
> > > OK for this test now. Thanks Jürgen.
> > > Starting a full export test (but without xhtml). This takes a while, I'll 
> > > report later.
> >
> > The only one remaining test is now 'export/doc/ar/Intro_pdf4_systemF'.
> >
>
> Found the reason. The formulas in the table in 'doc/ar/Intro.lyx' are wrong. 
> Correcting them this file starts to compile.
> See attached examples. Displayed in lyx one does not see a difference, but 
> compiled with xelatex
> ar_OK.lyx compiles.
>

Here the proposed patch.

Korneldiff --git a/lib/doc/ar/Intro.lyx b/lib/doc/ar/Intro.lyx
index 114294f..61fa69d 100644
--- a/lib/doc/ar/Intro.lyx
+++ b/lib/doc/ar/Intro.lyx
@@ -1204,7 +1204,7 @@ in

 \begin_layout Plain Layout
 انش
-\begin_inset Formula $1\text{ }in=2.54\text{ }cm$
+\begin_inset Formula $1\,in=2.54\,cm$
 \end_inset


@@ -1228,7 +1228,7 @@ pt

 \begin_layout Plain Layout
 نقطة
-\begin_inset Formula $72.27\text{ }pt=1\text{ }in$
+\begin_inset Formula $72.27\,pt=1\,in$
 \end_inset


@@ -1252,7 +1252,7 @@ pc

 \begin_layout Plain Layout
 بيكا
-\begin_inset Formula $1\text{ }pc\text{ }pt$
+\begin_inset Formula $1\,pc\,pt$
 \end_inset


@@ -1276,7 +1276,7 @@ sp

 \begin_layout Plain Layout
 نقطة قياسية
-\begin_inset Formula $65536\text{ }sp=1\text{ }pt$
+\begin_inset Formula $65536\,sp=1\,pt$
 \end_inset


@@ -1300,7 +1300,7 @@ bp

 \begin_layout Plain Layout
 نقطة كبيرة
-\begin_inset Formula $72\text{ }bp=1\text{ }in$
+\begin_inset Formula $72\,bp=1\,in$
 \end_inset


@@ -1324,7 +1324,7 @@ dd

 \begin_layout Plain Layout
 didot
-\begin_inset Formula $72\text{ }dd\approx37.6\text{ }mm$
+\begin_inset Formula $72\,dd\approx37.6\,mm$
 \end_inset


@@ -1348,7 +1348,7 @@ cc

 \begin_layout Plain Layout
 cicero
-\begin_inset Formula $1\text{ }cc\text{ }dd$
+\begin_inset Formula $1\,cc\,dd$
 \end_inset


@@ -1552,7 +1552,7 @@ mu

 \begin_layout Plain Layout
 وحدة رياضية
-\begin_inset Formula $1\text{ }mu=1/18\text{ }em$
+\begin_inset Formula $1\,mu=1/18\,em$
 \end_inset




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


Re: CopyrightYear is the correct command name in acmsiggraph-0.92.layout

2017-02-18 Thread Jean-Pierre Chrétien

Le 18/02/2017 à 09:07, Jürgen Spitzmüller a écrit :



OK, I see what you mean now. The following bug needs to be fixed first.
http://www.lyx.org/trac/ticket/10215


After git pull and recompiling, I still see the "Lyx specific LaTeX commands"
loaded before the "Textclass specific LaTeX commands".

Did your commit really solve this issue ? I'm not sure to understand the added 
code.

--
Jean-Pierre








Re: CopyrightYear is the correct command name in acmsiggraph-0.92.layout

2017-02-18 Thread Jürgen Spitzmüller
Am Samstag, den 18.02.2017, 18:37 +0100 schrieb Jean-Pierre Chrétien:
> > OK, I see what you mean now. The following bug needs to be fixed
> > first.
> > http://www.lyx.org/trac/ticket/10215
> 
> After git pull and recompiling, I still see the "Lyx specific LaTeX
> commands"
> loaded before the "Textclass specific LaTeX commands".
> 
> Did your commit really solve this issue ? I'm not sure to understand
> the added code.

Yes. Try the attached patch.

Jürgendiff --git a/lib/layouts/acmsiggraph-0-92.layout b/lib/layouts/acmsiggraph-0-92.layout
index f9fd34230f..96762d22c7 100644
--- a/lib/layouts/acmsiggraph-0-92.layout
+++ b/lib/layouts/acmsiggraph-0-92.layout
@@ -110,6 +110,10 @@ Style "Copyright_year"
 	CopyStyle		"TOG online ID"
 	LatexName		copyrightyear
 	LabelString		"Year of copyright:"
+	Preamble
+	% Compatibility fix for acmsiggraph >= 0.93.
+	\@ifundefined{copyrightyear}{\let\copyrightyear\CopyrightYear}{}
+	EndPreamble
 End
 
 


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