Hi, It seems that GiNaC, when (for example) collecting expressions and then printing them to LaTeX adds some braces in additions to parentheses. For example symbol x("x"), y("y"), t("t"); ex e = x*t + y*t; collect(e,t).print(GiNaC::print_latex()); ouputs t {(y+x)} Is there any way (an option?) to remove the extra braces? Indeed, they force TeX NOT to BREAK the expression (i.e., it must fit on a single line) which is problematic when the expression is long. Thanks, ChriS
Hi there, On Wed, 12 Dec 2001, Christophe TROESTLER wrote:
It seems that GiNaC, when (for example) collecting expressions and then printing them to LaTeX adds some braces in additions to parentheses. For example
symbol x("x"), y("y"), t("t"); ex e = x*t + y*t; collect(e,t).print(GiNaC::print_latex());
ouputs
t {(y+x)}
Is there any way (an option?) to remove the extra braces? Indeed, they force TeX NOT to BREAK the expression (i.e., it must fit on a single line) which is problematic when the expression is long.
I don't know, I didn't write this. I just hope it was intentional. Why am I answering, then? Because I am surprised to hear that TeX actually breaks expressions. Does it? It certainly never did for my own work! Are you using some packages to do this or am I using packages that prevent breaking or does the computer just not like me??? seriously puzzled... -richy. -- Richard B. Kreckel <Richard.Kreckel@Uni-Mainz.DE> <http://wwwthep.physik.uni-mainz.de/~kreckel/>
Hello everybody, On Wed, 12 Dec 2001, Richard B. Kreckel wrote:
Because I am surprised to hear that TeX actually breaks expressions. Does it? It certainly never did for my own work! Are you using some packages to do this or am I using packages that prevent breaking or does the computer just not like me???
TeX does so automatically. In formulas typed in text it automatically inserts a \relpenalty after every relation symbol (such as =) and \binoppenalty after every binary operation (such as +). You can set these to 10000 if you want to prohibit line-breaking in text-formulas. LaTeX and TeX both set \relpenalty=500 and \binoppenalty=700 (of course, classes and packages can change this). If you put an expression into braces, it becomes a subexpression that can't be broken anymore. Greetings, Chris Dams
Hello, On Wed, 12 Dec 2001, Chris Dams wrote:
Hello everybody,
On Wed, 12 Dec 2001, Richard B. Kreckel wrote:
Because I am surprised to hear that TeX actually breaks expressions. Does it? It certainly never did for my own work! Are you using some packages to do this or am I using packages that prevent breaking or does the computer just not like me???
TeX does so automatically. In formulas typed in text it automatically inserts a \relpenalty after every relation symbol (such as =) and \binoppenalty after every binary operation (such as +). You can set these to 10000 if you want to prohibit line-breaking in text-formulas. LaTeX and TeX both set \relpenalty=500 and \binoppenalty=700 (of course, classes and packages can change this). If you put an expression into braces, it becomes a subexpression that can't be broken anymore.
Sorry for the confusion. I was talking about equation mode, all others seem to have been talking about in-text math mode, i.e. the one delimited by `$' or by `\(' and `\)'. Anyway, the offending braces come from file add.cpp, lines 163 and 214, just in case anybody wants to play around with them. But careful, I guess they were intentional and meant just for the purpose of not breaking lines. Please report to this list if you are absolutely sure that they should be removed. Regards -richy. -- Richard B. Kreckel <Richard.Kreckel@Uni-Mainz.DE> <http://wwwthep.physik.uni-mainz.de/~kreckel/>
On Thu, 13 Dec 2001, "Richard B. Kreckel" <kreckel@thep.physik.uni-mainz.de> wrote:
[...]
Anyway, the offending braces come from file add.cpp, lines 163 and 214, just in case anybody wants to play around with them. But careful, I guess they were intentional and meant just for the purpose of not breaking lines. Please report to this list if you are absolutely sure that they should be removed.
There are some as well in `numeric.cpp' at lines 386 & 387, `mul.cpp' lines 184 & 231, `power.cpp' lines 185 & 201, and `pseries.cpp' lines 159 & 160. I just had a quick look so I may have missed something but I basically don't understand why they are there (no problem with \frac or other TeX operators it seems and I don't get the point about not breaking lines since formulae easily become quite long). Maybe the one who wrote that part of the code could tell us what was his reason? Regards, ChriS
participants (4)
-
Chris Dams
-
Christophe TROESTLER
-
Christophe TROESTLER
-
Richard B. Kreckel