Re: math macros via LaTex preamble

2012-07-22 Thread Richard Heck

On 07/21/2012 11:34 PM, Allen Barker wrote:

On 07/20/2012 03:40 AM, Guenter Milde wrote:

Also, math-macros are document specific - defining a math-macro in one
document does not make it available in other ones. This is why my
documents include a file of commonly used math macros -- just like I
\input a file with commonly used preamble definitions in my LaTeX
documents.


Could you elaborate on the best way to include a file of
commonly-used math macros, in a way which is compatible
with Lyx?  I tend to use a lot of \DeclareMathOperator
commands in the preamble, for example.


These kinds of commands do not (now) have any LyX equivalent, so they are
just entered as raw LaTeX and naturally go in the preamble. So put them in
some file mycmds.tex, and input it into your LyX preamble in the usual way.


I've avoided the Lyx macro stuff so far because it has
seemed to me to be *too* document specific.  I don't know
if it actually is, but I haven't found that information in
the preliminary searches I've conducted.

I have several files, for different projects, that contain nothing but 
math macros.

This gets input into my other documents, using InsertFileChild Document.

Note that LyX doesn't know anything about what you put in the preamble (it
just gets output raw into your document preamble), so if you use your new
math operators in LyX, they'll work, but not look nice. So the attached 
shows
a way around this problem. The difference between \test and \lest 
doesn't show

up inside LyX, but it does in the output.

Richard



mathop.lyx
Description: application/lyx


RE: math macros via LaTex preamble

2012-07-22 Thread Scott Kostyshak
From: Richard Heck [rgh...@lyx.org]
Sent: Sunday, July 22, 2012 10:20 AM

So the attached shows a way around this problem. The difference between \test 
and \lest
doesn't show up inside LyX, but it does in the output.

Is there any way to put these inside a preview inset?

Scott

Re: math macros via LaTex preamble

2012-07-22 Thread Guenter Milde
On 2012-07-22, Allen Barker wrote:
 On 07/20/2012 03:40 AM, Guenter Milde wrote:
 Also, math-macros are document specific - defining a math-macro in one
 document does not make it available in other ones. This is why my
 documents include a file of commonly used math macros -- just like I
 \input a file with commonly used preamble definitions in my LaTeX
 documents.

 Could you elaborate on the best way to include a file of
 commonly-used math macros, in a way which is compatible
 with Lyx?  I tend to use a lot of \DeclareMathOperator
 commands in the preamble, for example.

For definitions that should work in most documents, I use two files, a
tex preamble and a lyx preamble.

In DocumentSettingsLaTeX preamble, I write
 
 \input{preamble.tex}
 
and in the document itself I have an inset with
  
 InsertFileLyX Documentmath-macros.lyx.

In math-macros.lyx I use a branch macro-doc that is usually inactiv for
the comments/documentation.

Instead of \DeclareMathOperator, I use \operatorname in a math-macro, say
\Re := \operatorname{Re} which then translates to 

  \global\long\def\Re{\operatorname{Re}}
 
 Any general comments on the best way to organize and
 include preamble material in a way which is compatible
 with Lyx would also be appreciated.

The best way generally depends on weather conditions, personal preference
and other circumstances. 

For parent/child documents, I put the math-macros file (together with
some other stuff) in a branch that is set active in the child but inactive
in the parent doc. This way the child is also a valid standalone document.


Günter



Re: math macros via LaTex preamble

2012-07-22 Thread Richard Heck

On 07/21/2012 11:34 PM, Allen Barker wrote:

On 07/20/2012 03:40 AM, Guenter Milde wrote:

Also, math-macros are document specific - defining a math-macro in one
document does not make it available in other ones. This is why my
documents include a file of commonly used math macros -- just like I
\input a file with commonly used preamble definitions in my LaTeX
documents.


Could you elaborate on the best way to include a file of
commonly-used math macros, in a way which is compatible
with Lyx?  I tend to use a lot of \DeclareMathOperator
commands in the preamble, for example.


These kinds of commands do not (now) have any LyX equivalent, so they are
just entered as raw LaTeX and naturally go in the preamble. So put them in
some file mycmds.tex, and input it into your LyX preamble in the usual way.


I've avoided the Lyx macro stuff so far because it has
seemed to me to be *too* document specific.  I don't know
if it actually is, but I haven't found that information in
the preliminary searches I've conducted.

I have several files, for different projects, that contain nothing but 
math macros.

This gets input into my other documents, using InsertFileChild Document.

Note that LyX doesn't know anything about what you put in the preamble (it
just gets output raw into your document preamble), so if you use your new
math operators in LyX, they'll work, but not look nice. So the attached 
shows
a way around this problem. The difference between \test and \lest 
doesn't show

up inside LyX, but it does in the output.

Richard



mathop.lyx
Description: application/lyx


RE: math macros via LaTex preamble

2012-07-22 Thread Scott Kostyshak
From: Richard Heck [rgh...@lyx.org]
Sent: Sunday, July 22, 2012 10:20 AM

So the attached shows a way around this problem. The difference between \test 
and \lest
doesn't show up inside LyX, but it does in the output.

Is there any way to put these inside a preview inset?

Scott

Re: math macros via LaTex preamble

2012-07-22 Thread Guenter Milde
On 2012-07-22, Allen Barker wrote:
 On 07/20/2012 03:40 AM, Guenter Milde wrote:
 Also, math-macros are document specific - defining a math-macro in one
 document does not make it available in other ones. This is why my
 documents include a file of commonly used math macros -- just like I
 \input a file with commonly used preamble definitions in my LaTeX
 documents.

 Could you elaborate on the best way to include a file of
 commonly-used math macros, in a way which is compatible
 with Lyx?  I tend to use a lot of \DeclareMathOperator
 commands in the preamble, for example.

For definitions that should work in most documents, I use two files, a
tex preamble and a lyx preamble.

In DocumentSettingsLaTeX preamble, I write
 
 \input{preamble.tex}
 
and in the document itself I have an inset with
  
 InsertFileLyX Documentmath-macros.lyx.

In math-macros.lyx I use a branch macro-doc that is usually inactiv for
the comments/documentation.

Instead of \DeclareMathOperator, I use \operatorname in a math-macro, say
\Re := \operatorname{Re} which then translates to 

  \global\long\def\Re{\operatorname{Re}}
 
 Any general comments on the best way to organize and
 include preamble material in a way which is compatible
 with Lyx would also be appreciated.

The best way generally depends on weather conditions, personal preference
and other circumstances. 

For parent/child documents, I put the math-macros file (together with
some other stuff) in a branch that is set active in the child but inactive
in the parent doc. This way the child is also a valid standalone document.


Günter



Re: math macros via LaTex preamble

2012-07-22 Thread Richard Heck

On 07/21/2012 11:34 PM, Allen Barker wrote:

On 07/20/2012 03:40 AM, Guenter Milde wrote:

Also, math-macros are document specific - defining a math-macro in one
document does not make it available in other ones. This is why my
documents include a file of commonly used math macros -- just like I
\input a file with commonly used preamble definitions in my LaTeX
documents.


Could you elaborate on the best way to include a file of
commonly-used math macros, in a way which is compatible
with Lyx?  I tend to use a lot of \DeclareMathOperator
commands in the preamble, for example.


These kinds of commands do not (now) have any LyX equivalent, so they are
just entered as raw LaTeX and naturally go in the preamble. So put them in
some file mycmds.tex, and input it into your LyX preamble in the usual way.


I've avoided the Lyx macro stuff so far because it has
seemed to me to be *too* document specific.  I don't know
if it actually is, but I haven't found that information in
the preliminary searches I've conducted.

I have several files, for different projects, that contain nothing but 
math macros.

This gets input into my other documents, using Insert>File>Child Document.

Note that LyX doesn't know anything about what you put in the preamble (it
just gets output raw into your document preamble), so if you use your new
math operators in LyX, they'll work, but not look nice. So the attached 
shows
a way around this problem. The difference between \test and \lest 
doesn't show

up inside LyX, but it does in the output.

Richard



mathop.lyx
Description: application/lyx


RE: math macros via LaTex preamble

2012-07-22 Thread Scott Kostyshak
From: Richard Heck [rgh...@lyx.org]
Sent: Sunday, July 22, 2012 10:20 AM

>So the attached shows a way around this problem. The difference between \test 
>and \lest
>doesn't show up inside LyX, but it does in the output.

Is there any way to put these inside a preview inset?

Scott

Re: math macros via LaTex preamble

2012-07-22 Thread Guenter Milde
On 2012-07-22, Allen Barker wrote:
> On 07/20/2012 03:40 AM, Guenter Milde wrote:
>> Also, math-macros are document specific - defining a math-macro in one
>> document does not make it available in other ones. This is why my
>> documents include a file of commonly used math macros -- just like I
>> \input a file with commonly used preamble definitions in my LaTeX
>> documents.

> Could you elaborate on the best way to include a file of
> commonly-used math macros, in a way which is compatible
> with Lyx?  I tend to use a lot of \DeclareMathOperator
> commands in the preamble, for example.

For definitions that should work in most documents, I use two files, a
tex preamble and a lyx preamble.

In Document>Settings>LaTeX preamble, I write
 
 \input{preamble.tex}
 
and in the document itself I have an inset with
  
 Insert>File>LyX Document>math-macros.lyx.

In math-macros.lyx I use a branch "macro-doc" that is usually inactiv for
the comments/documentation.

Instead of \DeclareMathOperator, I use \operatorname in a math-macro, say
\Re := \operatorname{Re} which then translates to 

  \global\long\def\Re{\operatorname{Re}}
 
> Any general comments on the "best" way to organize and
> include preamble material in a way which is compatible
> with Lyx would also be appreciated.

The "best" way generally depends on weather conditions, personal preference
and other circumstances. 

For parent/child documents, I put the math-macros file (together with
some other stuff) in a branch that is set active in the child but inactive
in the parent doc. This way the child is also a valid standalone document.


Günter



Re: math macros via LaTex preamble

2012-07-21 Thread Allen Barker

On 07/20/2012 03:40 AM, Guenter Milde wrote:

Also, math-macros are document specific - defining a math-macro in one
document does not make it available in other ones. This is why my
documents include a file of commonly used math macros -- just like I
\input a file with commonly used preamble definitions in my LaTeX
documents.


Could you elaborate on the best way to include a file of
commonly-used math macros, in a way which is compatible
with Lyx?  I tend to use a lot of \DeclareMathOperator
commands in the preamble, for example.

I've avoided the Lyx macro stuff so far because it has
seemed to me to be *too* document specific.  I don't know
if it actually is, but I haven't found that information in
the preliminary searches I've conducted.

Any general comments on the best way to organize and
include preamble material in a way which is compatible
with Lyx would also be appreciated.




Re: math macros via LaTex preamble

2012-07-21 Thread Allen Barker

On 07/20/2012 03:40 AM, Guenter Milde wrote:

Also, math-macros are document specific - defining a math-macro in one
document does not make it available in other ones. This is why my
documents include a file of commonly used math macros -- just like I
\input a file with commonly used preamble definitions in my LaTeX
documents.


Could you elaborate on the best way to include a file of
commonly-used math macros, in a way which is compatible
with Lyx?  I tend to use a lot of \DeclareMathOperator
commands in the preamble, for example.

I've avoided the Lyx macro stuff so far because it has
seemed to me to be *too* document specific.  I don't know
if it actually is, but I haven't found that information in
the preliminary searches I've conducted.

Any general comments on the best way to organize and
include preamble material in a way which is compatible
with Lyx would also be appreciated.




Re: math macros via LaTex preamble

2012-07-21 Thread Allen Barker

On 07/20/2012 03:40 AM, Guenter Milde wrote:

Also, math-macros are document specific - defining a math-macro in one
document does not make it available in other ones. This is why my
documents include a file of commonly used math macros -- just like I
\input a file with commonly used preamble definitions in my LaTeX
documents.


Could you elaborate on the best way to include a file of
commonly-used math macros, in a way which is compatible
with Lyx?  I tend to use a lot of \DeclareMathOperator
commands in the preamble, for example.

I've avoided the Lyx macro stuff so far because it has
seemed to me to be *too* document specific.  I don't know
if it actually is, but I haven't found that information in
the preliminary searches I've conducted.

Any general comments on the "best" way to organize and
include preamble material in a way which is compatible
with Lyx would also be appreciated.




Re: math macros via LaTex preamble

2012-07-20 Thread Guenter Milde
On 2012-07-19, ralston wrote:

 I've got 10 years experience and 200 documents using LaTex with heavy
 math.  Like everyone else I paste a clot of \newcommands into my Latex
 preamble without looking at it.

 My student has recommended Lyx, which I appreciate has many great
 features.  I really want to like LyX.  What a great concept.  And
 yet... I find LyX math macros an absolutely horror. Why construct LyX
 to ignore macros in an imported LaTex preamble?  Why defeat the most
 popular usage, and why not write something to properly automate the
 import? 

Because (La)TeX is a macro language that is miles more difficult to
machine-parse than, say, XML.

This is why the focus is on *generating* (writing/editing) documents that
can be typeset with LaTeX (and/or HTML, Docbook, ...). LyX is *not* a LaTeX
editor.

Depending on your needs, existing documents and willingness to change
habits, LyX may boost your productivity or be not the tool of your choice.

 It's a fact that exchanging LaTex with collaborators and opening old
 files needs to be automated.  Yet Lyx wants me to paste macros by hand
 into every document, or else create subsidiary file systems I don't
 understand with no examples of what to do.  

I don't understand where LyX wants you to paste macros by hand...

 Why not automate that? 

This is a task too difficult to be done completely automatically. LyX did
improve and specific suggestions for further improvement are welcome.

 Once I create a macro it won't update (for me!) in an imported LaTeX
 document, and the error messages are too non-specific to debug.

The math-macros are really just for math-mode commands. This is why LyX
does not convert preamble definitions to math-macros - is just does not
know whether they are math-mode or text-mode (or both). (See your list below
for a mix of math-mode and text-mode commands.)

Also, math-macros are document specific - defining a math-macro in one
document does not make it available in other ones. This is why my
documents include a file of commonly used math macros -- just like I
\input a file with commonly used preamble definitions in my LaTeX
documents.

 Import also seems to forget a lot of small things like ^{}, _{}  and
 matrix formats that are real work to fix.

Yes, there are many non-supported ways to write things in LaTeX.

 I've only got about 10 macros to get running, but LyX has fought me all
 the way.  I hope I'm in the wrong and working with basic concept errors
 someone could straighten out... and why doesn't LyX post at least one
 completely running imported mathy FILE example, rather than abstract
 principleswhile my excuse is a definite lack of interest in working
 with things that create more work than they save.  Frustrated by hours
 or wasted time, I probably seem cranky. 

I do understand your frustration. Please keep in mind that LyX is not an
enterprise solution promising easy LaTeX for all but a volunteer effort
to create a document processor that matches the expectations and ideals
of its developers with much input from the users. As such, it may be not
the right tool for you - at least it needs more patience for things that
might seem easy to you but are very complex from the point of a
programmer...

 In case I've not been too rude, here's some macros, which LyX gurus
 will not find profound; I will surely either convert with enthusiasm to
 LyX, or forbid all my students and contacts to ever touch it, depending
 on how the importing and exporting of latex with macros can be
 automated.

I hope you will come to a more tempered evaluation of the program.
Even if it is not the tool for you, it might be valuable for your
students.

 \newcommand{\ab}{\allowbreak} \newcommand{\bit}{\begin{itemize}}
 \newcommand{\eit}{\end{itemize}} \newcommand{\im}{\item}
 \newcommand{\be}{\begin{equation}} \newcommand{\ee}{\end{equation}}
 \newcommand{\ba}{\begin{eqnarray}} \newcommand{\ea}{\end{eqnarray}}
 \newcommand{\nn}{\nonumber} \renewcommand{\bf}{\textbf}

All of these are rather shortcut aliases for text mode. math-macro is not
the right thing to emulate them.
I would try to find out whether tex2lyx already can be configured to do a
back-replacement (e.g. \bf - \textbf) before converting to LyX format or
write a simple search-and replace script to do this in a preprocessing step.

As you are not going to use these commands directly when writing in LyX,
there is no need for supporting the aliases.

 \newcommand{\ra}{\rightarrow} \newcommand{\NN}{\vec \nabla}
 \def\slasha#1{\setbox0=\hbox{$#1$}#1\hskip-\wd0\hbox 
 to\wd0{\hss\sl/\/\hss}}
 \def\slashb#1{\setbox0=\hbox{$#1$}#1\hskip-\wd0\dimen0=5pt\advance
 \dimen0 by-\ht0\advance\dimen0 by\dp0\lower0.5\dimen0\hbox
 to\wd0{\hss\sl/\/\hss}}

These are (as far as I can see) real math macros, hence it may be sensible
to define math-macros for them (if you want a nice look in LyX). However,
it is possible to use them as is in math insets - it just does not look so
nice with the red 

Re: math macros via LaTex preamble

2012-07-20 Thread Guenter Milde
On 2012-07-19, ralston wrote:

 I've got 10 years experience and 200 documents using LaTex with heavy
 math.  Like everyone else I paste a clot of \newcommands into my Latex
 preamble without looking at it.

 My student has recommended Lyx, which I appreciate has many great
 features.  I really want to like LyX.  What a great concept.  And
 yet... I find LyX math macros an absolutely horror. Why construct LyX
 to ignore macros in an imported LaTex preamble?  Why defeat the most
 popular usage, and why not write something to properly automate the
 import? 

Because (La)TeX is a macro language that is miles more difficult to
machine-parse than, say, XML.

This is why the focus is on *generating* (writing/editing) documents that
can be typeset with LaTeX (and/or HTML, Docbook, ...). LyX is *not* a LaTeX
editor.

Depending on your needs, existing documents and willingness to change
habits, LyX may boost your productivity or be not the tool of your choice.

 It's a fact that exchanging LaTex with collaborators and opening old
 files needs to be automated.  Yet Lyx wants me to paste macros by hand
 into every document, or else create subsidiary file systems I don't
 understand with no examples of what to do.  

I don't understand where LyX wants you to paste macros by hand...

 Why not automate that? 

This is a task too difficult to be done completely automatically. LyX did
improve and specific suggestions for further improvement are welcome.

 Once I create a macro it won't update (for me!) in an imported LaTeX
 document, and the error messages are too non-specific to debug.

The math-macros are really just for math-mode commands. This is why LyX
does not convert preamble definitions to math-macros - is just does not
know whether they are math-mode or text-mode (or both). (See your list below
for a mix of math-mode and text-mode commands.)

Also, math-macros are document specific - defining a math-macro in one
document does not make it available in other ones. This is why my
documents include a file of commonly used math macros -- just like I
\input a file with commonly used preamble definitions in my LaTeX
documents.

 Import also seems to forget a lot of small things like ^{}, _{}  and
 matrix formats that are real work to fix.

Yes, there are many non-supported ways to write things in LaTeX.

 I've only got about 10 macros to get running, but LyX has fought me all
 the way.  I hope I'm in the wrong and working with basic concept errors
 someone could straighten out... and why doesn't LyX post at least one
 completely running imported mathy FILE example, rather than abstract
 principleswhile my excuse is a definite lack of interest in working
 with things that create more work than they save.  Frustrated by hours
 or wasted time, I probably seem cranky. 

I do understand your frustration. Please keep in mind that LyX is not an
enterprise solution promising easy LaTeX for all but a volunteer effort
to create a document processor that matches the expectations and ideals
of its developers with much input from the users. As such, it may be not
the right tool for you - at least it needs more patience for things that
might seem easy to you but are very complex from the point of a
programmer...

 In case I've not been too rude, here's some macros, which LyX gurus
 will not find profound; I will surely either convert with enthusiasm to
 LyX, or forbid all my students and contacts to ever touch it, depending
 on how the importing and exporting of latex with macros can be
 automated.

I hope you will come to a more tempered evaluation of the program.
Even if it is not the tool for you, it might be valuable for your
students.

 \newcommand{\ab}{\allowbreak} \newcommand{\bit}{\begin{itemize}}
 \newcommand{\eit}{\end{itemize}} \newcommand{\im}{\item}
 \newcommand{\be}{\begin{equation}} \newcommand{\ee}{\end{equation}}
 \newcommand{\ba}{\begin{eqnarray}} \newcommand{\ea}{\end{eqnarray}}
 \newcommand{\nn}{\nonumber} \renewcommand{\bf}{\textbf}

All of these are rather shortcut aliases for text mode. math-macro is not
the right thing to emulate them.
I would try to find out whether tex2lyx already can be configured to do a
back-replacement (e.g. \bf - \textbf) before converting to LyX format or
write a simple search-and replace script to do this in a preprocessing step.

As you are not going to use these commands directly when writing in LyX,
there is no need for supporting the aliases.

 \newcommand{\ra}{\rightarrow} \newcommand{\NN}{\vec \nabla}
 \def\slasha#1{\setbox0=\hbox{$#1$}#1\hskip-\wd0\hbox 
 to\wd0{\hss\sl/\/\hss}}
 \def\slashb#1{\setbox0=\hbox{$#1$}#1\hskip-\wd0\dimen0=5pt\advance
 \dimen0 by-\ht0\advance\dimen0 by\dp0\lower0.5\dimen0\hbox
 to\wd0{\hss\sl/\/\hss}}

These are (as far as I can see) real math macros, hence it may be sensible
to define math-macros for them (if you want a nice look in LyX). However,
it is possible to use them as is in math insets - it just does not look so
nice with the red 

Re: math macros via LaTex preamble

2012-07-20 Thread Guenter Milde
On 2012-07-19, ralston wrote:

> I've got 10 years experience and 200 documents using LaTex with heavy
> math.  Like everyone else I paste a clot of \newcommands into my Latex
> preamble without looking at it.

> My student has recommended Lyx, which I appreciate has many great
> features.  I really want to like LyX.  What a great concept.  And
> yet... I find LyX math macros an absolutely horror. Why construct LyX
> to ignore macros in an imported LaTex preamble?  Why defeat the most
> popular usage, and why not write something to properly automate the
> import? 

Because (La)TeX is a macro language that is miles more difficult to
machine-parse than, say, XML.

This is why the focus is on *generating* (writing/editing) documents that
can be typeset with LaTeX (and/or HTML, Docbook, ...). LyX is *not* a "LaTeX
editor".

Depending on your needs, existing documents and willingness to change
habits, LyX may boost your productivity or be not the tool of your choice.

> It's a fact that exchanging LaTex with collaborators and opening old
> files needs to be automated.  Yet Lyx wants me to paste macros by hand
> into every document, or else create subsidiary file systems I don't
> understand with no examples of what to do.  

I don't understand where LyX wants you to paste macros by hand...

> Why not automate that? 

This is a task too difficult to be done completely automatically. LyX did
improve and specific suggestions for further improvement are welcome.

> Once I create a macro it won't update (for me!) in an imported LaTeX
> document, and the error messages are too non-specific to debug.

The math-macros are really just for math-mode commands. This is why LyX
does not convert preamble definitions to "math-macros" - is just does not
know whether they are math-mode or text-mode (or both). (See your list below
for a mix of math-mode and text-mode commands.)

Also, math-macros are document specific - defining a math-macro in one
document does not make it available in other ones. This is why my
documents include a file of commonly used math macros -- just like I
\input a file with commonly used preamble definitions in my LaTeX
documents.

> Import also seems to forget a lot of small things like "^{}, _{} " and
> matrix formats that are real work to fix.

Yes, there are many non-supported ways to write things in LaTeX.

> I've only got about 10 macros to get running, but LyX has fought me all
> the way.  I hope I'm in the wrong and working with basic concept errors
> someone could straighten out... and why doesn't LyX post at least one
> completely running imported mathy FILE example, rather than abstract
> principleswhile my excuse is a definite lack of interest in working
> with things that create more work than they save.  Frustrated by hours
> or wasted time, I probably seem cranky. 

I do understand your frustration. Please keep in mind that LyX is not an
enterprise solution promising "easy LaTeX for all" but a volunteer effort
to create a document processor that matches the expectations and ideals
of its developers with much input from the users. As such, it may be not
the right tool for you - at least it needs more patience for things that
might seem easy to you but are very complex from the point of a
programmer...

> In case I've not been too rude, here's some macros, which LyX gurus
> will not find profound; I will surely either convert with enthusiasm to
> LyX, or forbid all my students and contacts to ever touch it, depending
> on how the importing and exporting of latex with macros can be
> automated.

I hope you will come to a more tempered evaluation of the program.
Even if it is not the tool for you, it might be valuable for your
students.

> \newcommand{\ab}{\allowbreak} \newcommand{\bit}{\begin{itemize}}
> \newcommand{\eit}{\end{itemize}} \newcommand{\im}{\item}
> \newcommand{\be}{\begin{equation}} \newcommand{\ee}{\end{equation}}
> \newcommand{\ba}{\begin{eqnarray}} \newcommand{\ea}{\end{eqnarray}}
> \newcommand{\nn}{\nonumber} \renewcommand{\bf}{\textbf}

All of these are rather shortcut aliases for text mode. "math-macro" is not
the right thing to emulate them.
I would try to find out whether tex2lyx already can be configured to do a
back-replacement (e.g. \bf -> \textbf) before converting to LyX format or
write a simple search-and replace script to do this in a preprocessing step.

As you are not going to use these commands directly when writing in LyX,
there is no need for supporting the aliases.

> \newcommand{\ra}{\rightarrow} \newcommand{\NN}{\vec \nabla}
> \def\slasha#1{\setbox0=\hbox{$#1$}#1\hskip-\wd0\hbox 
> to\wd0{\hss\sl/\/\hss}}
> \def\slashb#1{\setbox0=\hbox{$#1$}#1\hskip-\wd0\dimen0=5pt\advance
> \dimen0 by-\ht0\advance\dimen0 by\dp0\lower0.5\dimen0\hbox
> to\wd0{\hss\sl/\/\hss}}

These are (as far as I can see) real math macros, hence it may be sensible
to define math-macros for them (if you want a "nice" look in LyX). However,
it is possible to use them "as is" in math 

Re: Math macros inside child documents

2011-05-11 Thread Guenter Milde
On 2011-05-10, Diego Queiroz wrote:

  For truly consistent behaviour, we would have to disable stand-alone
  compilation of documents setting a master (except for included (vs.
  input) documents).

 This is a strong restriction.

But the only one for truly consistent behaviour. If you want to export
stand-alone, uncheck the master setting.

 With this, in a document with thousand of pages I will obligated to
 generate all pages? I do not agree.

No, you can *include* the sub-documents and use the includeonly feature
to compile a subset of sub-documents where LaTeX will ensure
(almost) correct page numbers and references and LyX will use the
parent doc settings instead of the child-doc ones.

  Actually, I regularly compile stand-alone child docs (to save time on
  checking the appearance in the output). I have set up a stand-alone
  branch for math-macros and bibliography and I can live with the
  question marks in the references.

 This is another subject, but let's understand the question marks are a
 problem to be solved too.

This is solved by using include and includeonly instead of
stand-alone compilation.
I do not think that LyX must re-implement this feature.

 I think it would be good if LyX doesn't generate so much errors, 

Actually, *you* generate the error -- a reference to a label that does
not exist in the document. Setting a master (currently) is just an
editing hint but does not change the way a document is compiled
stand-alone.

Maybe there could be better visual feedback in
LyX, but this requires that the buffer is aware of the intended use:

a) compile the master
b) compile the master but includeonly the child
c) compile the child stand-alone

Maybe a configurable default-action for the compile buttons (and View...
menu items) could trigger the matching feedback in the buffer.
(With the default-default action for documents that set the master and 

   are input- a)
   are included - b)
)

 but I vote against the generation of documents with wrong content
 (i.e. the question marks). Otherwise, LyX could not stop on the first
 error, as it already do today. That is, currently, if a error is found,
 LyX just stops and warns the user. Even if the document can still be
 generated by LaTeX. We didn't define LyX to just continue and see what
 you get because we don't want this, right?

I am not sure about this. If I remember right, the LaTeX run is done in
nonstopmode but the output not opened in a viewer - I'd like a
show output anyway button in the error message dialogue. Having
a look at the output is sometimes far more helpful than TeX error
messages.

 In the worst case, I'm in favor of a warning to the user about these wrong
 things.

I prefer this continue but warn, so that e.g. unresolved references
[??] do not go unnoticed but do not prevent me from checking page breaks
or the position of floats.

...

Günter



Re: Math macros inside child documents

2011-05-11 Thread Diego Queiroz

 But the only one for truly consistent behaviour. If you want to export
 stand-alone, uncheck the master setting.


Even if the master setting is not set in the child, LyX still display all
macros perfectly if the master document is open.
My complaint is this: if LyX is able to interpret things and display them in
the editor, it should be able to generate the output. That's all.
Specially if this problem is not present in older versions.

No, you can *include* the sub-documents and use the includeonly feature
 to compile a subset of sub-documents where LaTeX will ensure
 (almost) correct page numbers and references and LyX will use the
 parent doc settings instead of the child-doc ones.


What happens when you set the include only option?
The whole document is generated and the pages are ommited or it handle the
pages in a more fashioned way?

I am asking this because, if LyX handles it in a good way, we can change the
action of the view button of child docs to automatically generate the master
document including only the active document. This appears suitable for me
and is better than blocking.


 Actually, *you* generate the error -- a reference to a label that does
 not exist in the document. Setting a master (currently) is just an
 editing hint but does not change the way a document is compiled
 stand-alone.


If LyX options were consistent, it won't let me generate such errors.
It doesn't really matter if I am responsible for them or not: computers are
here to handle problems we don't want to deal with, right? They are not here
to introduce another class of problems (although I agree this is not always
true :-) .


 I am not sure about this. If I remember right, the LaTeX run is done in
 nonstopmode but the output not opened in a viewer - I'd like a
 show output anyway button in the error message dialogue. Having
 a look at the output is sometimes far more helpful than TeX error
 messages.


A show output anyway button would be great.
However, if LyX consistency were assured, there's no need for it (expect
when using ERT).

---
Diego Queiroz


Re: Math macros inside child documents

2011-05-11 Thread Guenter Milde
On 2011-05-11, Diego Queiroz wrote:

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


 But the only one for truly consistent behaviour. If you want to export
 stand-alone, uncheck the master setting.

 Even if the master setting is not set in the child, LyX still display all
 macros perfectly if the master document is open.

This is a bug. (Around LyX 1.4, math-macros were resolved in any
open buffer - related or not.)

 My complaint is this: if LyX is able to interpret things and display them in
 the editor, it should be able to generate the output. That's all.
 Specially if this problem is not present in older versions.

Oh no. If LyX is able to interpret a label defined in some other
document but not in the current one, I would not expect this to work
in LaTeX. Why should math-macros be different?

 No, you can *include* the sub-documents and use the includeonly feature
 to compile a subset of sub-documents where LaTeX will ensure
 (almost) correct page numbers and references and LyX will use the
 parent doc settings instead of the child-doc ones.

 What happens when you set the include only option?
 The whole document is generated and the pages are ommited or it handle the
 pages in a more fashioned way?

TeX \include is specially designed for the master/child concept. Read
about it in the (La)TeX docs.
http://www.tex.ac.uk/cgi-bin/texfaq2html?label=include

 I am asking this because, if LyX handles it in a good way, we can
 change the action of the view button of child docs to automatically
 generate the master document including only the active document. This
 appears suitable for me and is better than blocking.

This was my suggestion for included documents setting a master, while
input document setting a master would defaut to compile/view/export
master. However, I also suggested to use this as *defaults* - allowing
the user to override the consistent behaviour in favour of flexibility.


 Actually, *you* generate the error -- a reference to a label that does
 not exist in the document. Setting a master (currently) is just an
 editing hint but does not change the way a document is compiled
 stand-alone.

 If LyX options were consistent, it won't let me generate such errors.

This is why I wrote what needed to be done for true/strong consistency:
you cannot compile a *.tex document designed for inclusion as a
stand-alone document.

I prefer to live with some amount of inconsistency because otherwise I
would have to use ERT for references to labels I know exist but LyX
doesn't.

 A show output anyway button would be great.
 However, if LyX consistency were assured, there's no need for it (expect
 when using ERT).

... or the LaTeX preamble or an outdated TeX distribution or a package
combination with conflicts or ...

Günter




Re: Math macros inside child documents

2011-05-11 Thread Diego Queiroz

  A show output anyway button would be great.
  However, if LyX consistency were assured, there's no need for it (expect
  when using ERT).

 ... or the LaTeX preamble (1) or an outdated TeX distribution (2) or a
 package
 combination with conflicts (3) or ... (?)

 Günter


I repeat: if, and only if, LyX consistency were assured, there's no need for
such option (except when using ERT).

What means:
1) In LyX, the LaTeX preamble is an alternative to ERT but it has the same
purpose. So any LaTeX code in LyX will always be a problem to consistency.
If this is your point, I agree with you.
2) In an ideal scenario, LyX could check the LaTeX distribution to see what
resources are available. So an outdated LaTeX should not be a problem.
3) Currently LyX already handles many known packages conflicts. Since
all LyX resources are packages mapped to menu commands, every new package to
be supported should be checked for possible conflicts with all the existent
ones. When this is not possible, LyX should handle the problem in some way
(like preventing the user of using them together).
?) Since these problems are solved, I cannot imagine another problem that is
not related to ERT, file corruption and hardware problems. Otherwise, LyX
can handle it.

Actually, ERTs does exist only to keep LyX flexible, but the ERT goes
against its proposal.


Anyway, let's give up this discussion. It is leading to nowhere.
We're flaming the mailing list. Sorry for this.
---
Diego Queiroz


Re: Math macros inside child documents

2011-05-11 Thread Guenter Milde
On 2011-05-10, Diego Queiroz wrote:

  For truly consistent behaviour, we would have to disable stand-alone
  compilation of documents setting a master (except for included (vs.
  input) documents).

 This is a strong restriction.

But the only one for truly consistent behaviour. If you want to export
stand-alone, uncheck the master setting.

 With this, in a document with thousand of pages I will obligated to
 generate all pages? I do not agree.

No, you can *include* the sub-documents and use the includeonly feature
to compile a subset of sub-documents where LaTeX will ensure
(almost) correct page numbers and references and LyX will use the
parent doc settings instead of the child-doc ones.

  Actually, I regularly compile stand-alone child docs (to save time on
  checking the appearance in the output). I have set up a stand-alone
  branch for math-macros and bibliography and I can live with the
  question marks in the references.

 This is another subject, but let's understand the question marks are a
 problem to be solved too.

This is solved by using include and includeonly instead of
stand-alone compilation.
I do not think that LyX must re-implement this feature.

 I think it would be good if LyX doesn't generate so much errors, 

Actually, *you* generate the error -- a reference to a label that does
not exist in the document. Setting a master (currently) is just an
editing hint but does not change the way a document is compiled
stand-alone.

Maybe there could be better visual feedback in
LyX, but this requires that the buffer is aware of the intended use:

a) compile the master
b) compile the master but includeonly the child
c) compile the child stand-alone

Maybe a configurable default-action for the compile buttons (and View...
menu items) could trigger the matching feedback in the buffer.
(With the default-default action for documents that set the master and 

   are input- a)
   are included - b)
)

 but I vote against the generation of documents with wrong content
 (i.e. the question marks). Otherwise, LyX could not stop on the first
 error, as it already do today. That is, currently, if a error is found,
 LyX just stops and warns the user. Even if the document can still be
 generated by LaTeX. We didn't define LyX to just continue and see what
 you get because we don't want this, right?

I am not sure about this. If I remember right, the LaTeX run is done in
nonstopmode but the output not opened in a viewer - I'd like a
show output anyway button in the error message dialogue. Having
a look at the output is sometimes far more helpful than TeX error
messages.

 In the worst case, I'm in favor of a warning to the user about these wrong
 things.

I prefer this continue but warn, so that e.g. unresolved references
[??] do not go unnoticed but do not prevent me from checking page breaks
or the position of floats.

...

Günter



Re: Math macros inside child documents

2011-05-11 Thread Diego Queiroz

 But the only one for truly consistent behaviour. If you want to export
 stand-alone, uncheck the master setting.


Even if the master setting is not set in the child, LyX still display all
macros perfectly if the master document is open.
My complaint is this: if LyX is able to interpret things and display them in
the editor, it should be able to generate the output. That's all.
Specially if this problem is not present in older versions.

No, you can *include* the sub-documents and use the includeonly feature
 to compile a subset of sub-documents where LaTeX will ensure
 (almost) correct page numbers and references and LyX will use the
 parent doc settings instead of the child-doc ones.


What happens when you set the include only option?
The whole document is generated and the pages are ommited or it handle the
pages in a more fashioned way?

I am asking this because, if LyX handles it in a good way, we can change the
action of the view button of child docs to automatically generate the master
document including only the active document. This appears suitable for me
and is better than blocking.


 Actually, *you* generate the error -- a reference to a label that does
 not exist in the document. Setting a master (currently) is just an
 editing hint but does not change the way a document is compiled
 stand-alone.


If LyX options were consistent, it won't let me generate such errors.
It doesn't really matter if I am responsible for them or not: computers are
here to handle problems we don't want to deal with, right? They are not here
to introduce another class of problems (although I agree this is not always
true :-) .


 I am not sure about this. If I remember right, the LaTeX run is done in
 nonstopmode but the output not opened in a viewer - I'd like a
 show output anyway button in the error message dialogue. Having
 a look at the output is sometimes far more helpful than TeX error
 messages.


A show output anyway button would be great.
However, if LyX consistency were assured, there's no need for it (expect
when using ERT).

---
Diego Queiroz


Re: Math macros inside child documents

2011-05-11 Thread Guenter Milde
On 2011-05-11, Diego Queiroz wrote:

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


 But the only one for truly consistent behaviour. If you want to export
 stand-alone, uncheck the master setting.

 Even if the master setting is not set in the child, LyX still display all
 macros perfectly if the master document is open.

This is a bug. (Around LyX 1.4, math-macros were resolved in any
open buffer - related or not.)

 My complaint is this: if LyX is able to interpret things and display them in
 the editor, it should be able to generate the output. That's all.
 Specially if this problem is not present in older versions.

Oh no. If LyX is able to interpret a label defined in some other
document but not in the current one, I would not expect this to work
in LaTeX. Why should math-macros be different?

 No, you can *include* the sub-documents and use the includeonly feature
 to compile a subset of sub-documents where LaTeX will ensure
 (almost) correct page numbers and references and LyX will use the
 parent doc settings instead of the child-doc ones.

 What happens when you set the include only option?
 The whole document is generated and the pages are ommited or it handle the
 pages in a more fashioned way?

TeX \include is specially designed for the master/child concept. Read
about it in the (La)TeX docs.
http://www.tex.ac.uk/cgi-bin/texfaq2html?label=include

 I am asking this because, if LyX handles it in a good way, we can
 change the action of the view button of child docs to automatically
 generate the master document including only the active document. This
 appears suitable for me and is better than blocking.

This was my suggestion for included documents setting a master, while
input document setting a master would defaut to compile/view/export
master. However, I also suggested to use this as *defaults* - allowing
the user to override the consistent behaviour in favour of flexibility.


 Actually, *you* generate the error -- a reference to a label that does
 not exist in the document. Setting a master (currently) is just an
 editing hint but does not change the way a document is compiled
 stand-alone.

 If LyX options were consistent, it won't let me generate such errors.

This is why I wrote what needed to be done for true/strong consistency:
you cannot compile a *.tex document designed for inclusion as a
stand-alone document.

I prefer to live with some amount of inconsistency because otherwise I
would have to use ERT for references to labels I know exist but LyX
doesn't.

 A show output anyway button would be great.
 However, if LyX consistency were assured, there's no need for it (expect
 when using ERT).

... or the LaTeX preamble or an outdated TeX distribution or a package
combination with conflicts or ...

Günter




Re: Math macros inside child documents

2011-05-11 Thread Diego Queiroz

  A show output anyway button would be great.
  However, if LyX consistency were assured, there's no need for it (expect
  when using ERT).

 ... or the LaTeX preamble (1) or an outdated TeX distribution (2) or a
 package
 combination with conflicts (3) or ... (?)

 Günter


I repeat: if, and only if, LyX consistency were assured, there's no need for
such option (except when using ERT).

What means:
1) In LyX, the LaTeX preamble is an alternative to ERT but it has the same
purpose. So any LaTeX code in LyX will always be a problem to consistency.
If this is your point, I agree with you.
2) In an ideal scenario, LyX could check the LaTeX distribution to see what
resources are available. So an outdated LaTeX should not be a problem.
3) Currently LyX already handles many known packages conflicts. Since
all LyX resources are packages mapped to menu commands, every new package to
be supported should be checked for possible conflicts with all the existent
ones. When this is not possible, LyX should handle the problem in some way
(like preventing the user of using them together).
?) Since these problems are solved, I cannot imagine another problem that is
not related to ERT, file corruption and hardware problems. Otherwise, LyX
can handle it.

Actually, ERTs does exist only to keep LyX flexible, but the ERT goes
against its proposal.


Anyway, let's give up this discussion. It is leading to nowhere.
We're flaming the mailing list. Sorry for this.
---
Diego Queiroz


Re: Math macros inside child documents

2011-05-11 Thread Guenter Milde
On 2011-05-10, Diego Queiroz wrote:

>> >>> For truly consistent behaviour, we would have to disable stand-alone
>> >>> compilation of documents setting a master (except for "included" (vs.
>> >>> "input") documents).

> This is a strong restriction.

But the only one for truly consistent behaviour. If you want to export
stand-alone, uncheck the master setting.

> With this, in a document with thousand of pages I will obligated to
> generate all pages? I do not agree.

No, you can *include* the sub-documents and use the includeonly feature
to compile a subset of sub-documents where LaTeX will ensure
(almost) correct page numbers and references and LyX will use the
parent doc settings instead of the child-doc ones.

>> > Actually, I regularly compile stand-alone child docs (to save time on
>> > checking the appearance in the output). I have set up a "stand-alone"
>> > branch for math-macros and bibliography and I can live with the
>> > question marks in the references.

> This is another subject, but let's understand the question marks are a
> problem to be solved too.

This is solved by using "include" and "includeonly" instead of
stand-alone compilation.
I do not think that LyX must re-implement this feature.

> I think it would be good if LyX doesn't generate so much errors, 

Actually, *you* generate the error -- a reference to a label that does
not exist in the document. Setting a master (currently) is just an
"editing hint" but does not change the way a document is compiled
stand-alone.

Maybe there could be better visual feedback in
LyX, but this requires that the buffer is aware of the intended use:

a) compile the master
b) compile the master but "includeonly" the child
c) compile the child stand-alone

Maybe a configurable default-action for the compile buttons (and View>...
menu items) could trigger the matching feedback in the buffer.
(With the default-default action for documents that set the master and 

   are input-> a)
   are included -> b)
)

> but I vote against the generation of documents with "wrong" content
> (i.e. the question marks). Otherwise, LyX could not stop on the first
> error, as it already do today. That is, currently, if a error is found,
> LyX just stops and warns the user. Even if the document can still be
> generated by LaTeX. We didn't define LyX to "just continue and see what
> you get" because we don't want this, right?

I am not sure about this. If I remember right, the LaTeX run is done in
nonstopmode but the output not opened in a viewer -> I'd like a
"show output anyway" button in the error message dialogue. Having
a look at the output is sometimes far more helpful than TeX error
messages.

> In the worst case, I'm in favor of a warning to the user about these "wrong"
> things.

I prefer this "continue but warn", so that e.g. unresolved references
[??] do not go unnoticed but do not prevent me from checking page breaks
or the position of floats.

...

Günter



Re: Math macros inside child documents

2011-05-11 Thread Diego Queiroz
>
> But the only one for truly consistent behaviour. If you want to export
> stand-alone, uncheck the master setting.
>

Even if the master setting is not set in the child, LyX still display all
macros perfectly if the master document is open.
My complaint is this: if LyX is able to interpret things and display them in
the editor, it should be able to generate the output. That's all.
Specially if this problem is not present in older versions.

No, you can *include* the sub-documents and use the includeonly feature
> to compile a subset of sub-documents where LaTeX will ensure
> (almost) correct page numbers and references and LyX will use the
> parent doc settings instead of the child-doc ones.
>

What happens when you set the include only option?
The whole document is generated and the pages are ommited or it handle the
pages in a more fashioned way?

I am asking this because, if LyX handles it in a good way, we can change the
action of the view button of child docs to automatically generate the master
document including only the active document. This appears suitable for me
and is better than blocking.


> Actually, *you* generate the error -- a reference to a label that does
> not exist in the document. Setting a master (currently) is just an
> "editing hint" but does not change the way a document is compiled
> stand-alone.
>

If LyX options were consistent, it won't let me generate such errors.
It doesn't really matter if I am responsible for them or not: computers are
here to handle problems we don't want to deal with, right? They are not here
to introduce another class of problems (although I agree this is not always
true :-) .


> I am not sure about this. If I remember right, the LaTeX run is done in
> nonstopmode but the output not opened in a viewer -> I'd like a
> "show output anyway" button in the error message dialogue. Having
> a look at the output is sometimes far more helpful than TeX error
> messages.
>

A "show output anyway" button would be great.
However, if LyX consistency were assured, there's no need for it (expect
when using ERT).

---
Diego Queiroz


Re: Math macros inside child documents

2011-05-11 Thread Guenter Milde
On 2011-05-11, Diego Queiroz wrote:

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


>> But the only one for truly consistent behaviour. If you want to export
>> stand-alone, uncheck the master setting.

> Even if the master setting is not set in the child, LyX still display all
> macros perfectly if the master document is open.

This is a bug. (Around LyX 1.4, math-macros were resolved in any
open buffer - related or not.)

> My complaint is this: if LyX is able to interpret things and display them in
> the editor, it should be able to generate the output. That's all.
> Specially if this problem is not present in older versions.

Oh no. If LyX is able to interpret a label defined in some other
document but not in the current one, I would not expect this to work
in LaTeX. Why should math-macros be different?

>> No, you can *include* the sub-documents and use the includeonly feature
>> to compile a subset of sub-documents where LaTeX will ensure
>> (almost) correct page numbers and references and LyX will use the
>> parent doc settings instead of the child-doc ones.

> What happens when you set the include only option?
> The whole document is generated and the pages are ommited or it handle the
> pages in a more fashioned way?

TeX \include is specially designed for the master/child concept. Read
about it in the (La)TeX docs.
http://www.tex.ac.uk/cgi-bin/texfaq2html?label=include

> I am asking this because, if LyX handles it in a good way, we can
> change the action of the view button of child docs to automatically
> generate the master document including only the active document. This
> appears suitable for me and is better than blocking.

This was my suggestion for included documents setting a master, while
input document setting a master would defaut to "compile/view/export
master". However, I also suggested to use this as *defaults* - allowing
the user to override the "consistent" behaviour in favour of flexibility.


>> Actually, *you* generate the error -- a reference to a label that does
>> not exist in the document. Setting a master (currently) is just an
>> "editing hint" but does not change the way a document is compiled
>> stand-alone.

> If LyX options were consistent, it won't let me generate such errors.

This is why I wrote what needed to be done for true/strong consistency:
you cannot compile a *.tex document designed for inclusion as a
stand-alone document.

I prefer to live with some amount of inconsistency because otherwise I
would have to use ERT for references to labels I know exist but LyX
doesn't.

> A "show output anyway" button would be great.
> However, if LyX consistency were assured, there's no need for it (expect
> when using ERT).

... or the LaTeX preamble or an outdated TeX distribution or a package
combination with conflicts or ...

Günter




Re: Math macros inside child documents

2011-05-11 Thread Diego Queiroz
>
> > A "show output anyway" button would be great.
> > However, if LyX consistency were assured, there's no need for it (expect
> > when using ERT).
>
> ... or the LaTeX preamble (1) or an outdated TeX distribution (2) or a
> package
> combination with conflicts (3) or ... (?)
>
> Günter
>

I repeat: if, and only if, LyX consistency were assured, there's no need for
such option (except when using ERT).

What means:
1) In LyX, the LaTeX preamble is an alternative to ERT but it has the same
purpose. So any LaTeX code in LyX will always be a problem to consistency.
If this is your point, I agree with you.
2) In an ideal scenario, LyX could check the LaTeX distribution to see what
resources are available. So an outdated LaTeX should not be a problem.
3) Currently LyX already handles many known packages conflicts. Since
all LyX resources are packages mapped to menu commands, every new package to
be supported should be checked for possible conflicts with all the existent
ones. When this is not possible, LyX should handle the problem in some way
(like preventing the user of using them together).
?) Since these problems are solved, I cannot imagine another problem that is
not related to ERT, file corruption and hardware problems. Otherwise, LyX
can handle it.

Actually, ERTs does exist only to keep LyX flexible, but the ERT goes
against its proposal.


Anyway, let's give up this discussion. It is leading to nowhere.
We're flaming the mailing list. Sorry for this.
---
Diego Queiroz


Re: Math macros inside child documents

2011-05-10 Thread Guenter Milde
On 2011-05-09, Diego Queiroz wrote:


 But what if you really want to compile it as a standalone document?
 People do this.

 Richard


 But if it was really a standalone document, I would have to unset master
 document property, right?

...

 I am just looking for a more user oriented behavior. I mean, if I can see
 everything right on the screen, what's the problem?
 This is how I feel about the current behavior. LyX is handling everything on
 the editor, since all math macros are interpreted correctly when I open any
 document, but I can't generate the file because of its internal structure.

 We should try to avoid consistency errors in LyX. If people decide to use
 ERT, we should expect unwanted behavior, but in a document using only LyX
 resources, it must never generate errors (or they should be rare, at least),
 doesn't matter what the user decides to do.

For truly consistent behaviour, we would have to disable stand-alone
compilation of documents setting a master (except for included (vs.
input) documents).

Günter



Re: Math macros inside child documents

2011-05-10 Thread Jürgen Spitzmüller
Guenter Milde wrote:
 For truly consistent behaviour, we would have to disable stand-alone
 compilation of documents setting a master (except for included (vs.
 input) documents).

Why this? I have many documents with a master set that get compiled stand-
alone from time to time and should _not_ inherit anything from the master 
then.

Jürgen


Re: Math macros inside child documents

2011-05-10 Thread Guenter Milde
On 2011-05-10, Jürgen Spitzmüller wrote:
 Guenter Milde wrote:
 For truly consistent behaviour, we would have to disable stand-alone
 compilation of documents setting a master (except for included (vs.
 input) documents).

 Why this? I have many documents with a master set that get compiled stand-
 alone from time to time and should _not_ inherit anything from the master 
 then.

Because the OP complained that it is incosistent to show math-macro
expansions in the child doc but not make them available in stand-alone
compilation.

The same argument would hold for references to sections, equations,
tables and figures in other parts of the document.

Actually, I regularly compile stand-alone child docs (to save time on
checking the appearance in the output). I have set up a stand-alone
branch for math-macros and bibliography and I can live with the
question marks in the references. 

The above was just stating the pure solution to the OPs report.
However, I vote to keep things as-is, because: practicality beats
purity. 

Just make it very clear in the documentation that parent-document
features are non-available in the child if compiled stand-alone (without
include feature) even if rendered in the LyX window - this is a feature.

(After switching to LyX 2 I will try with the include feature.)

Günter



Re: Math macros inside child documents

2011-05-10 Thread Richard Heck
On 05/10/2011 09:09 AM, Guenter Milde wrote:
 On 2011-05-10, Jürgen Spitzmüller wrote:
 Guenter Milde wrote:
 For truly consistent behaviour, we would have to disable stand-alone
 compilation of documents setting a master (except for included (vs.
 input) documents).
 Why this? I have many documents with a master set that get compiled stand-
 alone from time to time and should _not_ inherit anything from the master 
 then.
 Because the OP complained that it is incosistent to show math-macro
 expansions in the child doc but not make them available in stand-alone
 compilation.

 The same argument would hold for references to sections, equations,
 tables and figures in other parts of the document.

 Actually, I regularly compile stand-alone child docs (to save time on
 checking the appearance in the output). I have set up a stand-alone
 branch for math-macros and bibliography and I can live with the
 question marks in the references. 

 The above was just stating the pure solution to the OPs report.
 However, I vote to keep things as-is, because: practicality beats
 purity. 

 Just make it very clear in the documentation that parent-document
 features are non-available in the child if compiled stand-alone (without
 include feature) even if rendered in the LyX window - this is a feature.

We did establish that this is a change from 1.6.x, where parent macros
are written to the child. That was not intentional, and the behavior
depends upon the setting of EXPORT_IN_THREAD. We can keep it as it is,
but then we should make it consistent (and could remove useless code).

Richard



Re: Math macros inside child documents

2011-05-10 Thread Diego Queiroz

  For truly consistent behaviour, we would have to disable stand-alone
  compilation of documents setting a master (except for included (vs.
  input) documents).


This is a strong restriction.
With this, in a document with thousand of pages I will obligated to generate
all pages?
I do not agree.


  Actually, I regularly compile stand-alone child docs (to save time on
  checking the appearance in the output). I have set up a stand-alone
  branch for math-macros and bibliography and I can live with the
  question marks in the references.


This is another subject, but let's understand the question marks are a
problem to be solved too.
I think it would be good if LyX doesn't generate so much errors, but I vote
against the generation of documents with wrong content (i.e. the question
marks).
Otherwise, LyX could not stop on the first error, as it already do today.
That is, currently, if a error is found, LyX just stops and warns the user.
Even if the document can still be generated by LaTeX.
We didn't define LyX to just continue and see what you get because we
don't want this, right?

In the worst case, I'm in favor of a warning to the user about these wrong
things.
One reason is because I already submited a work with those ??. My fault
indeed, but LyX could warn me anyway. ;-)


  Just make it very clear in the documentation that parent-document
  features are non-available in the child if compiled stand-alone (without
  include feature) even if rendered in the LyX window - this is a feature.
 
 We did establish that this is a change from 1.6.x, where parent macros
 are written to the child. That was not intentional, and the behavior
 depends upon the setting of EXPORT_IN_THREAD. We can keep it as it is,
 but then we should make it consistent (and could remove useless code).


There are two things to note here:
1st: LyX interprets macros very well. It doesn't matter where they are
(child/master/etc). If the documents are linked, LyX handles it in the
screen. Fact. IMO, if it handles the content to the screen it should handle
to the output.

2nd: AFAIK this feature was supported in later versions (I did not tested by
myself, but people in this thread said it work). I won't be surprised if
someone decide to stay with LyX 1.6 just because this feature was removed.
Or just because I am not able to compile my old doc anymore or any other
complaints.


Cheers,
---
Diego Queiroz


Re: Math macros inside child documents

2011-05-10 Thread Guenter Milde
On 2011-05-09, Diego Queiroz wrote:


 But what if you really want to compile it as a standalone document?
 People do this.

 Richard


 But if it was really a standalone document, I would have to unset master
 document property, right?

...

 I am just looking for a more user oriented behavior. I mean, if I can see
 everything right on the screen, what's the problem?
 This is how I feel about the current behavior. LyX is handling everything on
 the editor, since all math macros are interpreted correctly when I open any
 document, but I can't generate the file because of its internal structure.

 We should try to avoid consistency errors in LyX. If people decide to use
 ERT, we should expect unwanted behavior, but in a document using only LyX
 resources, it must never generate errors (or they should be rare, at least),
 doesn't matter what the user decides to do.

For truly consistent behaviour, we would have to disable stand-alone
compilation of documents setting a master (except for included (vs.
input) documents).

Günter



Re: Math macros inside child documents

2011-05-10 Thread Jürgen Spitzmüller
Guenter Milde wrote:
 For truly consistent behaviour, we would have to disable stand-alone
 compilation of documents setting a master (except for included (vs.
 input) documents).

Why this? I have many documents with a master set that get compiled stand-
alone from time to time and should _not_ inherit anything from the master 
then.

Jürgen


Re: Math macros inside child documents

2011-05-10 Thread Guenter Milde
On 2011-05-10, Jürgen Spitzmüller wrote:
 Guenter Milde wrote:
 For truly consistent behaviour, we would have to disable stand-alone
 compilation of documents setting a master (except for included (vs.
 input) documents).

 Why this? I have many documents with a master set that get compiled stand-
 alone from time to time and should _not_ inherit anything from the master 
 then.

Because the OP complained that it is incosistent to show math-macro
expansions in the child doc but not make them available in stand-alone
compilation.

The same argument would hold for references to sections, equations,
tables and figures in other parts of the document.

Actually, I regularly compile stand-alone child docs (to save time on
checking the appearance in the output). I have set up a stand-alone
branch for math-macros and bibliography and I can live with the
question marks in the references. 

The above was just stating the pure solution to the OPs report.
However, I vote to keep things as-is, because: practicality beats
purity. 

Just make it very clear in the documentation that parent-document
features are non-available in the child if compiled stand-alone (without
include feature) even if rendered in the LyX window - this is a feature.

(After switching to LyX 2 I will try with the include feature.)

Günter



Re: Math macros inside child documents

2011-05-10 Thread Richard Heck
On 05/10/2011 09:09 AM, Guenter Milde wrote:
 On 2011-05-10, Jürgen Spitzmüller wrote:
 Guenter Milde wrote:
 For truly consistent behaviour, we would have to disable stand-alone
 compilation of documents setting a master (except for included (vs.
 input) documents).
 Why this? I have many documents with a master set that get compiled stand-
 alone from time to time and should _not_ inherit anything from the master 
 then.
 Because the OP complained that it is incosistent to show math-macro
 expansions in the child doc but not make them available in stand-alone
 compilation.

 The same argument would hold for references to sections, equations,
 tables and figures in other parts of the document.

 Actually, I regularly compile stand-alone child docs (to save time on
 checking the appearance in the output). I have set up a stand-alone
 branch for math-macros and bibliography and I can live with the
 question marks in the references. 

 The above was just stating the pure solution to the OPs report.
 However, I vote to keep things as-is, because: practicality beats
 purity. 

 Just make it very clear in the documentation that parent-document
 features are non-available in the child if compiled stand-alone (without
 include feature) even if rendered in the LyX window - this is a feature.

We did establish that this is a change from 1.6.x, where parent macros
are written to the child. That was not intentional, and the behavior
depends upon the setting of EXPORT_IN_THREAD. We can keep it as it is,
but then we should make it consistent (and could remove useless code).

Richard



Re: Math macros inside child documents

2011-05-10 Thread Diego Queiroz

  For truly consistent behaviour, we would have to disable stand-alone
  compilation of documents setting a master (except for included (vs.
  input) documents).


This is a strong restriction.
With this, in a document with thousand of pages I will obligated to generate
all pages?
I do not agree.


  Actually, I regularly compile stand-alone child docs (to save time on
  checking the appearance in the output). I have set up a stand-alone
  branch for math-macros and bibliography and I can live with the
  question marks in the references.


This is another subject, but let's understand the question marks are a
problem to be solved too.
I think it would be good if LyX doesn't generate so much errors, but I vote
against the generation of documents with wrong content (i.e. the question
marks).
Otherwise, LyX could not stop on the first error, as it already do today.
That is, currently, if a error is found, LyX just stops and warns the user.
Even if the document can still be generated by LaTeX.
We didn't define LyX to just continue and see what you get because we
don't want this, right?

In the worst case, I'm in favor of a warning to the user about these wrong
things.
One reason is because I already submited a work with those ??. My fault
indeed, but LyX could warn me anyway. ;-)


  Just make it very clear in the documentation that parent-document
  features are non-available in the child if compiled stand-alone (without
  include feature) even if rendered in the LyX window - this is a feature.
 
 We did establish that this is a change from 1.6.x, where parent macros
 are written to the child. That was not intentional, and the behavior
 depends upon the setting of EXPORT_IN_THREAD. We can keep it as it is,
 but then we should make it consistent (and could remove useless code).


There are two things to note here:
1st: LyX interprets macros very well. It doesn't matter where they are
(child/master/etc). If the documents are linked, LyX handles it in the
screen. Fact. IMO, if it handles the content to the screen it should handle
to the output.

2nd: AFAIK this feature was supported in later versions (I did not tested by
myself, but people in this thread said it work). I won't be surprised if
someone decide to stay with LyX 1.6 just because this feature was removed.
Or just because I am not able to compile my old doc anymore or any other
complaints.


Cheers,
---
Diego Queiroz


Re: Math macros inside child documents

2011-05-10 Thread Guenter Milde
On 2011-05-09, Diego Queiroz wrote:


>> But what if you really want to compile it as a standalone document?
>> People do this.

>> Richard


> But if it was really a standalone document, I would have to unset master
> document property, right?

...

> I am just looking for a more "user oriented behavior". I mean, "if I can see
> everything right on the screen, what's the problem?"
> This is how I feel about the current behavior. LyX is handling everything on
> the editor, since all math macros are interpreted correctly when I open any
> document, but I can't generate the file because of its internal structure.

> We should try to avoid consistency errors in LyX. If people decide to use
> ERT, we should expect unwanted behavior, but in a document using only LyX
> resources, it must never generate errors (or they should be rare, at least),
> doesn't matter what the user decides to do.

For truly consistent behaviour, we would have to disable stand-alone
compilation of documents setting a master (except for "included" (vs.
"input") documents).

Günter



Re: Math macros inside child documents

2011-05-10 Thread Jürgen Spitzmüller
Guenter Milde wrote:
> For truly consistent behaviour, we would have to disable stand-alone
> compilation of documents setting a master (except for "included" (vs.
> "input") documents).

Why this? I have many documents with a master set that get compiled stand-
alone from time to time and should _not_ inherit anything from the master 
then.

Jürgen


Re: Math macros inside child documents

2011-05-10 Thread Guenter Milde
On 2011-05-10, Jürgen Spitzmüller wrote:
> Guenter Milde wrote:
>> For truly consistent behaviour, we would have to disable stand-alone
>> compilation of documents setting a master (except for "included" (vs.
>> "input") documents).

> Why this? I have many documents with a master set that get compiled stand-
> alone from time to time and should _not_ inherit anything from the master 
> then.

Because the OP complained that it is incosistent to show math-macro
expansions in the child doc but not make them available in stand-alone
compilation.

The same argument would hold for references to sections, equations,
tables and figures in other parts of the document.

Actually, I regularly compile stand-alone child docs (to save time on
checking the appearance in the output). I have set up a "stand-alone"
branch for math-macros and bibliography and I can live with the
question marks in the references. 

The above was just stating the "pure" solution to the OPs report.
However, I vote to keep things as-is, because: "practicality beats
purity". 

Just make it very clear in the documentation that parent-document
features are non-available in the child if compiled stand-alone (without
include feature) even if rendered in the LyX window - this is a feature.

(After switching to LyX 2 I will try with the include feature.)

Günter



Re: Math macros inside child documents

2011-05-10 Thread Richard Heck
On 05/10/2011 09:09 AM, Guenter Milde wrote:
> On 2011-05-10, Jürgen Spitzmüller wrote:
>> Guenter Milde wrote:
>>> For truly consistent behaviour, we would have to disable stand-alone
>>> compilation of documents setting a master (except for "included" (vs.
>>> "input") documents).
>> Why this? I have many documents with a master set that get compiled stand-
>> alone from time to time and should _not_ inherit anything from the master 
>> then.
> Because the OP complained that it is incosistent to show math-macro
> expansions in the child doc but not make them available in stand-alone
> compilation.
>
> The same argument would hold for references to sections, equations,
> tables and figures in other parts of the document.
>
> Actually, I regularly compile stand-alone child docs (to save time on
> checking the appearance in the output). I have set up a "stand-alone"
> branch for math-macros and bibliography and I can live with the
> question marks in the references. 
>
> The above was just stating the "pure" solution to the OPs report.
> However, I vote to keep things as-is, because: "practicality beats
> purity". 
>
> Just make it very clear in the documentation that parent-document
> features are non-available in the child if compiled stand-alone (without
> include feature) even if rendered in the LyX window - this is a feature.
>
We did establish that this is a change from 1.6.x, where parent macros
are written to the child. That was not intentional, and the behavior
depends upon the setting of EXPORT_IN_THREAD. We can keep it as it is,
but then we should make it consistent (and could remove useless code).

Richard



Re: Math macros inside child documents

2011-05-10 Thread Diego Queiroz
>
> >>> For truly consistent behaviour, we would have to disable stand-alone
> >>> compilation of documents setting a master (except for "included" (vs.
> >>> "input") documents).
>

This is a strong restriction.
With this, in a document with thousand of pages I will obligated to generate
all pages?
I do not agree.


> > Actually, I regularly compile stand-alone child docs (to save time on
> > checking the appearance in the output). I have set up a "stand-alone"
> > branch for math-macros and bibliography and I can live with the
> > question marks in the references.
>

This is another subject, but let's understand the question marks are a
problem to be solved too.
I think it would be good if LyX doesn't generate so much errors, but I vote
against the generation of documents with "wrong" content (i.e. the question
marks).
Otherwise, LyX could not stop on the first error, as it already do today.
That is, currently, if a error is found, LyX just stops and warns the user.
Even if the document can still be generated by LaTeX.
We didn't define LyX to "just continue and see what you get" because we
don't want this, right?

In the worst case, I'm in favor of a warning to the user about these "wrong"
things.
One reason is because I already submited a work with those "??". My fault
indeed, but LyX could warn me anyway. ;-)


> > Just make it very clear in the documentation that parent-document
> > features are non-available in the child if compiled stand-alone (without
> > include feature) even if rendered in the LyX window - this is a feature.
> >
> We did establish that this is a change from 1.6.x, where parent macros
> are written to the child. That was not intentional, and the behavior
> depends upon the setting of EXPORT_IN_THREAD. We can keep it as it is,
> but then we should make it consistent (and could remove useless code).


There are two things to note here:
1st: LyX interprets macros very well. It doesn't matter where they are
(child/master/etc). If the documents are linked, LyX handles it in the
screen. Fact. IMO, if it handles the content to the screen it should handle
to the output.

2nd: AFAIK this feature was supported in later versions (I did not tested by
myself, but people in this thread said it work). I won't be surprised if
someone decide to stay with LyX 1.6 just because this "feature" was removed.
Or just because "I am not able to compile my old doc anymore" or any other
complaints.


Cheers,
---
Diego Queiroz


Re: Math macros inside child documents

2011-05-09 Thread Richard Heck
On 05/09/2011 10:22 AM, Diego Queiroz wrote:
 I'm not sure if this is a bug report or a feature request. Probably the
 second one.

 In LyX it's ok to define a Math Macro in a Master document and use it in a
 child one. It's also ok to use math macros that are defined in a child and
 use it in other child document.

 In both cases, I am able to view the Master document and it handles
 everything perfectly.

 But if I do so, I am unable to compile the child document alone.
 AFAIK the reason is simple: the child document doesn't have the math macros
 defined on its scope. And it doesn't really matter if the default master
 document is set or not. It simple doesn't work (at least, I don't know how
 to do without insert the math macros again, which in painful).

 My suggestion is to allow the generation of the childs alone.
 While working in the document, it's normal to compile only parts of the
 document instead of compile the whole set, so this feature would be very
 handy.

If you ask to compile just the child, then you are asking to compile it
as a standalone document, so it is no surprise that this does not work.
If you want to compile just one chapter as part of a larger document,
then you need to use the \includeonly support, accessible from
DocumentSettings.

rh



Re: Math macros inside child documents

2011-05-09 Thread Diego Queiroz

 If you ask to compile just the child, then you are asking to compile it
  as a standalone document, so it is no surprise that this does not work.


Exactly. :-)


 If you want to compile just one chapter as part of a larger document,
 then you need to use the \includeonly support, accessible from
 DocumentSettings.


I was not aware of this feature. Thanks for the hint.

But it is also painful to select the document I want to compile everytime.
:/
When I am working in a document, I work on it as a standalone document, I
don't handle with the Master document before I want to compile the whole
set.

Of course there are several workarounds, i.e you can create a document with
all your macros and insert it on the beggining of all documents. This is a
not so elegant solution, but it does the job. Probably one can suggest a
better solution as well.

But I really think LyX can do this automatically.
Since LyX already stores all defined macros in somewhere for the editor, it
is not so hard to dinamically include them in a document when needed.

Cheers,
Diego


Re: Math macros inside child documents

2011-05-09 Thread Richard Heck
On 05/09/2011 11:05 AM, Diego Queiroz wrote:

 If you want to compile just one chapter as part of a larger document,
 then you need to use the \includeonly support, accessible from
 DocumentSettings.
 I was not aware of this feature. Thanks for the hint.

It's new in 2.0.0.

 But it is also painful to select the document I want to compile everytime.
 :/
 When I am working in a document, I work on it as a standalone document, I
 don't handle with the Master document before I want to compile the whole
 set.

 Of course there are several workarounds, i.e you can create a document with
 all your macros and insert it on the beggining of all documents. This is a
 not so elegant solution, but it does the job. Probably one can suggest a
 better solution as well.

 But I really think LyX can do this automatically.
 Since LyX already stores all defined macros in somewhere for the editor, it
 is not so hard to dinamically include them in a document when needed.

But what if you really want to compile it as a standalone document?
People do this.

Richard



Re: Math macros inside child documents

2011-05-09 Thread Diego Queiroz

 But what if you really want to compile it as a standalone document?
 People do this.

 Richard


But if it was really a standalone document, I would have to unset master
document property, right?

Anyway, in my case, the problem is that my child document with the macros
also define Nomenclatures. When I include it on all files and decide to
generate the Master document, the list of Nomenclatures repeats its entries
several times (obviously because the entry was indeed included several
times).

I am just looking for a more user oriented behavior. I mean, if I can see
everything right on the screen, what's the problem?
This is how I feel about the current behavior. LyX is handling everything on
the editor, since all math macros are interpreted correctly when I open any
document, but I can't generate the file because of its internal structure.

We should try to avoid consistency errors in LyX. If people decide to use
ERT, we should expect unwanted behavior, but in a document using only LyX
resources, it must never generate errors (or they should be rare, at least),
doesn't matter what the user decides to do.


Cheers,
Diego


Re: Math macros inside child documents

2011-05-09 Thread Julien Rioux

On 09/05/2011 10:22 AM, Diego Queiroz wrote:

I'm not sure if this is a bug report or a feature request. Probably the
second one.

In LyX it's ok to define a Math Macro in a Master document and use it in a
child one. It's also ok to use math macros that are defined in a child and
use it in other child document.

In both cases, I am able to view the Master document and it handles
everything perfectly.

But if I do so, I am unable to compile the child document alone.
AFAIK the reason is simple: the child document doesn't have the math macros
defined on its scope. And it doesn't really matter if the default master
document is set or not. It simple doesn't work (at least, I don't know how
to do without insert the math macros again, which in painful).

My suggestion is to allow the generation of the childs alone.
While working in the document, it's normal to compile only parts of the
document instead of compile the whole set, so this feature would be very
handy.


Regards,
---
Diego Queiroz



This works like a charm for me on 1.6.9 right now. My setup is

Thesis.lyx:
 Frontmatter stuff
 Include: LyX-macros.lyx
 Table of Contents
 List of Tables
 List of Figures
 Include: Chapter-1.lyx
 Include: Chapter-2.lyx
...
 Start Appendix here
 Include: Appendix-1.lyx
 BibTeX Generated Bibliography

Each child doc has the default master document set to Thesis.lyx and I 
use a branch named child only, which is activated in child docs but 
deactivated in the master, to include BibTeX bib in the childs. Math 
macros are defined in LyX-macros.lyx and are available when compiling 
each child individually without hassle.


So, I do not experience your problem. However document settings and 
stuff that gets defined in the preamble need to be set in both master 
and child docs.


--
Julien


Re: Math macros inside child documents

2011-05-09 Thread Diego Queiroz

 So, I do not experience your problem. However document settings and stuff
 that gets defined in the preamble need to be set in both master and child
 docs.
 --
 Julien


Actually, the answer is: yes, you do experience the very same problem.
Otherwise you won't need to go after a workaround, right? :-)

As I said before, I'm sure there are several ways to workaround this
limitation (I am not searching for one).
I just think we should focus on make LyX avoid these errors by itself.


Cheers,
---
Diego


Re: Math macros inside child documents

2011-05-09 Thread Julien Rioux

On 09/05/2011 1:44 PM, Diego Queiroz wrote:


So, I do not experience your problem. However document settings and stuff
that gets defined in the preamble need to be set in both master and child
docs.
--
Julien



Actually, the answer is: yes, you do experience the very same problem.
Otherwise you won't need to go after a workaround, right? :-)

As I said before, I'm sure there are several ways to workaround this
limitation (I am not searching for one).
I just think we should focus on make LyX avoid these errors by itself.


Cheers,
---
Diego



Which workaround? You said math macros don't work within child docs, I 
say they work for me. No workaround necessary.


There must be something in your setup that we're missing at the moment 
and prevents math macros for working.


Maybe you mean that the math macros in your preamble don't work?

Regards,
Julien


Re: Math macros inside child documents

2011-05-09 Thread Julien Rioux

On 09/05/2011 1:44 PM, Diego Queiroz wrote:


So, I do not experience your problem. However document settings and stuff
that gets defined in the preamble need to be set in both master and child
docs.
--
Julien



Actually, the answer is: yes, you do experience the very same problem.
Otherwise you won't need to go after a workaround, right? :-)

As I said before, I'm sure there are several ways to workaround this
limitation (I am not searching for one).
I just think we should focus on make LyX avoid these errors by itself.


Cheers,
---
Diego



Hi Diego,

Thinking about this again, I'm guessing that one of the use x math 
package automatically option doesn't get triggered and is the cause of 
your child doc compilation failures. If that is the case then yes, LyX 
should detect that automatically, and yes, at the moment a workaround is 
needed: check use x math package in document settings.


Regards,
Julien


Re: Math macros inside child documents

2011-05-09 Thread Diego Queiroz

 Which workaround? You said math macros don't work within child docs, I say
 they work for me. No workaround necessary.


Maybe I misunderstood you.
I was citing your workaround to include bibtex in the childs.

 I use a branch named child only, which is activated in child docs but
deactivated in the master

Anyway, never mind. Sorry.

Thinking about this again, I'm guessing that one of the use x math package
 automatically option doesn't get triggered and is the cause of your child
 doc compilation failures. If that is the case then yes, LyX should detect
 that automatically, and yes, at the moment a workaround is needed: check
 use x math package in document settings.


I just tested and this is not enough.
I am not able to generate child files in LyX 2.0 at all.
If I include a simple macro in a document (the master), create another file
(the child), link them and use the macro in the child. The standalone child
don't compile, only the master document.

Are you able to do this in LyX 1.6?
If so, this is a bug report and not a feature request.

Can someone confirm this / create ticket?

I've attached two files: the child and the master document.
I can't compile the child document. Can you try?


Cheers,
---
Diego


child.lyx
Description: Binary data


master.lyx
Description: Binary data


Re: Math macros inside child documents

2011-05-09 Thread Julien Rioux

On 09/05/2011 2:23 PM, Diego Queiroz wrote:


Which workaround? You said math macros don't work within child docs, I say
they work for me. No workaround necessary.



Maybe I misunderstood you.
I was citing your workaround to include bibtex in the childs.


I use a branch named child only, which is activated in child docs but

deactivated in the master

Anyway, never mind. Sorry.

Thinking about this again, I'm guessing that one of the use x math package

automatically option doesn't get triggered and is the cause of your child
doc compilation failures. If that is the case then yes, LyX should detect
that automatically, and yes, at the moment a workaround is needed: check
use x math package in document settings.



I just tested and this is not enough.
I am not able to generate child files in LyX 2.0 at all.
If I include a simple macro in a document (the master), create another file
(the child), link them and use the macro in the child. The standalone child
don't compile, only the master document.

Are you able to do this in LyX 1.6?
If so, this is a bug report and not a feature request.

Can someone confirm this / create ticket?

I've attached two files: the child and the master document.
I can't compile the child document. Can you try?


Cheers,
---
Diego



Hi Diego,

Yes I am able to do what you describe in 1.6. In your example child doc, 
you did not set the master setting, did you? But anyway, I corrected it 
and still in 2.1.0svn the compilation of the child is broken:


Undefined control sequence \anymacro

A bug.

Regards,
Julien


Re: Math macros inside child documents

2011-05-09 Thread Richard Heck
On 05/09/2011 02:38 PM, Julien Rioux wrote:

 Yes I am able to do what you describe in 1.6. In your example child
 doc, you did not set the master setting, did you? But anyway, I
 corrected it and still in 2.1.0svn the compilation of the child is
 broken:

 Undefined control sequence \anymacro

 A bug.

It's due to the fact that the clone of the child buffer has no parent.
Enrico wins again. ;-)

It would seem we must always clone the entire set of documents. I.e.,
start with:
buf.masterBuffer()-clone();
or something to that effect. But then we need back a pointer to buf's
clone, so clone() probably needs to return something like a map from
Buffers to their clones. Note that, if we pass this around, we can
perhaps avoid multiple clones of a single Buffer included multiple
times, which I suspect we now have.

Richard



Re: Math macros inside child documents

2011-05-09 Thread Diego Queiroz

 Yes I am able to do what you describe in 1.6. In your example child doc,
 you did not set the master setting, did you?


Indeed.
I was in a hurry and I forgot it. ;/
---
Diego Queiroz


Re: Math macros inside child documents

2011-05-09 Thread Richard Heck
On 05/09/2011 10:22 AM, Diego Queiroz wrote:
 I'm not sure if this is a bug report or a feature request. Probably the
 second one.

 In LyX it's ok to define a Math Macro in a Master document and use it in a
 child one. It's also ok to use math macros that are defined in a child and
 use it in other child document.

 In both cases, I am able to view the Master document and it handles
 everything perfectly.

 But if I do so, I am unable to compile the child document alone.
 AFAIK the reason is simple: the child document doesn't have the math macros
 defined on its scope. And it doesn't really matter if the default master
 document is set or not. It simple doesn't work (at least, I don't know how
 to do without insert the math macros again, which in painful).

 My suggestion is to allow the generation of the childs alone.
 While working in the document, it's normal to compile only parts of the
 document instead of compile the whole set, so this feature would be very
 handy.

If you ask to compile just the child, then you are asking to compile it
as a standalone document, so it is no surprise that this does not work.
If you want to compile just one chapter as part of a larger document,
then you need to use the \includeonly support, accessible from
DocumentSettings.

rh



Re: Math macros inside child documents

2011-05-09 Thread Diego Queiroz

 If you ask to compile just the child, then you are asking to compile it
  as a standalone document, so it is no surprise that this does not work.


Exactly. :-)


 If you want to compile just one chapter as part of a larger document,
 then you need to use the \includeonly support, accessible from
 DocumentSettings.


I was not aware of this feature. Thanks for the hint.

But it is also painful to select the document I want to compile everytime.
:/
When I am working in a document, I work on it as a standalone document, I
don't handle with the Master document before I want to compile the whole
set.

Of course there are several workarounds, i.e you can create a document with
all your macros and insert it on the beggining of all documents. This is a
not so elegant solution, but it does the job. Probably one can suggest a
better solution as well.

But I really think LyX can do this automatically.
Since LyX already stores all defined macros in somewhere for the editor, it
is not so hard to dinamically include them in a document when needed.

Cheers,
Diego


Re: Math macros inside child documents

2011-05-09 Thread Richard Heck
On 05/09/2011 11:05 AM, Diego Queiroz wrote:

 If you want to compile just one chapter as part of a larger document,
 then you need to use the \includeonly support, accessible from
 DocumentSettings.
 I was not aware of this feature. Thanks for the hint.

It's new in 2.0.0.

 But it is also painful to select the document I want to compile everytime.
 :/
 When I am working in a document, I work on it as a standalone document, I
 don't handle with the Master document before I want to compile the whole
 set.

 Of course there are several workarounds, i.e you can create a document with
 all your macros and insert it on the beggining of all documents. This is a
 not so elegant solution, but it does the job. Probably one can suggest a
 better solution as well.

 But I really think LyX can do this automatically.
 Since LyX already stores all defined macros in somewhere for the editor, it
 is not so hard to dinamically include them in a document when needed.

But what if you really want to compile it as a standalone document?
People do this.

Richard



Re: Math macros inside child documents

2011-05-09 Thread Diego Queiroz

 But what if you really want to compile it as a standalone document?
 People do this.

 Richard


But if it was really a standalone document, I would have to unset master
document property, right?

Anyway, in my case, the problem is that my child document with the macros
also define Nomenclatures. When I include it on all files and decide to
generate the Master document, the list of Nomenclatures repeats its entries
several times (obviously because the entry was indeed included several
times).

I am just looking for a more user oriented behavior. I mean, if I can see
everything right on the screen, what's the problem?
This is how I feel about the current behavior. LyX is handling everything on
the editor, since all math macros are interpreted correctly when I open any
document, but I can't generate the file because of its internal structure.

We should try to avoid consistency errors in LyX. If people decide to use
ERT, we should expect unwanted behavior, but in a document using only LyX
resources, it must never generate errors (or they should be rare, at least),
doesn't matter what the user decides to do.


Cheers,
Diego


Re: Math macros inside child documents

2011-05-09 Thread Julien Rioux

On 09/05/2011 10:22 AM, Diego Queiroz wrote:

I'm not sure if this is a bug report or a feature request. Probably the
second one.

In LyX it's ok to define a Math Macro in a Master document and use it in a
child one. It's also ok to use math macros that are defined in a child and
use it in other child document.

In both cases, I am able to view the Master document and it handles
everything perfectly.

But if I do so, I am unable to compile the child document alone.
AFAIK the reason is simple: the child document doesn't have the math macros
defined on its scope. And it doesn't really matter if the default master
document is set or not. It simple doesn't work (at least, I don't know how
to do without insert the math macros again, which in painful).

My suggestion is to allow the generation of the childs alone.
While working in the document, it's normal to compile only parts of the
document instead of compile the whole set, so this feature would be very
handy.


Regards,
---
Diego Queiroz



This works like a charm for me on 1.6.9 right now. My setup is

Thesis.lyx:
 Frontmatter stuff
 Include: LyX-macros.lyx
 Table of Contents
 List of Tables
 List of Figures
 Include: Chapter-1.lyx
 Include: Chapter-2.lyx
...
 Start Appendix here
 Include: Appendix-1.lyx
 BibTeX Generated Bibliography

Each child doc has the default master document set to Thesis.lyx and I 
use a branch named child only, which is activated in child docs but 
deactivated in the master, to include BibTeX bib in the childs. Math 
macros are defined in LyX-macros.lyx and are available when compiling 
each child individually without hassle.


So, I do not experience your problem. However document settings and 
stuff that gets defined in the preamble need to be set in both master 
and child docs.


--
Julien


Re: Math macros inside child documents

2011-05-09 Thread Diego Queiroz

 So, I do not experience your problem. However document settings and stuff
 that gets defined in the preamble need to be set in both master and child
 docs.
 --
 Julien


Actually, the answer is: yes, you do experience the very same problem.
Otherwise you won't need to go after a workaround, right? :-)

As I said before, I'm sure there are several ways to workaround this
limitation (I am not searching for one).
I just think we should focus on make LyX avoid these errors by itself.


Cheers,
---
Diego


Re: Math macros inside child documents

2011-05-09 Thread Julien Rioux

On 09/05/2011 1:44 PM, Diego Queiroz wrote:


So, I do not experience your problem. However document settings and stuff
that gets defined in the preamble need to be set in both master and child
docs.
--
Julien



Actually, the answer is: yes, you do experience the very same problem.
Otherwise you won't need to go after a workaround, right? :-)

As I said before, I'm sure there are several ways to workaround this
limitation (I am not searching for one).
I just think we should focus on make LyX avoid these errors by itself.


Cheers,
---
Diego



Which workaround? You said math macros don't work within child docs, I 
say they work for me. No workaround necessary.


There must be something in your setup that we're missing at the moment 
and prevents math macros for working.


Maybe you mean that the math macros in your preamble don't work?

Regards,
Julien


Re: Math macros inside child documents

2011-05-09 Thread Julien Rioux

On 09/05/2011 1:44 PM, Diego Queiroz wrote:


So, I do not experience your problem. However document settings and stuff
that gets defined in the preamble need to be set in both master and child
docs.
--
Julien



Actually, the answer is: yes, you do experience the very same problem.
Otherwise you won't need to go after a workaround, right? :-)

As I said before, I'm sure there are several ways to workaround this
limitation (I am not searching for one).
I just think we should focus on make LyX avoid these errors by itself.


Cheers,
---
Diego



Hi Diego,

Thinking about this again, I'm guessing that one of the use x math 
package automatically option doesn't get triggered and is the cause of 
your child doc compilation failures. If that is the case then yes, LyX 
should detect that automatically, and yes, at the moment a workaround is 
needed: check use x math package in document settings.


Regards,
Julien


Re: Math macros inside child documents

2011-05-09 Thread Diego Queiroz

 Which workaround? You said math macros don't work within child docs, I say
 they work for me. No workaround necessary.


Maybe I misunderstood you.
I was citing your workaround to include bibtex in the childs.

 I use a branch named child only, which is activated in child docs but
deactivated in the master

Anyway, never mind. Sorry.

Thinking about this again, I'm guessing that one of the use x math package
 automatically option doesn't get triggered and is the cause of your child
 doc compilation failures. If that is the case then yes, LyX should detect
 that automatically, and yes, at the moment a workaround is needed: check
 use x math package in document settings.


I just tested and this is not enough.
I am not able to generate child files in LyX 2.0 at all.
If I include a simple macro in a document (the master), create another file
(the child), link them and use the macro in the child. The standalone child
don't compile, only the master document.

Are you able to do this in LyX 1.6?
If so, this is a bug report and not a feature request.

Can someone confirm this / create ticket?

I've attached two files: the child and the master document.
I can't compile the child document. Can you try?


Cheers,
---
Diego


child.lyx
Description: Binary data


master.lyx
Description: Binary data


Re: Math macros inside child documents

2011-05-09 Thread Julien Rioux

On 09/05/2011 2:23 PM, Diego Queiroz wrote:


Which workaround? You said math macros don't work within child docs, I say
they work for me. No workaround necessary.



Maybe I misunderstood you.
I was citing your workaround to include bibtex in the childs.


I use a branch named child only, which is activated in child docs but

deactivated in the master

Anyway, never mind. Sorry.

Thinking about this again, I'm guessing that one of the use x math package

automatically option doesn't get triggered and is the cause of your child
doc compilation failures. If that is the case then yes, LyX should detect
that automatically, and yes, at the moment a workaround is needed: check
use x math package in document settings.



I just tested and this is not enough.
I am not able to generate child files in LyX 2.0 at all.
If I include a simple macro in a document (the master), create another file
(the child), link them and use the macro in the child. The standalone child
don't compile, only the master document.

Are you able to do this in LyX 1.6?
If so, this is a bug report and not a feature request.

Can someone confirm this / create ticket?

I've attached two files: the child and the master document.
I can't compile the child document. Can you try?


Cheers,
---
Diego



Hi Diego,

Yes I am able to do what you describe in 1.6. In your example child doc, 
you did not set the master setting, did you? But anyway, I corrected it 
and still in 2.1.0svn the compilation of the child is broken:


Undefined control sequence \anymacro

A bug.

Regards,
Julien


Re: Math macros inside child documents

2011-05-09 Thread Richard Heck
On 05/09/2011 02:38 PM, Julien Rioux wrote:

 Yes I am able to do what you describe in 1.6. In your example child
 doc, you did not set the master setting, did you? But anyway, I
 corrected it and still in 2.1.0svn the compilation of the child is
 broken:

 Undefined control sequence \anymacro

 A bug.

It's due to the fact that the clone of the child buffer has no parent.
Enrico wins again. ;-)

It would seem we must always clone the entire set of documents. I.e.,
start with:
buf.masterBuffer()-clone();
or something to that effect. But then we need back a pointer to buf's
clone, so clone() probably needs to return something like a map from
Buffers to their clones. Note that, if we pass this around, we can
perhaps avoid multiple clones of a single Buffer included multiple
times, which I suspect we now have.

Richard



Re: Math macros inside child documents

2011-05-09 Thread Diego Queiroz

 Yes I am able to do what you describe in 1.6. In your example child doc,
 you did not set the master setting, did you?


Indeed.
I was in a hurry and I forgot it. ;/
---
Diego Queiroz


Re: Math macros inside child documents

2011-05-09 Thread Richard Heck
On 05/09/2011 10:22 AM, Diego Queiroz wrote:
> I'm not sure if this is a bug report or a feature request. Probably the
> second one.
>
> In LyX it's ok to define a Math Macro in a Master document and use it in a
> child one. It's also ok to use math macros that are defined in a child and
> use it in other child document.
>
> In both cases, I am able to view the Master document and it handles
> everything perfectly.
>
> But if I do so, I am unable to compile the child document alone.
> AFAIK the reason is simple: the child document doesn't have the math macros
> defined on its scope. And it doesn't really matter if the default master
> document is set or not. It simple doesn't work (at least, I don't know how
> to do without insert the math macros "again", which in painful).
>
> My suggestion is to allow the generation of the childs alone.
> While working in the document, it's normal to compile only parts of the
> document instead of compile the whole set, so this feature would be very
> handy.
>
If you ask to compile just the child, then you are asking to compile it
as a standalone document, so it is no surprise that this does not work.
If you want to compile just one chapter as part of a larger document,
then you need to use the \includeonly support, accessible from
Document>Settings.

rh



Re: Math macros inside child documents

2011-05-09 Thread Diego Queiroz
>
> If you ask to compile just the child, then you are asking to compile it
>  as a standalone document, so it is no surprise that this does not work.
>

Exactly. :-)


> If you want to compile just one chapter as part of a larger document,
> then you need to use the \includeonly support, accessible from
> Document>Settings.


I was not aware of this feature. Thanks for the hint.

But it is also painful to select the document I want to compile everytime.
:/
When I am working in a document, I work on it as a standalone document, I
don't handle with the Master document before I want to compile the whole
set.

Of course there are several workarounds, i.e you can create a document with
all your macros and insert it on the beggining of all documents. This is a
not so elegant solution, but it does the job. Probably one can suggest a
better solution as well.

But I really think LyX can do this automatically.
Since LyX already stores all defined macros in somewhere for the editor, it
is not so hard to dinamically include them in a document when needed.

Cheers,
Diego


Re: Math macros inside child documents

2011-05-09 Thread Richard Heck
On 05/09/2011 11:05 AM, Diego Queiroz wrote:
>
>> If you want to compile just one chapter as part of a larger document,
>> then you need to use the \includeonly support, accessible from
>> Document>Settings.
> I was not aware of this feature. Thanks for the hint.
>
It's new in 2.0.0.

> But it is also painful to select the document I want to compile everytime.
> :/
> When I am working in a document, I work on it as a standalone document, I
> don't handle with the Master document before I want to compile the whole
> set.
>
> Of course there are several workarounds, i.e you can create a document with
> all your macros and insert it on the beggining of all documents. This is a
> not so elegant solution, but it does the job. Probably one can suggest a
> better solution as well.
>
> But I really think LyX can do this automatically.
> Since LyX already stores all defined macros in somewhere for the editor, it
> is not so hard to dinamically include them in a document when needed.
>
But what if you really want to compile it as a standalone document?
People do this.

Richard



Re: Math macros inside child documents

2011-05-09 Thread Diego Queiroz
>
> But what if you really want to compile it as a standalone document?
> People do this.
>
> Richard
>

But if it was really a standalone document, I would have to unset master
document property, right?

Anyway, in my case, the problem is that my child document with the macros
also define Nomenclatures. When I include it on all files and decide to
generate the Master document, the list of Nomenclatures repeats its entries
several times (obviously because the entry was indeed included several
times).

I am just looking for a more "user oriented behavior". I mean, "if I can see
everything right on the screen, what's the problem?"
This is how I feel about the current behavior. LyX is handling everything on
the editor, since all math macros are interpreted correctly when I open any
document, but I can't generate the file because of its internal structure.

We should try to avoid consistency errors in LyX. If people decide to use
ERT, we should expect unwanted behavior, but in a document using only LyX
resources, it must never generate errors (or they should be rare, at least),
doesn't matter what the user decides to do.


Cheers,
Diego


Re: Math macros inside child documents

2011-05-09 Thread Julien Rioux

On 09/05/2011 10:22 AM, Diego Queiroz wrote:

I'm not sure if this is a bug report or a feature request. Probably the
second one.

In LyX it's ok to define a Math Macro in a Master document and use it in a
child one. It's also ok to use math macros that are defined in a child and
use it in other child document.

In both cases, I am able to view the Master document and it handles
everything perfectly.

But if I do so, I am unable to compile the child document alone.
AFAIK the reason is simple: the child document doesn't have the math macros
defined on its scope. And it doesn't really matter if the default master
document is set or not. It simple doesn't work (at least, I don't know how
to do without insert the math macros "again", which in painful).

My suggestion is to allow the generation of the childs alone.
While working in the document, it's normal to compile only parts of the
document instead of compile the whole set, so this feature would be very
handy.


Regards,
---
Diego Queiroz



This works like a charm for me on 1.6.9 right now. My setup is

Thesis.lyx:
 Frontmatter stuff
 Include: LyX-macros.lyx
 Table of Contents
 List of Tables
 List of Figures
 Include: Chapter-1.lyx
 Include: Chapter-2.lyx
...
 Start Appendix here
 Include: Appendix-1.lyx
 BibTeX Generated Bibliography

Each child doc has the default master document set to Thesis.lyx and I 
use a branch named "child only", which is activated in child docs but 
deactivated in the master, to include BibTeX bib in the childs. Math 
macros are defined in LyX-macros.lyx and are available when compiling 
each child individually without hassle.


So, I do not experience your problem. However document settings and 
stuff that gets defined in the preamble need to be set in both master 
and child docs.


--
Julien


Re: Math macros inside child documents

2011-05-09 Thread Diego Queiroz
>
> So, I do not experience your problem. However document settings and stuff
> that gets defined in the preamble need to be set in both master and child
> docs.
> --
> Julien
>

Actually, the answer is: yes, you do experience the very same problem.
Otherwise you won't need to go after a workaround, right? :-)

As I said before, I'm sure there are several ways to workaround this
limitation (I am not searching for one).
I just think we should focus on make LyX avoid these errors by itself.


Cheers,
---
Diego


Re: Math macros inside child documents

2011-05-09 Thread Julien Rioux

On 09/05/2011 1:44 PM, Diego Queiroz wrote:


So, I do not experience your problem. However document settings and stuff
that gets defined in the preamble need to be set in both master and child
docs.
--
Julien



Actually, the answer is: yes, you do experience the very same problem.
Otherwise you won't need to go after a workaround, right? :-)

As I said before, I'm sure there are several ways to workaround this
limitation (I am not searching for one).
I just think we should focus on make LyX avoid these errors by itself.


Cheers,
---
Diego



Which workaround? You said math macros don't work within child docs, I 
say they work for me. No workaround necessary.


There must be something in your setup that we're missing at the moment 
and prevents math macros for working.


Maybe you mean that the math macros in your preamble don't work?

Regards,
Julien


Re: Math macros inside child documents

2011-05-09 Thread Julien Rioux

On 09/05/2011 1:44 PM, Diego Queiroz wrote:


So, I do not experience your problem. However document settings and stuff
that gets defined in the preamble need to be set in both master and child
docs.
--
Julien



Actually, the answer is: yes, you do experience the very same problem.
Otherwise you won't need to go after a workaround, right? :-)

As I said before, I'm sure there are several ways to workaround this
limitation (I am not searching for one).
I just think we should focus on make LyX avoid these errors by itself.


Cheers,
---
Diego



Hi Diego,

Thinking about this again, I'm guessing that one of the "use x math 
package automatically" option doesn't get triggered and is the cause of 
your child doc compilation failures. If that is the case then yes, LyX 
should detect that automatically, and yes, at the moment a workaround is 
needed: check "use x math package" in document settings.


Regards,
Julien


Re: Math macros inside child documents

2011-05-09 Thread Diego Queiroz
>
> Which workaround? You said math macros don't work within child docs, I say
> they work for me. No workaround necessary.
>

Maybe I misunderstood you.
I was citing your workaround to include bibtex in the childs.

>> "I use a branch named "child only", which is activated in child docs but
deactivated in the master"

Anyway, never mind. Sorry.

Thinking about this again, I'm guessing that one of the "use x math package
> automatically" option doesn't get triggered and is the cause of your child
> doc compilation failures. If that is the case then yes, LyX should detect
> that automatically, and yes, at the moment a workaround is needed: check
> "use x math package" in document settings.
>

I just tested and this is not enough.
I am not able to generate child files in LyX 2.0 at all.
If I include a simple macro in a document (the master), create another file
(the child), link them and use the macro in the child. The standalone child
don't compile, only the master document.

Are you able to do this in LyX 1.6?
If so, this is a bug report and not a feature request.

Can someone confirm this / create ticket?

I've attached two files: the child and the master document.
I can't compile the child document. Can you try?


Cheers,
---
Diego


child.lyx
Description: Binary data


master.lyx
Description: Binary data


Re: Math macros inside child documents

2011-05-09 Thread Julien Rioux

On 09/05/2011 2:23 PM, Diego Queiroz wrote:


Which workaround? You said math macros don't work within child docs, I say
they work for me. No workaround necessary.



Maybe I misunderstood you.
I was citing your workaround to include bibtex in the childs.


"I use a branch named "child only", which is activated in child docs but

deactivated in the master"

Anyway, never mind. Sorry.

Thinking about this again, I'm guessing that one of the "use x math package

automatically" option doesn't get triggered and is the cause of your child
doc compilation failures. If that is the case then yes, LyX should detect
that automatically, and yes, at the moment a workaround is needed: check
"use x math package" in document settings.



I just tested and this is not enough.
I am not able to generate child files in LyX 2.0 at all.
If I include a simple macro in a document (the master), create another file
(the child), link them and use the macro in the child. The standalone child
don't compile, only the master document.

Are you able to do this in LyX 1.6?
If so, this is a bug report and not a feature request.

Can someone confirm this / create ticket?

I've attached two files: the child and the master document.
I can't compile the child document. Can you try?


Cheers,
---
Diego



Hi Diego,

Yes I am able to do what you describe in 1.6. In your example child doc, 
you did not set the master setting, did you? But anyway, I corrected it 
and still in 2.1.0svn the compilation of the child is broken:


Undefined control sequence \anymacro

A bug.

Regards,
Julien


Re: Math macros inside child documents

2011-05-09 Thread Richard Heck
On 05/09/2011 02:38 PM, Julien Rioux wrote:
>
> Yes I am able to do what you describe in 1.6. In your example child
> doc, you did not set the master setting, did you? But anyway, I
> corrected it and still in 2.1.0svn the compilation of the child is
> broken:
>
> Undefined control sequence \anymacro
>
> A bug.
>
It's due to the fact that the clone of the child buffer has no parent.
Enrico wins again. ;-)

It would seem we must always clone the entire set of documents. I.e.,
start with:
buf.masterBuffer()->clone();
or something to that effect. But then we need back a pointer to buf's
clone, so clone() probably needs to return something like a map from
Buffers to their clones. Note that, if we pass this around, we can
perhaps avoid multiple clones of a single Buffer included multiple
times, which I suspect we now have.

Richard



Re: Math macros inside child documents

2011-05-09 Thread Diego Queiroz
>
> Yes I am able to do what you describe in 1.6. In your example child doc,
> you did not set the master setting, did you?
>

Indeed.
I was in a hurry and I forgot it. ;/
---
Diego Queiroz


Re: Math Macros in grey note insets

2009-12-30 Thread Jean-Marc Lasgouttes

Le 30 déc. 09 à 09:59, Murtaza Safri a écrit :


I am typing in a lot of math macros. I wanted to group them together
inside foldable box to improve readability and manageability afforded
by folding the inset box. So I put in a lot of the macros inside Lyx
grey note. However, the output has a lot of new lines and the first
line of my paragraph text starts way down on the page. I noticed from
view source that Lyx puts in an extra line break in lyxgreyedout if
the content is a macro. Is there a way to remove the extra spacing?
Can I design a custom inset?


Try to define a branch, and enable it. Then you can insert your macros  
in

a branch inset.

JMarc

Re: Math Macros in grey note insets

2009-12-30 Thread Murtaza Safri
Thanks. It works.

Murtaza

On Wed, Dec 30, 2009 at 5:46 AM, Jean-Marc Lasgouttes
lasgout...@lyx.org wrote:
 Le 30 déc. 09 à 09:59, Murtaza Safri a écrit :

 I am typing in a lot of math macros. I wanted to group them together
 inside foldable box to improve readability and manageability afforded
 by folding the inset box. So I put in a lot of the macros inside Lyx
 grey note. However, the output has a lot of new lines and the first
 line of my paragraph text starts way down on the page. I noticed from
 view source that Lyx puts in an extra line break in lyxgreyedout if
 the content is a macro. Is there a way to remove the extra spacing?
 Can I design a custom inset?

 Try to define a branch, and enable it. Then you can insert your macros in
 a branch inset.

 JMarc


Re: Math Macros in grey note insets

2009-12-30 Thread Jean-Marc Lasgouttes

Le 30 déc. 09 à 09:59, Murtaza Safri a écrit :


I am typing in a lot of math macros. I wanted to group them together
inside foldable box to improve readability and manageability afforded
by folding the inset box. So I put in a lot of the macros inside Lyx
grey note. However, the output has a lot of new lines and the first
line of my paragraph text starts way down on the page. I noticed from
view source that Lyx puts in an extra line break in lyxgreyedout if
the content is a macro. Is there a way to remove the extra spacing?
Can I design a custom inset?


Try to define a branch, and enable it. Then you can insert your macros  
in

a branch inset.

JMarc

Re: Math Macros in grey note insets

2009-12-30 Thread Murtaza Safri
Thanks. It works.

Murtaza

On Wed, Dec 30, 2009 at 5:46 AM, Jean-Marc Lasgouttes
lasgout...@lyx.org wrote:
 Le 30 déc. 09 à 09:59, Murtaza Safri a écrit :

 I am typing in a lot of math macros. I wanted to group them together
 inside foldable box to improve readability and manageability afforded
 by folding the inset box. So I put in a lot of the macros inside Lyx
 grey note. However, the output has a lot of new lines and the first
 line of my paragraph text starts way down on the page. I noticed from
 view source that Lyx puts in an extra line break in lyxgreyedout if
 the content is a macro. Is there a way to remove the extra spacing?
 Can I design a custom inset?

 Try to define a branch, and enable it. Then you can insert your macros in
 a branch inset.

 JMarc


Re: Math Macros in grey note insets

2009-12-30 Thread Jean-Marc Lasgouttes

Le 30 déc. 09 à 09:59, Murtaza Safri a écrit :


I am typing in a lot of math macros. I wanted to group them together
inside foldable box to improve readability and manageability afforded
by folding the inset box. So I put in a lot of the macros inside Lyx
grey note. However, the output has a lot of new lines and the first
line of my paragraph text starts way down on the page. I noticed from
view source that Lyx puts in an extra line break in  if
the content is a macro. Is there a way to remove the extra spacing?
Can I design a custom inset?


Try to define a branch, and enable it. Then you can insert your macros  
in

a branch inset.

JMarc

Re: Math Macros in grey note insets

2009-12-30 Thread Murtaza Safri
Thanks. It works.

Murtaza

On Wed, Dec 30, 2009 at 5:46 AM, Jean-Marc Lasgouttes
 wrote:
> Le 30 déc. 09 à 09:59, Murtaza Safri a écrit :
>
>> I am typing in a lot of math macros. I wanted to group them together
>> inside foldable box to improve readability and manageability afforded
>> by folding the inset box. So I put in a lot of the macros inside Lyx
>> grey note. However, the output has a lot of new lines and the first
>> line of my paragraph text starts way down on the page. I noticed from
>> view source that Lyx puts in an extra line break in  if
>> the content is a macro. Is there a way to remove the extra spacing?
>> Can I design a custom inset?
>
> Try to define a branch, and enable it. Then you can insert your macros in
> a branch inset.
>
> JMarc


Re: Math macros don't show up in pdf output

2009-12-22 Thread Dan Kilman
On Wed, Dec 23, 2009 at 12:23 AM, Dan Kilman dankil...@gmail.com wrote:

 Hi there,

 I am using LyX 1.6.5 on Windows XP installed via the alternative installer.

 When I define math macros, they seem to be working just fine while editing
 the document (that is, I can use them).
 However, when I try to view the document as a PDF or DVI, every part of the
 document not using math macros shows up in the output (as it should),
 while the math macros seems to be simply ignored, with no error message of
 any sort.

 Any advice on this matter?

 Thanks in advance, Dan.


Figured it out..
I'm sorry to have bothered you. I guess reading the manual is the first
thing I should have done.


Re: Math macros don't show up in pdf output

2009-12-22 Thread Dan Kilman
On Wed, Dec 23, 2009 at 12:23 AM, Dan Kilman dankil...@gmail.com wrote:

 Hi there,

 I am using LyX 1.6.5 on Windows XP installed via the alternative installer.

 When I define math macros, they seem to be working just fine while editing
 the document (that is, I can use them).
 However, when I try to view the document as a PDF or DVI, every part of the
 document not using math macros shows up in the output (as it should),
 while the math macros seems to be simply ignored, with no error message of
 any sort.

 Any advice on this matter?

 Thanks in advance, Dan.


Figured it out..
I'm sorry to have bothered you. I guess reading the manual is the first
thing I should have done.


Re: Math macros don't show up in pdf output

2009-12-22 Thread Dan Kilman
On Wed, Dec 23, 2009 at 12:23 AM, Dan Kilman  wrote:

> Hi there,
>
> I am using LyX 1.6.5 on Windows XP installed via the alternative installer.
>
> When I define math macros, they seem to be working just fine while editing
> the document (that is, I can use them).
> However, when I try to view the document as a PDF or DVI, every part of the
> document not using math macros shows up in the output (as it should),
> while the math macros seems to be simply ignored, with no error message of
> any sort.
>
> Any advice on this matter?
>
> Thanks in advance, Dan.
>

Figured it out..
I'm sorry to have bothered you. I guess reading the manual is the first
thing I should have done.


Re: math-macros in included file

2008-04-07 Thread Stefan Schimanski


Am 07.04.2008 um 11:44 schrieb G. Milde:

Dear LyX users,

for my thesis, I define a set of about 20 math-macros that reside in a
well commented file math-macros.lyx that is included by the document
file(s).

When I open the document file before opening the math-macro.lyx  
file, all
macros will be shown as ERT. Unfortunately, they remain in ERT even  
after

opening math-macro.lyx later on (either via FileRecent Files or
automatically as a result of ViewPostscript).

I experimented with cut-and-paste of the macro definitions in a LyX- 
Note

at the beginning of the document. However, this bloats the file and
keeping it in sync is a pain.

Does anyone else experiment this kind of problem?
Are there proposed workarounds?


Yes, wait for 1.6. It will come with a completely rewritten macro  
system, see here:


  http://wiki.lyx.org/LyX/NewInLyX16#toc12

You are very welcome to try out the development version and report  
problems with the macros. I use them extensively for my own thesis,  
but some more testing would be very welcome. The alpha2 should be out  
soon if you don't want to compile from source yourself.


Stefan


Re: math-macros in included file

2008-04-07 Thread Stefan Schimanski


Am 07.04.2008 um 11:44 schrieb G. Milde:

Dear LyX users,

for my thesis, I define a set of about 20 math-macros that reside in a
well commented file math-macros.lyx that is included by the document
file(s).

When I open the document file before opening the math-macro.lyx  
file, all
macros will be shown as ERT. Unfortunately, they remain in ERT even  
after

opening math-macro.lyx later on (either via FileRecent Files or
automatically as a result of ViewPostscript).

I experimented with cut-and-paste of the macro definitions in a LyX- 
Note

at the beginning of the document. However, this bloats the file and
keeping it in sync is a pain.

Does anyone else experiment this kind of problem?
Are there proposed workarounds?


Yes, wait for 1.6. It will come with a completely rewritten macro  
system, see here:


  http://wiki.lyx.org/LyX/NewInLyX16#toc12

You are very welcome to try out the development version and report  
problems with the macros. I use them extensively for my own thesis,  
but some more testing would be very welcome. The alpha2 should be out  
soon if you don't want to compile from source yourself.


Stefan


Re: math-macros in included file

2008-04-07 Thread Stefan Schimanski


Am 07.04.2008 um 11:44 schrieb G. Milde:

Dear LyX users,

for my thesis, I define a set of about 20 math-macros that reside in a
well commented file math-macros.lyx that is included by the document
file(s).

When I open the document file before opening the math-macro.lyx  
file, all
macros will be shown as ERT. Unfortunately, they remain in ERT even  
after

opening math-macro.lyx later on (either via File>Recent Files or
automatically as a result of View>Postscript).

I experimented with cut-and-paste of the macro definitions in a LyX- 
Note

at the beginning of the document. However, this bloats the file and
keeping it in sync is a pain.

Does anyone else experiment this kind of problem?
Are there proposed workarounds?


Yes, wait for 1.6. It will come with a completely rewritten macro  
system, see here:


  http://wiki.lyx.org/LyX/NewInLyX16#toc12

You are very welcome to try out the development version and report  
problems with the macros. I use them extensively for my own thesis,  
but some more testing would be very welcome. The alpha2 should be out  
soon if you don't want to compile from source yourself.


Stefan


Re: math macros

2006-10-15 Thread Gunnar
On Sunday 15 October 2006 19:56, Nick Kuzmik wrote:
 I do a lot of math in lyx, and I create a lot of macros on the fly.  What's
 the best way to keep them organized?  Maybe make it so every file I open
 has all the same macros?
In .lyx/bind/ directory you will find a lot of files, there you can write 
keyboard shortcuts for them, and you can also create a template that you 
always start working with. Then you can add many macros to the latex 
preamble.

I hope this helps.


Re: math macros

2006-10-15 Thread Gunnar
On Sunday 15 October 2006 19:56, Nick Kuzmik wrote:
 I do a lot of math in lyx, and I create a lot of macros on the fly.  What's
 the best way to keep them organized?  Maybe make it so every file I open
 has all the same macros?
In .lyx/bind/ directory you will find a lot of files, there you can write 
keyboard shortcuts for them, and you can also create a template that you 
always start working with. Then you can add many macros to the latex 
preamble.

I hope this helps.


Re: math macros

2006-10-15 Thread Gunnar
On Sunday 15 October 2006 19:56, Nick Kuzmik wrote:
> I do a lot of math in lyx, and I create a lot of macros on the fly.  What's
> the best way to keep them organized?  Maybe make it so every file I open
> has all the same macros?
In .lyx/bind/ directory you will find a lot of files, there you can write 
keyboard shortcuts for them, and you can also create a template that you 
always start working with. Then you can add many macros to the latex 
preamble.

I hope this helps.


Re: Math Macros

2003-02-17 Thread Andre Poenitz
On Sun, Feb 16, 2003 at 08:05:54PM -0500, William O. Bray wrote:
 Hello, I am using Lyx 1.3 with qt frontend.
 suppose you want a macro for \a^{#1} where #1 is user input.
 In the doc mini-buffer one would type, e.g.,
 math-macro ax 1 (enter)
 This brings up the macro box in the Lyx doc; in the first box you might type 
 ax (should give the LaTex name for the shortcut). In the second you would 
 type a^{#1}.

No. The name is given in the math-macro command. You can't alter that
afterwards.  The first box is for LaTeX export, the second is for LyX's
on-screen drawing, so you can tweak appearance a bit. If you don't put
anything in the second box, both are the same.

Andre'

-- 
Those who desire to give up Freedom in order to gain Security,
will not have, nor do they deserve, either one. (T. Jefferson)



Re: Math Macros

2003-02-17 Thread Andre Poenitz
On Sun, Feb 16, 2003 at 08:05:54PM -0500, William O. Bray wrote:
 Hello, I am using Lyx 1.3 with qt frontend.
 suppose you want a macro for \a^{#1} where #1 is user input.
 In the doc mini-buffer one would type, e.g.,
 math-macro ax 1 (enter)
 This brings up the macro box in the Lyx doc; in the first box you might type 
 ax (should give the LaTex name for the shortcut). In the second you would 
 type a^{#1}.

No. The name is given in the math-macro command. You can't alter that
afterwards.  The first box is for LaTeX export, the second is for LyX's
on-screen drawing, so you can tweak appearance a bit. If you don't put
anything in the second box, both are the same.

Andre'

-- 
Those who desire to give up Freedom in order to gain Security,
will not have, nor do they deserve, either one. (T. Jefferson)



Re: Math Macros

2003-02-17 Thread Andre Poenitz
On Sun, Feb 16, 2003 at 08:05:54PM -0500, William O. Bray wrote:
> Hello, I am using Lyx 1.3 with qt frontend.
> suppose you want a macro for \a^{#1} where #1 is user input.
> In the doc mini-buffer one would type, e.g.,
> math-macro ax 1 (enter)
> This brings up the macro box in the Lyx doc; in the first box you might type 
> ax (should give the LaTex name for the shortcut). In the second you would 
> type a^{#1}.

No. The name is given in the math-macro command. You can't alter that
afterwards.  The first box is for LaTeX export, the second is for LyX's
on-screen drawing, so you can tweak appearance a bit. If you don't put
anything in the second box, both are the same.

Andre'

-- 
Those who desire to give up Freedom in order to gain Security,
will not have, nor do they deserve, either one. (T. Jefferson)



Re: Re: math-macros

2001-06-11 Thread Guenter Milde

On Sat, 9 Jun 2001 00:50:20 +0300 wrote Dekel Tsur [EMAIL PROTECTED]:

 On Fri, Jun 08, 2001 at 08:44:47AM +0200, Jean-Pierre.Chretien wrote:
  The math-macro definitions have the advantage that they are expanded and
  appear in WYSIWM mode (a LyX perk!). 

The LyX-math-macro has the disadvantage, that it must be defined in the
text-body of your document (i.e. on the LyX-canvax/screen) You cannot define
it in the preamble or in an included file. That means you have a box
with Macro:some_name for each defined macro in your Text. (Which is
WYSIMTWYM(*)

  However, there seems to be no
  mechanism for saving the math-macro definitions as part of a standard
  template.

As the template is not constrained to preamble and default settings but can
also contain normal LyX-text, there is no problem in including math-macro
definitions in the ~/.lyx/templates/defaults.lyx file. 

 
  I wrote a perl script to translate (as reLyX, in a way) a set of lateX
  macros as a set of LyX math-macros, which you had to Include
  as a LyX file.
 
 This is not a complete solution because the macros will not be expanded on
 the LyX display unless you load (when starting LyX) the macro file.
 Currently, there isn't a better solution.

Currently you have the choice to

1. Include the macros.tex file in the latex preamble and open the
   corresponding macros.lyx file in LyX (as a separate document) every time
   you want to use the macros.

2. Open ~/.lyx/templates/defaults.lyx in LyX, hard-insert the macro
   definitions (Insert|Insert_File|LyX_Document macros.lyx), save again:

a) as  ~/.lyx/templates/defaults.lyx if you want you macros all the
   times you start a new (default) document
b) as ~/.lyx/templates/defaults_with_macros.lyx if you want to have the
   macro boxes only for some documents and start these with
   File|New|With_Template

Method 1 has the advantage of non cluttering the document with macro
definition boxes and the disadvantage of some extra action to be taken when
starting to use LyX.

Method 2 has the advantage of beeing more transparent/save and the
disadvantage of WYSIMTWYM(*)

(*) WYSIMTWYM -- What you see is more than what you want :-)


Guenter

--
[EMAIL PROTECTED]




Re: Re: math-macros

2001-06-11 Thread Guenter Milde

On Sat, 9 Jun 2001 00:50:20 +0300 wrote Dekel Tsur [EMAIL PROTECTED]:

 On Fri, Jun 08, 2001 at 08:44:47AM +0200, Jean-Pierre.Chretien wrote:
  The math-macro definitions have the advantage that they are expanded and
  appear in WYSIWM mode (a LyX perk!). 

The LyX-math-macro has the disadvantage, that it must be defined in the
text-body of your document (i.e. on the LyX-canvax/screen) You cannot define
it in the preamble or in an included file. That means you have a box
with Macro:some_name for each defined macro in your Text. (Which is
WYSIMTWYM(*)

  However, there seems to be no
  mechanism for saving the math-macro definitions as part of a standard
  template.

As the template is not constrained to preamble and default settings but can
also contain normal LyX-text, there is no problem in including math-macro
definitions in the ~/.lyx/templates/defaults.lyx file. 

 
  I wrote a perl script to translate (as reLyX, in a way) a set of lateX
  macros as a set of LyX math-macros, which you had to Include
  as a LyX file.
 
 This is not a complete solution because the macros will not be expanded on
 the LyX display unless you load (when starting LyX) the macro file.
 Currently, there isn't a better solution.

Currently you have the choice to

1. Include the macros.tex file in the latex preamble and open the
   corresponding macros.lyx file in LyX (as a separate document) every time
   you want to use the macros.

2. Open ~/.lyx/templates/defaults.lyx in LyX, hard-insert the macro
   definitions (Insert|Insert_File|LyX_Document macros.lyx), save again:

a) as  ~/.lyx/templates/defaults.lyx if you want you macros all the
   times you start a new (default) document
b) as ~/.lyx/templates/defaults_with_macros.lyx if you want to have the
   macro boxes only for some documents and start these with
   File|New|With_Template

Method 1 has the advantage of non cluttering the document with macro
definition boxes and the disadvantage of some extra action to be taken when
starting to use LyX.

Method 2 has the advantage of beeing more transparent/save and the
disadvantage of WYSIMTWYM(*)

(*) WYSIMTWYM -- What you see is more than what you want :-)


Guenter

--
[EMAIL PROTECTED]




Re: Re: math-macros

2001-06-11 Thread Guenter Milde

On Sat, 9 Jun 2001 00:50:20 +0300 wrote Dekel Tsur <[EMAIL PROTECTED]>:

> On Fri, Jun 08, 2001 at 08:44:47AM +0200, Jean-Pierre.Chretien wrote:
> > >>The math-macro definitions have the advantage that they are expanded and
> > >>appear in WYSIWM mode (a LyX perk!). 

The LyX-math-macro has the disadvantage, that it must be defined in the
text-body of your document (i.e. on the LyX-canvax/screen) You cannot define
it in the preamble or in an included file. That means you have a box
with "Macro:some_name" for each defined macro in your Text. (Which is
WYSIMTWYM(*)

> > >>However, there seems to be no
> > >>mechanism for saving the math-macro definitions as part of a standard
> > >>template.

As the template is not constrained to preamble and default settings but can
also contain "normal" LyX-text, there is no problem in including math-macro
definitions in the ~/.lyx/templates/defaults.lyx file. 

 
> > I wrote a perl script to translate (as reLyX, in a way) a set of lateX
> > macros as a set of LyX math-macros, which you had to Include
> > as a LyX file.
> 
> This is not a complete solution because the macros will not be expanded on
> the LyX display unless you load (when starting LyX) the macro file.
> Currently, there isn't a better solution.

Currently you have the choice to

1. Include the macros.tex file in the latex preamble and open the
   corresponding macros.lyx file in LyX (as a separate document) every time
   you want to use the macros.

2. Open ~/.lyx/templates/defaults.lyx in LyX, "hard-insert" the macro
   definitions (Insert|Insert_File|LyX_Document macros.lyx), save again:

a) as  ~/.lyx/templates/defaults.lyx if you want you macros all the
   times you start a new (default) document
b) as ~/.lyx/templates/defaults_with_macros.lyx if you want to have the
   macro boxes only for some documents and start these with
   File|New|With_Template

Method 1 has the advantage of "non cluttering the document with macro
definition boxes and the disadvantage of some extra action to be taken when
starting to use LyX.

Method 2 has the advantage of beeing more transparent/save and the
disadvantage of WYSIMTWYM(*)

(*) WYSIMTWYM -- What you see is more than what you want :-)


Guenter

--
[EMAIL PROTECTED]




Re: math-macros

2001-06-08 Thread Jean-Pierre.Chretien


Date: Thu, 7 Jun 2001 23:41:19 -0700 (PDT)
From: Michael P Friedlander [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: math-macros

I just started using LyX, and even after a few hours, it's clear that it's
a great advance over using LaTeX directly, even with great packages like
AucTeX under Emacs.  In switching over to LyX, I'm trying to decide how to
best deal with the extensive set of LaTeX math macros I've put together
over the years.

Under LyX, the most straight forward approach would be to simply insert

\input{macros.tex}

into the LaTeX preamble box.  I can then save this preamble as part of the
~/.lyx/defaults.lyx file and have it available for all documents I
compose.  The disadvantage of this approach is that the macro doesn't get
expanded into WYSIWM mode.  For example, \norm{x} appears in the red, TeX
mode.

The math-macro definitions have the advantage that they are expanded and
appear in WYSIWM mode (a LyX perk!).  However, there seems to be no
mechanism for saving the math-macro definitions as part of a standard
template.

Are there other options for setting up my macros in LyX as some sort of
default for all new documents, and still take advantage of the WYSIWM
feature?

Thanks for the help.

--Michael

I wrote a perl script to translate (as reLyX, in a way) a set of lateX
macros a sa set of LyX math-macros, which you had to Include
as a LyX file.
I made it work, but time lacked to make it robust, particularly to old
2.09 constructs embedding math in \mbox to be able to use them in normal
and in TeX mode, which makes no sense in mathed and seemingly in 2e as
somebody pointed out to me recently on the list.

I must have it some where, but I can't have a look right now, I may
do so if you're interested.

-- 
Jean-Pierre





  1   2   >