[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice-devel
Subject:    KFormula LaTex patch
From:       Brian Bockelman <bockelman () gmail ! com>
Date:       2005-04-25 1:56:55
Message-ID: 58d9f36f050424185677525405 () mail ! gmail ! com
[Download RAW message or body]

Attached is a little patch that cleans up the LaTex output from KFormula.

For example, the integral of x^2 was represented as:

{ \int{{ {}{ x}^{ 2}}}}

Now, it is the following:

\int x^{2}

Is there any active maintainer of KFormula?  I have a few usability
ideas for it, and I would like to know what the maintainer thought of
them.

Brian Bockelman

["kformula-latex.patch" (text/x-diff)]

diff -r kde/koffice/lib/kformula/bracketelement.cc koffice-050423/lib/kformula/bracketelement.cc
419,420c419,420
<     ls="\\left"+latexString(leftType);
<     rs="\\right"+latexString(rightType);
---
>     ls="\\left"+latexString(leftType) + " ";
>     rs=" \\right"+latexString(rightType);
diff -r kde/koffice/lib/kformula/fractionelement.cc koffice-050423/lib/kformula/fractionelement.cc
451c451
<         return "\\frac" + numerator->toLatex() + denominator->toLatex();
---
>         return "\\frac{" + numerator->toLatex() +"}{" + denominator->toLatex() + "}";
diff -r kde/koffice/lib/kformula/indexelement.cc koffice-050423/lib/kformula/indexelement.cc
1327c1327
<         index += "\\overset" + upperMiddle->toLatex() + "{";
---
>         index += "\\overset{" + upperMiddle->toLatex() + "}{";
1331c1331
<         index += "\\underset" + lowerMiddle->toLatex() + "{";
---
>         index += "\\underset{" + lowerMiddle->toLatex() + "}{";
1334,1335c1334,1335
<     if ( hasUpperLeft() || hasUpperRight() ) {
<         index += "{}";
---
>     if ( hasUpperLeft() || hasUpperRight() ) { //Not sure that this is possible in Latex!
>         /*index += "{}";
1339a1340
>         */
1344,1347c1345,1351
<     if ( hasUpperRight() )
<         index += "^" + upperRight->toLatex();
<     if ( hasLowerRight() )
<         index += "_" + lowerRight->toLatex();
---
>     if ( hasUpperRight() || hasLowerRight() ) {
>         if ( hasUpperRight() )
>             index += "^{" + upperRight->toLatex() + "}";
>         if ( hasLowerRight() )
>             index += "_{" + lowerRight->toLatex() + "}";
>         index += " ";
>     }
165c167
<  * Wether we want to insert to the left of the cursor
---
>  * Whether we want to insert to the left of the cursor
diff -r kde/koffice/lib/kformula/matrixelement.cc koffice-050423/lib/kformula/matrixelement.cc
843c843
<     matrix+="}";
---
>     matrix+="} ";
853c853
<     matrix+="\\end{array}";
---
>     matrix+=" \\end{array}";
diff -r kde/koffice/lib/kformula/sequenceelement.cc koffice-050423/lib/kformula/sequenceelement.cc
1444d1443
<     content += "{";
1449c1448
<             content += " ";
---
>             content += "";
1453d1451
<     content += "}";
diff -r kde/koffice/lib/kformula/symbolelement.cc koffice-050423/lib/kformula/symbolelement.cc
813c818
< 	sym+="}";
---
> 	sym+="} ";
816,818c821,823
<         sym+="{";
< 	sym+=content->toLatex();
< 	sym+="}";
---
>     sym += " ";
> 
>     sym+=content->toLatex();
diff -r kde/koffice/lib/kformula/textelement.cc koffice-050423/lib/kformula/textelement.cc
448c448
<             return "\\" + texName;
---
>             return " \\" + texName + " ";
452c452
<         return character;
---
>         return QString(character);


_______________________________________________
koffice-devel mailing list
koffice-devel@kde.org
https://mail.kde.org/mailman/listinfo/koffice-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic