Re: How to break long equations with LyX

2020-07-15 Thread Paul A. Rubin

On 7/15/20 4:57 AM, list_em...@icloud.com wrote:


The breqn package seems like a noble if not perfect effort. Someone 
put a lot of work into it and then died so it seems to be not actively 
developed at this time. There is extensive documentation on it but 
basic use is possible. I’ve had luck with it before, once I figure out 
how to put the bits of ERT before and after the equation to get it set 
up. Not sure what tripped it up this time. I wonder if it would be 
worthwhile to put an example on the wiki.
It couldn't hurt, particularly if the example showed how to break within 
a parenthesized / bracketed expression.


Paul

-- 
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users


Re: How to break long equations with LyX

2020-07-15 Thread list_email

> On Jun 20, 2020, at 9:09 PM, Joel Kulesza  wrote:
> 
> On Sat, Jun 20, 2020 at 12:13 PM Paul A. Rubin  > wrote:
> On 6/19/20 9:47 PM, list_em...@icloud.com  
> wrote:
>>> On Jun 19, 2020, at 5:14 PM, Paul A. Rubin  
>>>  wrote:
>>> 
>>> On 6/19/20 7:34 PM, list_em...@icloud.com  
>>> wrote:
> On Jun 19, 2020, at 8:15 AM, Paul A. Rubin  
>  wrote:
> 
> On 6/19/20 7:51 AM, list_em...@icloud.com  
> wrote:
>> I have tried mightily to get LyX to break long equations. I’ve studied 
>> multiple pages at stackexchange, both LaTeX and LyX, and can’t seem to 
>> get anything to work.
>> 
>> I have had luck in the past with the second large block of code at this 
>> page:
>> 
>> https://stackoverflow.com/questions/2904807/lyx-breaking-long-formula-lines
>>  
>> 
>> 
>> but today I have some problems with it.
>> 
>> First, it doesn’t work if the \text command appears inside my own LaTeX 
>> code that appears between \begin{dmath} and \end{dmath} or if I try to 
>> use the trick twice in the same document. (That’s a tentative analysis 
>> of the problem.) Specifically, LyX runs at 100% CPU eventually gives me 
>> a chance to abort and then follows up with this additional message: "The 
>> external program pdflatex finished with an error. It is recommended you 
>> fix the cause of the external program's error (check the logs)."
>> 
>> Plus, I now want to to apply the line breaking to a line within an 
>> aligned environment (Insert -> Math -> Aligned Environment in the menu 
>> system.) This is causing things to look even worse, even though I added 
>> two “aligned” lines to the referenced code block. (If you look at the 
>> code you’ll see the obvious places to add the lines.)
>> 
>> How do LyX-ers handle this? Is there “LyX” solution to breaking long 
>> equations? I’m OK with some ad hoc solution for now, or some ERT if it 
>> works.
>> 
>> Thanks,
>> Jerry
>> 
>> 
> I've never used the breqn package, but with ordinary and AMS math 
> environments, hitting Ctrl-Enter in the middle of a long formula will 
> break it (inserting a line break, \\, in the LaTeX output). If that 
> doesn't achieve what you want, perhaps you could post a minimal example 
> and a specification of what the output should look like.
> 
> Paul
> 
 Thanks, Paul. I’m on a Mac so of course Control-Enter has no meaning. 
 Usually this translates to Mac-speak as Command-Enter. When I do 
 Command-Enter in my equation, which is unfortunately inside a align 
 environment, it instead adds a row to the matrix that represents the align 
 environment. Ditto for Shift-Command-Enter. These two commands in LyX are 
 mapped as Insert -> Formatting -> Ragged Line Break and Justified Line 
 Break, respectively but invoking the menu commands with the cursor in my 
 equation has exactly the same effect: adding a row to the align matrix 
 (above the row where the cursor is.) When (Shift-)Command-Enter is done to 
 a non-align display equation a similar thing happens except now the 
 non-align equation is converted to an align equation with a blank new row 
 _below_ the original equation.
 
 Right now I guess I would be pretty happy with merely a way to make 
 Command-shift (Control-shift) do what is expected which is apparently 
 break the equation instead of creating a new row.
 
 Jerry
 
>>> Jerry,
>>> 
>>> I just created an align environment with two equations, the left side of 
>>> the first being ridiculously long. When I put the cursor somewhere toward 
>>> the middle of the left side of the long equation and inserted a break 
>>> (using Ctrl-Enter -- I'll get to the Mac part in a minute), it broke the 
>>> equation and inserted a new row. So
>>> 
>>> (x+x+x+x+...+x) =1
>>>  y =2
>>> 
>>> (where the right column contained the equal signs and integers) became
>>> 
>>> (x+x+x+...
>>> +x+x+x+x) =1
>>>  y =2
>>> 
>>> where the right column is empty in the first row. See the attached minimal 
>>> example. Is this not what you want?
>>> 
>>> Regarding the key mapping, if you can find an unused key combo that you 
>>> have a chance of remembering, you can map it to "newline-insert newline" 
>>> using Tools > Preferences... > Editing > Shortcuts. That's what Ctrl+Enter 
>>> binds to for me.
>>> 
>>> Paul
>> Paul:
>> 
>> Thanks. The effect appears to work by adding another row to the matrix and 
>> filling it with the partial equation. In your example the new row is on top. 
>> If the long equation is moved to the RHS the new row is 

Re: How to break long equations with LyX

2020-07-15 Thread list_email

> On Jun 20, 2020, at 9:09 PM, Joel Kulesza  wrote:
> 
> On Sat, Jun 20, 2020 at 12:13 PM Paul A. Rubin  > wrote:
> On 6/19/20 9:47 PM, list_em...@icloud.com  
> wrote:
>>> On Jun 19, 2020, at 5:14 PM, Paul A. Rubin  
>>>  wrote:
>>> 
>>> On 6/19/20 7:34 PM, list_em...@icloud.com  
>>> wrote:
> On Jun 19, 2020, at 8:15 AM, Paul A. Rubin  
>  wrote:
> 
> On 6/19/20 7:51 AM, list_em...@icloud.com  
> wrote:
>> I have tried mightily to get LyX to break long equations. I’ve studied 
>> multiple pages at stackexchange, both LaTeX and LyX, and can’t seem to 
>> get anything to work.
>> 
>> I have had luck in the past with the second large block of code at this 
>> page:
>> 
>> https://stackoverflow.com/questions/2904807/lyx-breaking-long-formula-lines
>>  
>> 
>> 
>> but today I have some problems with it.
>> 
>> First, it doesn’t work if the \text command appears inside my own LaTeX 
>> code that appears between \begin{dmath} and \end{dmath} or if I try to 
>> use the trick twice in the same document. (That’s a tentative analysis 
>> of the problem.) Specifically, LyX runs at 100% CPU eventually gives me 
>> a chance to abort and then follows up with this additional message: "The 
>> external program pdflatex finished with an error. It is recommended you 
>> fix the cause of the external program's error (check the logs)."
>> 
>> Plus, I now want to to apply the line breaking to a line within an 
>> aligned environment (Insert -> Math -> Aligned Environment in the menu 
>> system.) This is causing things to look even worse, even though I added 
>> two “aligned” lines to the referenced code block. (If you look at the 
>> code you’ll see the obvious places to add the lines.)
>> 
>> How do LyX-ers handle this? Is there “LyX” solution to breaking long 
>> equations? I’m OK with some ad hoc solution for now, or some ERT if it 
>> works.
>> 
>> Thanks,
>> Jerry
>> 
>> 
> I've never used the breqn package, but with ordinary and AMS math 
> environments, hitting Ctrl-Enter in the middle of a long formula will 
> break it (inserting a line break, \\, in the LaTeX output). If that 
> doesn't achieve what you want, perhaps you could post a minimal example 
> and a specification of what the output should look like.
> 
> Paul
> 
 Thanks, Paul. I’m on a Mac so of course Control-Enter has no meaning. 
 Usually this translates to Mac-speak as Command-Enter. When I do 
 Command-Enter in my equation, which is unfortunately inside a align 
 environment, it instead adds a row to the matrix that represents the align 
 environment. Ditto for Shift-Command-Enter. These two commands in LyX are 
 mapped as Insert -> Formatting -> Ragged Line Break and Justified Line 
 Break, respectively but invoking the menu commands with the cursor in my 
 equation has exactly the same effect: adding a row to the align matrix 
 (above the row where the cursor is.) When (Shift-)Command-Enter is done to 
 a non-align display equation a similar thing happens except now the 
 non-align equation is converted to an align equation with a blank new row 
 _below_ the original equation.
 
 Right now I guess I would be pretty happy with merely a way to make 
 Command-shift (Control-shift) do what is expected which is apparently 
 break the equation instead of creating a new row.
 
 Jerry
 
>>> Jerry,
>>> 
>>> I just created an align environment with two equations, the left side of 
>>> the first being ridiculously long. When I put the cursor somewhere toward 
>>> the middle of the left side of the long equation and inserted a break 
>>> (using Ctrl-Enter -- I'll get to the Mac part in a minute), it broke the 
>>> equation and inserted a new row. So
>>> 
>>> (x+x+x+x+...+x) =1
>>>  y =2
>>> 
>>> (where the right column contained the equal signs and integers) became
>>> 
>>> (x+x+x+...
>>> +x+x+x+x) =1
>>>  y =2
>>> 
>>> where the right column is empty in the first row. See the attached minimal 
>>> example. Is this not what you want?
>>> 
>>> Regarding the key mapping, if you can find an unused key combo that you 
>>> have a chance of remembering, you can map it to "newline-insert newline" 
>>> using Tools > Preferences... > Editing > Shortcuts. That's what Ctrl+Enter 
>>> binds to for me.
>>> 
>>> Paul
>> Paul:
>> 
>> Thanks. The effect appears to work by adding another row to the matrix and 
>> filling it with the partial equation. In your example the new row is on top. 
>> If the long equation is moved to the RHS the new row is 

Re: How to break long equations with LyX

2020-06-20 Thread Joel Kulesza
On Sat, Jun 20, 2020 at 12:13 PM Paul A. Rubin  wrote:

> On 6/19/20 9:47 PM, list_em...@icloud.com wrote:
>
> On Jun 19, 2020, at 5:14 PM, Paul A. Rubin  
>  wrote:
>
> On 6/19/20 7:34 PM, list_em...@icloud.com wrote:
>
> On Jun 19, 2020, at 8:15 AM, Paul A. Rubin  
>  wrote:
>
> On 6/19/20 7:51 AM, list_em...@icloud.com wrote:
>
> I have tried mightily to get LyX to break long equations. I’ve studied 
> multiple pages at stackexchange, both LaTeX and LyX, and can’t seem to get 
> anything to work.
>
> I have had luck in the past with the second large block of code at this page:
> https://stackoverflow.com/questions/2904807/lyx-breaking-long-formula-lines
>
> but today I have some problems with it.
>
> First, it doesn’t work if the \text command appears inside my own LaTeX code 
> that appears between \begin{dmath} and \end{dmath} or if I try to use the 
> trick twice in the same document. (That’s a tentative analysis of the 
> problem.) Specifically, LyX runs at 100% CPU eventually gives me a chance to 
> abort and then follows up with this additional message: "The external program 
> pdflatex finished with an error. It is recommended you fix the cause of the 
> external program's error (check the logs)."
>
> Plus, I now want to to apply the line breaking to a line within an aligned 
> environment (Insert -> Math -> Aligned Environment in the menu system.) This 
> is causing things to look even worse, even though I added two “aligned” lines 
> to the referenced code block. (If you look at the code you’ll see the obvious 
> places to add the lines.)
>
> How do LyX-ers handle this? Is there “LyX” solution to breaking long 
> equations? I’m OK with some ad hoc solution for now, or some ERT if it works.
>
> Thanks,
> Jerry
>
>
>
> I've never used the breqn package, but with ordinary and AMS math 
> environments, hitting Ctrl-Enter in the middle of a long formula will break 
> it (inserting a line break, \\, in the LaTeX output). If that doesn't achieve 
> what you want, perhaps you could post a minimal example and a specification 
> of what the output should look like.
>
> Paul
>
>
> Thanks, Paul. I’m on a Mac so of course Control-Enter has no meaning. Usually 
> this translates to Mac-speak as Command-Enter. When I do Command-Enter in my 
> equation, which is unfortunately inside a align environment, it instead adds 
> a row to the matrix that represents the align environment. Ditto for 
> Shift-Command-Enter. These two commands in LyX are mapped as Insert -> 
> Formatting -> Ragged Line Break and Justified Line Break, respectively but 
> invoking the menu commands with the cursor in my equation has exactly the 
> same effect: adding a row to the align matrix (above the row where the cursor 
> is.) When (Shift-)Command-Enter is done to a non-align display equation a 
> similar thing happens except now the non-align equation is converted to an 
> align equation with a blank new row _below_ the original equation.
>
> Right now I guess I would be pretty happy with merely a way to make 
> Command-shift (Control-shift) do what is expected which is apparently break 
> the equation instead of creating a new row.
>
> Jerry
>
>
> Jerry,
>
> I just created an align environment with two equations, the left side of the 
> first being ridiculously long. When I put the cursor somewhere toward the 
> middle of the left side of the long equation and inserted a break (using 
> Ctrl-Enter -- I'll get to the Mac part in a minute), it broke the equation 
> and inserted a new row. So
>
> (x+x+x+x+...+x) =1
>  y =2
>
> (where the right column contained the equal signs and integers) became
>
> (x+x+x+...
> +x+x+x+x) =1
>  y =2
>
> where the right column is empty in the first row. See the attached minimal 
> example. Is this not what you want?
>
> Regarding the key mapping, if you can find an unused key combo that you have 
> a chance of remembering, you can map it to "newline-insert newline" using 
> Tools > Preferences... > Editing > Shortcuts. That's what Ctrl+Enter binds to 
> for me.
>
> Paul
>
> Paul:
>
> Thanks. The effect appears to work by adding another row to the matrix and 
> filling it with the partial equation. In your example the new row is on top. 
> If the long equation is moved to the RHS the new row is below.
>
> I tried adding horizontal space to the second line of your broken equation 
> but Latex seems to ignore it: when I click outside the math box and the 
> equation is rendered, it is rendered without the horizontal space even though 
> it was visible while in math editing mode.
>
> About Mac key mappings: According to the status line in the document window, 
> when I hit Command-Shift, it displays “(newline-insert newline;) and then 
> icons for “Command” and “new line” which is an arrow thingy. So I’m going to 
> assume that the key mapping is correct but that there is another problem, 
> meaning…
>
> …See my attached example. Attempting to break the line before the second 
> 

Re: How to break long equations with LyX

2020-06-20 Thread Paul A. Rubin

On 6/20/20 8:00 AM, list_em...@icloud.com wrote:

On Jun 19, 2020, at 5:14 PM, Paul A. Rubin  wrote:

On 6/19/20 7:34 PM, list_em...@icloud.com wrote:

On Jun 19, 2020, at 8:15 AM, Paul A. Rubin  wrote:

On 6/19/20 7:51 AM, list_em...@icloud.com wrote:

I have tried mightily to get LyX to break long equations. I’ve studied multiple 
pages at stackexchange, both LaTeX and LyX, and can’t seem to get anything to 
work.

I have had luck in the past with the second large block of code at this page:

https://stackoverflow.com/questions/2904807/lyx-breaking-long-formula-lines

but today I have some problems with it.

First, it doesn’t work if the \text command appears inside my own LaTeX code that appears 
between \begin{dmath} and \end{dmath} or if I try to use the trick twice in the same 
document. (That’s a tentative analysis of the problem.) Specifically, LyX runs at 100% 
CPU eventually gives me a chance to abort and then follows up with this additional 
message: "The external program pdflatex finished with an error. It is recommended 
you fix the cause of the external program's error (check the logs)."

Plus, I now want to to apply the line breaking to a line within an aligned 
environment (Insert -> Math -> Aligned Environment in the menu system.) This is 
causing things to look even worse, even though I added two “aligned” lines to the 
referenced code block. (If you look at the code you’ll see the obvious places to add 
the lines.)

How do LyX-ers handle this? Is there “LyX” solution to breaking long equations? 
I’m OK with some ad hoc solution for now, or some ERT if it works.

Thanks,
Jerry



I've never used the breqn package, but with ordinary and AMS math environments, 
hitting Ctrl-Enter in the middle of a long formula will break it (inserting a 
line break, \\, in the LaTeX output). If that doesn't achieve what you want, 
perhaps you could post a minimal example and a specification of what the output 
should look like.

Paul


Thanks, Paul. I’m on a Mac so of course Control-Enter has no meaning. Usually this 
translates to Mac-speak as Command-Enter. When I do Command-Enter in my equation, 
which is unfortunately inside a align environment, it instead adds a row to the 
matrix that represents the align environment. Ditto for Shift-Command-Enter. These 
two commands in LyX are mapped as Insert -> Formatting -> Ragged Line Break and 
Justified Line Break, respectively but invoking the menu commands with the cursor in 
my equation has exactly the same effect: adding a row to the align matrix (above the 
row where the cursor is.) When (Shift-)Command-Enter is done to a non-align display 
equation a similar thing happens except now the non-align equation is converted to an 
align equation with a blank new row _below_ the original equation.

Right now I guess I would be pretty happy with merely a way to make 
Command-shift (Control-shift) do what is expected which is apparently break the 
equation instead of creating a new row.

Jerry


Jerry,

I just created an align environment with two equations, the left side of the 
first being ridiculously long. When I put the cursor somewhere toward the 
middle of the left side of the long equation and inserted a break (using 
Ctrl-Enter -- I'll get to the Mac part in a minute), it broke the equation and 
inserted a new row. So

 (x+x+x+x+...+x) =1
  y =2

(where the right column contained the equal signs and integers) became

 (x+x+x+...
 +x+x+x+x) =1
  y =2

where the right column is empty in the first row. See the attached minimal 
example. Is this not what you want?

Regarding the key mapping, if you can find an unused key combo that you have a chance of 
remembering, you can map it to "newline-insert newline" using Tools > Preferences... 
> Editing > Shortcuts. That's what Ctrl+Enter binds to for me.

Paul

—

Paul,

I’ve attached an example showing a few things, mainly that 
Command-(Control-)-Enter works with your equation and the equation from Section 
18 of the Math manual but not with my equation.

Jerry



Jerry,

As explained in my reply to your prior message, the breaking in the 
wrong place issue is apparently caused by the use of balanced [] around 
the chubby part of the formula.


Regarding the rest, I also get a bunch of (apparently harmless) LaTeX 
errors/warnings when I compile it. As to why the version you liked 
failed to be transferable to its intended destination, I have no idea 
about that. Although I have the breqn package installed, I have never 
used it, so I don't know with what other packages (or standard LaTeX 
things) it might be incompatible. The change I made in the previous file 
also works here, and (since it is vanilla LaTeX and does not use the 
dmath environment) should be portable.


Paul

-- 
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users


Re: How to break long equations with LyX

2020-06-20 Thread Paul A. Rubin

On 6/19/20 9:47 PM, list_em...@icloud.com wrote:

On Jun 19, 2020, at 5:14 PM, Paul A. Rubin  wrote:

On 6/19/20 7:34 PM, list_em...@icloud.com wrote:

On Jun 19, 2020, at 8:15 AM, Paul A. Rubin  wrote:

On 6/19/20 7:51 AM, list_em...@icloud.com wrote:

I have tried mightily to get LyX to break long equations. I’ve studied multiple 
pages at stackexchange, both LaTeX and LyX, and can’t seem to get anything to 
work.

I have had luck in the past with the second large block of code at this page:

https://stackoverflow.com/questions/2904807/lyx-breaking-long-formula-lines

but today I have some problems with it.

First, it doesn’t work if the \text command appears inside my own LaTeX code that appears 
between \begin{dmath} and \end{dmath} or if I try to use the trick twice in the same 
document. (That’s a tentative analysis of the problem.) Specifically, LyX runs at 100% 
CPU eventually gives me a chance to abort and then follows up with this additional 
message: "The external program pdflatex finished with an error. It is recommended 
you fix the cause of the external program's error (check the logs)."

Plus, I now want to to apply the line breaking to a line within an aligned 
environment (Insert -> Math -> Aligned Environment in the menu system.) This is 
causing things to look even worse, even though I added two “aligned” lines to the 
referenced code block. (If you look at the code you’ll see the obvious places to add 
the lines.)

How do LyX-ers handle this? Is there “LyX” solution to breaking long equations? 
I’m OK with some ad hoc solution for now, or some ERT if it works.

Thanks,
Jerry



I've never used the breqn package, but with ordinary and AMS math environments, 
hitting Ctrl-Enter in the middle of a long formula will break it (inserting a 
line break, \\, in the LaTeX output). If that doesn't achieve what you want, 
perhaps you could post a minimal example and a specification of what the output 
should look like.

Paul


Thanks, Paul. I’m on a Mac so of course Control-Enter has no meaning. Usually this 
translates to Mac-speak as Command-Enter. When I do Command-Enter in my equation, 
which is unfortunately inside a align environment, it instead adds a row to the 
matrix that represents the align environment. Ditto for Shift-Command-Enter. These 
two commands in LyX are mapped as Insert -> Formatting -> Ragged Line Break and 
Justified Line Break, respectively but invoking the menu commands with the cursor in 
my equation has exactly the same effect: adding a row to the align matrix (above the 
row where the cursor is.) When (Shift-)Command-Enter is done to a non-align display 
equation a similar thing happens except now the non-align equation is converted to an 
align equation with a blank new row _below_ the original equation.

Right now I guess I would be pretty happy with merely a way to make 
Command-shift (Control-shift) do what is expected which is apparently break the 
equation instead of creating a new row.

Jerry


Jerry,

I just created an align environment with two equations, the left side of the 
first being ridiculously long. When I put the cursor somewhere toward the 
middle of the left side of the long equation and inserted a break (using 
Ctrl-Enter -- I'll get to the Mac part in a minute), it broke the equation and 
inserted a new row. So

 (x+x+x+x+...+x) =1
  y =2

(where the right column contained the equal signs and integers) became

 (x+x+x+...
 +x+x+x+x) =1
  y =2

where the right column is empty in the first row. See the attached minimal 
example. Is this not what you want?

Regarding the key mapping, if you can find an unused key combo that you have a chance of 
remembering, you can map it to "newline-insert newline" using Tools > Preferences... 
> Editing > Shortcuts. That's what Ctrl+Enter binds to for me.

Paul

Paul:

Thanks. The effect appears to work by adding another row to the matrix and 
filling it with the partial equation. In your example the new row is on top. If 
the long equation is moved to the RHS the new row is below.

I tried adding horizontal space to the second line of your broken equation but 
Latex seems to ignore it: when I click outside the math box and the equation is 
rendered, it is rendered without the horizontal space even though it was 
visible while in math editing mode.

About Mac key mappings: According to the status line in the document window, 
when I hit Command-Shift, it displays “(newline-insert newline;) and then icons 
for “Command” and “new line” which is an arrow thingy. So I’m going to assume 
that the key mapping is correct but that there is another problem, meaning…

…See my attached example. Attempting to break the line before the second 
exponential (1) doesn’t break the line, (2) adds a matrix row above, and (3) 
steals the = from the now-third row and puts it on the second row.

The failure to break with Command-Enter does not seem to be a function of the 
align environment since it also fails in 

Re: How to break long equations with LyX

2020-06-20 Thread list_email

> On Jun 19, 2020, at 5:14 PM, Paul A. Rubin  wrote:
> 
> On 6/19/20 7:34 PM, list_em...@icloud.com wrote:
>>> On Jun 19, 2020, at 8:15 AM, Paul A. Rubin  wrote:
>>> 
>>> On 6/19/20 7:51 AM, list_em...@icloud.com wrote:
 I have tried mightily to get LyX to break long equations. I’ve studied 
 multiple pages at stackexchange, both LaTeX and LyX, and can’t seem to get 
 anything to work.
 
 I have had luck in the past with the second large block of code at this 
 page:
 
 https://stackoverflow.com/questions/2904807/lyx-breaking-long-formula-lines
 
 but today I have some problems with it.
 
 First, it doesn’t work if the \text command appears inside my own LaTeX 
 code that appears between \begin{dmath} and \end{dmath} or if I try to use 
 the trick twice in the same document. (That’s a tentative analysis of the 
 problem.) Specifically, LyX runs at 100% CPU eventually gives me a chance 
 to abort and then follows up with this additional message: "The external 
 program pdflatex finished with an error. It is recommended you fix the 
 cause of the external program's error (check the logs)."
 
 Plus, I now want to to apply the line breaking to a line within an aligned 
 environment (Insert -> Math -> Aligned Environment in the menu system.) 
 This is causing things to look even worse, even though I added two 
 “aligned” lines to the referenced code block. (If you look at the code 
 you’ll see the obvious places to add the lines.)
 
 How do LyX-ers handle this? Is there “LyX” solution to breaking long 
 equations? I’m OK with some ad hoc solution for now, or some ERT if it 
 works.
 
 Thanks,
 Jerry
 
 
>>> I've never used the breqn package, but with ordinary and AMS math 
>>> environments, hitting Ctrl-Enter in the middle of a long formula will break 
>>> it (inserting a line break, \\, in the LaTeX output). If that doesn't 
>>> achieve what you want, perhaps you could post a minimal example and a 
>>> specification of what the output should look like.
>>> 
>>> Paul
>>> 
>> Thanks, Paul. I’m on a Mac so of course Control-Enter has no meaning. 
>> Usually this translates to Mac-speak as Command-Enter. When I do 
>> Command-Enter in my equation, which is unfortunately inside a align 
>> environment, it instead adds a row to the matrix that represents the align 
>> environment. Ditto for Shift-Command-Enter. These two commands in LyX are 
>> mapped as Insert -> Formatting -> Ragged Line Break and Justified Line 
>> Break, respectively but invoking the menu commands with the cursor in my 
>> equation has exactly the same effect: adding a row to the align matrix 
>> (above the row where the cursor is.) When (Shift-)Command-Enter is done to a 
>> non-align display equation a similar thing happens except now the non-align 
>> equation is converted to an align equation with a blank new row _below_ the 
>> original equation.
>> 
>> Right now I guess I would be pretty happy with merely a way to make 
>> Command-shift (Control-shift) do what is expected which is apparently break 
>> the equation instead of creating a new row.
>> 
>> Jerry
>> 
> Jerry,
> 
> I just created an align environment with two equations, the left side of the 
> first being ridiculously long. When I put the cursor somewhere toward the 
> middle of the left side of the long equation and inserted a break (using 
> Ctrl-Enter -- I'll get to the Mac part in a minute), it broke the equation 
> and inserted a new row. So
> 
> (x+x+x+x+...+x) =1
>  y =2
> 
> (where the right column contained the equal signs and integers) became
> 
> (x+x+x+...
> +x+x+x+x) =1
>  y =2
> 
> where the right column is empty in the first row. See the attached minimal 
> example. Is this not what you want?
> 
> Regarding the key mapping, if you can find an unused key combo that you have 
> a chance of remembering, you can map it to "newline-insert newline" using 
> Tools > Preferences... > Editing > Shortcuts. That's what Ctrl+Enter binds to 
> for me.
> 
> Paul
> 
> — 

Paul,

I’ve attached an example showing a few things, mainly that 
Command-(Control-)-Enter works with your equation and the equation from Section 
18 of the Math manual but not with my equation.

Jerry



Breaking Bad.lyx
Description: Binary data
-- 
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users


Re: How to break long equations with LyX

2020-06-20 Thread Steve Litt
On Fri, 19 Jun 2020 07:26:30 -0600
Joel Kulesza  wrote:

> On Fri, Jun 19, 2020 at 5:51 AM  wrote:
> 
> > I have tried mightily to get LyX to break long equations. I’ve
> > studied multiple pages at stackexchange, both LaTeX and LyX, and
> > can’t seem to get anything to work.
> >
> > ...
> >
> > How do LyX-ers handle this? Is there “LyX” solution to breaking long
> > equations? I’m OK with some ad hoc solution for now, or some ERT if
> > it works.
> >  
> 
> Jerry,
> 
> I regret that I don't have any good guidance to satisfy your desire to
> automatically break equations.  One benefit to LaTeX is the aesthetic
> as a result of the underlying algorithms, but I know of no automatic
> algorithms to universally break equations well.  I suspect this is
> the case because each component in the equation has distinct meaning
> and how the equation is broken and aligned can help the reader
> interpret it (e.g., breaking at "logical" places).

One thing I've been known to do is to put in a lot of intermediate
steps, so each equation is short.

SteveT

Steve Litt 
May 2020 featured book: Troubleshooting Techniques
 of the Successful Technologist
http://www.troubleshooters.com/techniques
-- 
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users


Re: How to break long equations with LyX

2020-06-19 Thread list_email

> On Jun 19, 2020, at 5:14 PM, Paul A. Rubin  wrote:
> 
> On 6/19/20 7:34 PM, list_em...@icloud.com wrote:
>>> On Jun 19, 2020, at 8:15 AM, Paul A. Rubin  wrote:
>>> 
>>> On 6/19/20 7:51 AM, list_em...@icloud.com wrote:
 I have tried mightily to get LyX to break long equations. I’ve studied 
 multiple pages at stackexchange, both LaTeX and LyX, and can’t seem to get 
 anything to work.
 
 I have had luck in the past with the second large block of code at this 
 page:
 
 https://stackoverflow.com/questions/2904807/lyx-breaking-long-formula-lines
 
 but today I have some problems with it.
 
 First, it doesn’t work if the \text command appears inside my own LaTeX 
 code that appears between \begin{dmath} and \end{dmath} or if I try to use 
 the trick twice in the same document. (That’s a tentative analysis of the 
 problem.) Specifically, LyX runs at 100% CPU eventually gives me a chance 
 to abort and then follows up with this additional message: "The external 
 program pdflatex finished with an error. It is recommended you fix the 
 cause of the external program's error (check the logs)."
 
 Plus, I now want to to apply the line breaking to a line within an aligned 
 environment (Insert -> Math -> Aligned Environment in the menu system.) 
 This is causing things to look even worse, even though I added two 
 “aligned” lines to the referenced code block. (If you look at the code 
 you’ll see the obvious places to add the lines.)
 
 How do LyX-ers handle this? Is there “LyX” solution to breaking long 
 equations? I’m OK with some ad hoc solution for now, or some ERT if it 
 works.
 
 Thanks,
 Jerry
 
 
>>> I've never used the breqn package, but with ordinary and AMS math 
>>> environments, hitting Ctrl-Enter in the middle of a long formula will break 
>>> it (inserting a line break, \\, in the LaTeX output). If that doesn't 
>>> achieve what you want, perhaps you could post a minimal example and a 
>>> specification of what the output should look like.
>>> 
>>> Paul
>>> 
>> Thanks, Paul. I’m on a Mac so of course Control-Enter has no meaning. 
>> Usually this translates to Mac-speak as Command-Enter. When I do 
>> Command-Enter in my equation, which is unfortunately inside a align 
>> environment, it instead adds a row to the matrix that represents the align 
>> environment. Ditto for Shift-Command-Enter. These two commands in LyX are 
>> mapped as Insert -> Formatting -> Ragged Line Break and Justified Line 
>> Break, respectively but invoking the menu commands with the cursor in my 
>> equation has exactly the same effect: adding a row to the align matrix 
>> (above the row where the cursor is.) When (Shift-)Command-Enter is done to a 
>> non-align display equation a similar thing happens except now the non-align 
>> equation is converted to an align equation with a blank new row _below_ the 
>> original equation.
>> 
>> Right now I guess I would be pretty happy with merely a way to make 
>> Command-shift (Control-shift) do what is expected which is apparently break 
>> the equation instead of creating a new row.
>> 
>> Jerry
>> 
> Jerry,
> 
> I just created an align environment with two equations, the left side of the 
> first being ridiculously long. When I put the cursor somewhere toward the 
> middle of the left side of the long equation and inserted a break (using 
> Ctrl-Enter -- I'll get to the Mac part in a minute), it broke the equation 
> and inserted a new row. So
> 
> (x+x+x+x+...+x) =1
>  y =2
> 
> (where the right column contained the equal signs and integers) became
> 
> (x+x+x+...
> +x+x+x+x) =1
>  y =2
> 
> where the right column is empty in the first row. See the attached minimal 
> example. Is this not what you want?
> 
> Regarding the key mapping, if you can find an unused key combo that you have 
> a chance of remembering, you can map it to "newline-insert newline" using 
> Tools > Preferences... > Editing > Shortcuts. That's what Ctrl+Enter binds to 
> for me.
> 
> Paul

Paul:

Thanks. The effect appears to work by adding another row to the matrix and 
filling it with the partial equation. In your example the new row is on top. If 
the long equation is moved to the RHS the new row is below.

I tried adding horizontal space to the second line of your broken equation but 
Latex seems to ignore it: when I click outside the math box and the equation is 
rendered, it is rendered without the horizontal space even though it was 
visible while in math editing mode.

About Mac key mappings: According to the status line in the document window, 
when I hit Command-Shift, it displays “(newline-insert newline;) and then icons 
for “Command” and “new line” which is an arrow thingy. So I’m going to assume 
that the key mapping is correct but that there is another problem, meaning…

…See my attached example. Attempting to break the line before the 

Re: How to break long equations with LyX

2020-06-19 Thread list_email

> On Jun 19, 2020, at 8:15 AM, Paul A. Rubin  wrote:
> 
> On 6/19/20 7:51 AM, list_em...@icloud.com wrote:
>> I have tried mightily to get LyX to break long equations. I’ve studied 
>> multiple pages at stackexchange, both LaTeX and LyX, and can’t seem to get 
>> anything to work.
>> 
>> I have had luck in the past with the second large block of code at this page:
>> 
>> https://stackoverflow.com/questions/2904807/lyx-breaking-long-formula-lines
>> 
>> but today I have some problems with it.
>> 
>> First, it doesn’t work if the \text command appears inside my own LaTeX code 
>> that appears between \begin{dmath} and \end{dmath} or if I try to use the 
>> trick twice in the same document. (That’s a tentative analysis of the 
>> problem.) Specifically, LyX runs at 100% CPU eventually gives me a chance to 
>> abort and then follows up with this additional message: "The external 
>> program pdflatex finished with an error. It is recommended you fix the cause 
>> of the external program's error (check the logs)."
>> 
>> Plus, I now want to to apply the line breaking to a line within an aligned 
>> environment (Insert -> Math -> Aligned Environment in the menu system.) This 
>> is causing things to look even worse, even though I added two “aligned” 
>> lines to the referenced code block. (If you look at the code you’ll see the 
>> obvious places to add the lines.)
>> 
>> How do LyX-ers handle this? Is there “LyX” solution to breaking long 
>> equations? I’m OK with some ad hoc solution for now, or some ERT if it works.
>> 
>> Thanks,
>> Jerry
>> 
>> 
> I've never used the breqn package, but with ordinary and AMS math 
> environments, hitting Ctrl-Enter in the middle of a long formula will break 
> it (inserting a line break, \\, in the LaTeX output). If that doesn't achieve 
> what you want, perhaps you could post a minimal example and a specification 
> of what the output should look like.
> 
> Paul
> 
Thanks, Paul. I’m on a Mac so of course Control-Enter has no meaning. Usually 
this translates to Mac-speak as Command-Enter. When I do Command-Enter in my 
equation, which is unfortunately inside a align environment, it instead adds a 
row to the matrix that represents the align environment. Ditto for 
Shift-Command-Enter. These two commands in LyX are mapped as Insert -> 
Formatting -> Ragged Line Break and Justified Line Break, respectively but 
invoking the menu commands with the cursor in my equation has exactly the same 
effect: adding a row to the align matrix (above the row where the cursor is.) 
When (Shift-)Command-Enter is done to a non-align display equation a similar 
thing happens except now the non-align equation is converted to an align 
equation with a blank new row _below_ the original equation.

Right now I guess I would be pretty happy with merely a way to make 
Command-shift (Control-shift) do what is expected which is apparently break the 
equation instead of creating a new row.

Jerry

-- 
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users


Re: How to break long equations with LyX

2020-06-19 Thread Paul A. Rubin

On 6/19/20 7:34 PM, list_em...@icloud.com wrote:

On Jun 19, 2020, at 8:15 AM, Paul A. Rubin  wrote:

On 6/19/20 7:51 AM, list_em...@icloud.com wrote:

I have tried mightily to get LyX to break long equations. I’ve studied multiple 
pages at stackexchange, both LaTeX and LyX, and can’t seem to get anything to 
work.

I have had luck in the past with the second large block of code at this page:

https://stackoverflow.com/questions/2904807/lyx-breaking-long-formula-lines

but today I have some problems with it.

First, it doesn’t work if the \text command appears inside my own LaTeX code that appears 
between \begin{dmath} and \end{dmath} or if I try to use the trick twice in the same 
document. (That’s a tentative analysis of the problem.) Specifically, LyX runs at 100% 
CPU eventually gives me a chance to abort and then follows up with this additional 
message: "The external program pdflatex finished with an error. It is recommended 
you fix the cause of the external program's error (check the logs)."

Plus, I now want to to apply the line breaking to a line within an aligned 
environment (Insert -> Math -> Aligned Environment in the menu system.) This is 
causing things to look even worse, even though I added two “aligned” lines to the 
referenced code block. (If you look at the code you’ll see the obvious places to add 
the lines.)

How do LyX-ers handle this? Is there “LyX” solution to breaking long equations? 
I’m OK with some ad hoc solution for now, or some ERT if it works.

Thanks,
Jerry



I've never used the breqn package, but with ordinary and AMS math environments, 
hitting Ctrl-Enter in the middle of a long formula will break it (inserting a 
line break, \\, in the LaTeX output). If that doesn't achieve what you want, 
perhaps you could post a minimal example and a specification of what the output 
should look like.

Paul


Thanks, Paul. I’m on a Mac so of course Control-Enter has no meaning. Usually this 
translates to Mac-speak as Command-Enter. When I do Command-Enter in my equation, 
which is unfortunately inside a align environment, it instead adds a row to the 
matrix that represents the align environment. Ditto for Shift-Command-Enter. These 
two commands in LyX are mapped as Insert -> Formatting -> Ragged Line Break and 
Justified Line Break, respectively but invoking the menu commands with the cursor in 
my equation has exactly the same effect: adding a row to the align matrix (above the 
row where the cursor is.) When (Shift-)Command-Enter is done to a non-align display 
equation a similar thing happens except now the non-align equation is converted to an 
align equation with a blank new row _below_ the original equation.

Right now I guess I would be pretty happy with merely a way to make 
Command-shift (Control-shift) do what is expected which is apparently break the 
equation instead of creating a new row.

Jerry


Jerry,

I just created an align environment with two equations, the left side of 
the first being ridiculously long. When I put the cursor somewhere 
toward the middle of the left side of the long equation and inserted a 
break (using Ctrl-Enter -- I'll get to the Mac part in a minute), it 
broke the equation and inserted a new row. So


    (x+x+x+x+...+x) =1
 y =2

(where the right column contained the equal signs and integers) became

    (x+x+x+...
    +x+x+x+x) =1
 y =2

where the right column is empty in the first row. See the attached 
minimal example. Is this not what you want?


Regarding the key mapping, if you can find an unused key combo that you 
have a chance of remembering, you can map it to "newline-insert newline" 
using Tools > Preferences... > Editing > Shortcuts. That's what 
Ctrl+Enter binds to for me.


Paul



breakeq.lyx
Description: application/lyx
-- 
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users


How to break long equations with LyX

2020-06-19 Thread list_email
I have tried mightily to get LyX to break long equations. I’ve studied multiple 
pages at stackexchange, both LaTeX and LyX, and can’t seem to get anything to 
work.

I have had luck in the past with the second large block of code at this page:

https://stackoverflow.com/questions/2904807/lyx-breaking-long-formula-lines

but today I have some problems with it.

First, it doesn’t work if the \text command appears inside my own LaTeX code 
that appears between \begin{dmath} and \end{dmath} or if I try to use the trick 
twice in the same document. (That’s a tentative analysis of the problem.) 
Specifically, LyX runs at 100% CPU eventually gives me a chance to abort and 
then follows up with this additional message: "The external program pdflatex 
finished with an error. It is recommended you fix the cause of the external 
program's error (check the logs)."

Plus, I now want to to apply the line breaking to a line within an aligned 
environment (Insert -> Math -> Aligned Environment in the menu system.) This is 
causing things to look even worse, even though I added two “aligned” lines to 
the referenced code block. (If you look at the code you’ll see the obvious 
places to add the lines.)

How do LyX-ers handle this? Is there “LyX” solution to breaking long equations? 
I’m OK with some ad hoc solution for now, or some ERT if it works.

Thanks,
Jerry


-- 
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users


Re: How to break long equations with LyX

2020-06-19 Thread Paul A. Rubin

On 6/19/20 7:51 AM, list_em...@icloud.com wrote:

I have tried mightily to get LyX to break long equations. I’ve studied multiple 
pages at stackexchange, both LaTeX and LyX, and can’t seem to get anything to 
work.

I have had luck in the past with the second large block of code at this page:

https://stackoverflow.com/questions/2904807/lyx-breaking-long-formula-lines

but today I have some problems with it.

First, it doesn’t work if the \text command appears inside my own LaTeX code that appears 
between \begin{dmath} and \end{dmath} or if I try to use the trick twice in the same 
document. (That’s a tentative analysis of the problem.) Specifically, LyX runs at 100% 
CPU eventually gives me a chance to abort and then follows up with this additional 
message: "The external program pdflatex finished with an error. It is recommended 
you fix the cause of the external program's error (check the logs)."

Plus, I now want to to apply the line breaking to a line within an aligned 
environment (Insert -> Math -> Aligned Environment in the menu system.) This is 
causing things to look even worse, even though I added two “aligned” lines to the 
referenced code block. (If you look at the code you’ll see the obvious places to add 
the lines.)

How do LyX-ers handle this? Is there “LyX” solution to breaking long equations? 
I’m OK with some ad hoc solution for now, or some ERT if it works.

Thanks,
Jerry


I've never used the breqn package, but with ordinary and AMS math 
environments, hitting Ctrl-Enter in the middle of a long formula will 
break it (inserting a line break, \\, in the LaTeX output). If that 
doesn't achieve what you want, perhaps you could post a minimal example 
and a specification of what the output should look like.


Paul

--
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users


Re: How to break long equations with LyX

2020-06-19 Thread Joel Kulesza
On Fri, Jun 19, 2020 at 5:51 AM  wrote:

> I have tried mightily to get LyX to break long equations. I’ve studied
> multiple pages at stackexchange, both LaTeX and LyX, and can’t seem to get
> anything to work.
>
> ...
>
> How do LyX-ers handle this? Is there “LyX” solution to breaking long
> equations? I’m OK with some ad hoc solution for now, or some ERT if it
> works.
>

Jerry,

I regret that I don't have any good guidance to satisfy your desire to
automatically break equations.  One benefit to LaTeX is the aesthetic as a
result of the underlying algorithms, but I know of no automatic algorithms
to universally break equations well.  I suspect this is the case because
each component in the equation has distinct meaning and how the equation is
broken and aligned can help the reader interpret it (e.g., breaking at
"logical" places).

As such, the two approaches I take are to either use multiline or aligned
equations (with the "right-hand side" indented with a manual \quad).  This
has produced equations I'm usually happy with.  Multiline is a bit more
"automatic," but it can produce equations that aren't totally satisfying
(e.g., 6b in this paper

).

Sorry I can't offer a good and direct answer, but I hope these thoughts
help.

- Joel
-- 
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users