Quantcast

[Jlatexmath] Option for max. width vs exact width

classic Classic list List threaded Threaded
11 messages Options
Felix Natter Felix Natter
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Jlatexmath] Option for max. width vs exact width

hello,

I added an option (patch attached) which we need for freeplane: If you
specify widthUnit, textwidth and align, then the Icon will always have
width 'textwidth'. We would like to have icons that are just as wide as
the formula is while still specifying a maximum width for automatic
linebreaks.

Fortunately, this is easy to do: replace

HorizontalBox hb = new HorizontalBox(BreakFormula.split(box,
  te.getTextwidth(), il), te.getTextwidth(), align);

with

HorizontalBox hb = new HorizontalBox(BreakFormula.split(box,
  te.getTextwidth(), il), 0, align);

if you want the width to be interpreted as maximum width only.

Because the TeXFormula.createTeXIcon(...) methods contain a lot of
parameters, I applied the Builder pattern (TeXFormula.TeXIconBuilder,
see patch attached) to replace the createTeXIcon(...) methods.

With the Builder (inner class), this:

                TeXIcon icon = formula.createTeXIcon(TeXConstants.STYLE_TEXT, 20, TeXConstants.UNIT_PIXEL, 600f,
                                TeXConstants.ALIGN_LEFT, TeXConstants.UNIT_PIXEL, 20f);

becomes this (which IMHO is much more readable and extensible):

                TeXIcon icon = formula.new TeXIconBuilder()
            .setStyle(TeXConstants.STYLE_TEXT)
            .setSize(50)
            .setWidth(TeXConstants.UNIT_PIXEL, 128f, TeXConstants.ALIGN_LEFT)
            .setIsMaxWidth(false).setInterLineSpacing(TeXConstants.UNIT_PIXEL, 20f)
            .build();

The builder method "setIsMaxWidth()" is used to realize our "width is
maximum width" feature.

Could you consider applying this patch?
If not, please tell me what I can do to fix it :-)

What needs to be done:
- make the createTeXIcon(...) methods use the TeXIconBuilder (avoid
  redundancy)
- Check for invalid combinations of the setXXX() methods (I started
  doing this, but it may not be complete)

Thank you!
--
Felix Natter

diff --git a/src/org/scilab/forge/jlatexmath/TeXFormula.java b/src/org/scilab/forge/jlatexmath/TeXFormula.java
index 9e67acd..07bd40a 100644
--- a/src/org/scilab/forge/jlatexmath/TeXFormula.java
+++ b/src/org/scilab/forge/jlatexmath/TeXFormula.java
@@ -597,6 +597,180 @@ public class TeXFormula {
 
         return dtf;
     }
+    
+    /**
+     * Apply the Builder pattern instead of using the createTeXIcon(...) factories
+     * @author Felix Natter
+     *
+     */
+    public class TeXIconBuilder {
+     private Integer style;
+     private Float size;
+     private Integer type;
+     private Color fgcolor;
+     private boolean trueValues = false;
+     private Integer widthUnit;
+     private Float textWidth;
+     private Integer align;
+     private boolean isMaxWidth = false;
+     private Integer interLineUnit;
+     private Float interLineSpacing;
+    
+     /**
+     * Specify the style for rendering the given TeXFormula
+     * @param style the style
+     * @return the builder, used for chaining
+     */
+     public TeXIconBuilder setStyle(final int style)
+     {
+     this.style = style;
+     return this;
+     }
+
+     /**
+     * Specify the font size for rendering the given TeXFormula
+     * @param size the size
+     * @return the builder, used for chaining
+     */
+     public TeXIconBuilder setSize(final float size)
+     {
+     this.size = size;
+     return this;
+     }
+    
+     /**
+     * Specify the font type for rendering the given TeXFormula
+     * @param type the font type
+     * @return the builder, used for chaining
+     */
+     public TeXIconBuilder setType(final int type)
+     {
+     this.type = type;
+     return this;
+     }
+    
+     /**
+     * Specify the background color for rendering the given TeXFormula
+     * @param fgcolor the foreground color
+     * @return the builder, used for chaining
+     */
+     public TeXIconBuilder setFGColor(final Color fgcolor)
+     {
+     this.fgcolor = fgcolor;
+     return this;
+     }
+    
+     /**
+     * Specify the "true values" parameter for rendering the given TeXFormula
+     * @param trueValues the "true values" value
+     * @return the builder, used for chaining
+     */
+     public TeXIconBuilder setTrueValues(final boolean trueValues)
+     {
+     this.trueValues = trueValues;
+     return this;
+     }
+    
+     /**
+     * Specify the width of the formula (may be exact or maximum width, see {@link #setIsMaxWidth(boolean)})
+     * @param widthUnit the width unit
+     * @param textWidth the width
+     * @param align the alignment
+     * @return the builder, used for chaining
+     */
+     public TeXIconBuilder setWidth(final int widthUnit, final float textWidth, final int align)
+     {
+     this.widthUnit = widthUnit;
+     this.textWidth = textWidth;
+     this.align = align;
+     trueValues = true; // TODO: is this necessary?
+     return this;
+     }
+    
+     /**
+     * Specifies whether the width is the exact or the maximum width
+     * @param isMaxWidth whether the width is a maximum width
+     * @return the builder, used for chaining
+     */
+     public TeXIconBuilder setIsMaxWidth(final boolean isMaxWidth)
+     {
+     if (widthUnit == null)
+     {
+     throw new IllegalStateException("Cannot set 'isMaxWidth' without having specified a width!");
+     }
+     this.isMaxWidth = isMaxWidth;
+     return this;
+     }
+    
+     /**
+     * Specify the inter line spacing unit and value. NOTE: this is required for automatic linebreaks to work!
+     * @param interLineUnit the unit
+     * @param interLineSpacing the value
+     * @return the builder, used for chaining
+     */
+     public TeXIconBuilder setInterLineSpacing(final int interLineUnit, final float interLineSpacing)
+     {
+     if (widthUnit == null)
+     {
+     throw new IllegalStateException("Cannot set inter line spacing without having specified a width!");
+     }
+     this.interLineUnit = interLineUnit;
+     this.interLineSpacing = interLineSpacing;
+     return this;
+     }
+    
+     /**
+     * Create a TeXIcon from the information gathered by the (chained) setXXX() methods.
+     * (see Builder pattern)
+     * @return the TeXIcon
+     */
+     public TeXIcon build()
+     {
+     if (style == null)
+     {
+     throw new IllegalStateException("A style is required. Use setStyle()");
+     }
+     if (size == null)
+     {
+     throw new IllegalStateException("A size is required. Use setStyle()");
+     }
+     DefaultTeXFont font = (type == null) ? new DefaultTeXFont(size) : createFont(size, type);
+     TeXEnvironment te;
+     if (widthUnit != null)
+     {
+     te = new TeXEnvironment(style, font, widthUnit, textWidth);
+     }
+     else
+     {
+     te = new TeXEnvironment(style, font);
+     }
+     Box box = createBox(te);
+     TeXIcon ti;
+     if (widthUnit != null)
+     {
+     HorizontalBox hb;
+     if (interLineUnit != null)
+     {
+     float il = interLineSpacing * SpaceAtom.getFactor(interLineUnit, te);
+     hb = new HorizontalBox(BreakFormula.split(box, te.getTextwidth(), il), isMaxWidth ? 0 : te.getTextwidth(), align);
+     }
+     else
+     {
+     hb = new HorizontalBox(box, isMaxWidth ? 0 : te.getTextwidth(), align);
+     }
+     ti = new TeXIcon(hb, size, trueValues);
+     }
+     else
+     {
+     ti = new TeXIcon(box, size, trueValues);
+     }
+     if (fgcolor != null) {
+     ti.setForeground(fgcolor);
+     }
+     ti.isColored = te.isColored;
+     return ti;
+     }
+    }
 
     /**
      * Creates a TeXIcon from this TeXFormula using the default TeXFont in the given

_______________________________________________
jlatexmath mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/jlatexmath
Felix Natter Felix Natter
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Jlatexmath] Option for max. width vs exact width

hello Calixte,

Felix Natter <[hidden email]> writes:
> hello,
>
> I added an option (patch attached) which we need for freeplane: If you
> specify widthUnit, textwidth and align, then the Icon will always have
> width 'textwidth'. We would like to have icons that are just as wide as
> the formula is while still specifying a maximum width for automatic
> linebreaks.

=> could you please reply to my request? It's a very simple change,
and it would help us at the Freeplane project very much :-)

Thanks and Best Regards!
--
Felix Natter
_______________________________________________
jlatexmath mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/jlatexmath
Sylvestre Ledru-4 Sylvestre Ledru-4
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Jlatexmath] Option for max. width vs exact width

On 17/12/2012 10:55, Felix Natter wrote:

> hello Calixte,
>
> Felix Natter <[hidden email]> writes:
>> hello,
>>
>> I added an option (patch attached) which we need for freeplane: If you
>> specify widthUnit, textwidth and align, then the Icon will always have
>> width 'textwidth'. We would like to have icons that are just as wide as
>> the formula is while still specifying a maximum width for automatic
>> linebreaks.
>
> => could you please reply to my request? It's a very simple change,
> and it would help us at the Freeplane project very much :-)

Here it is:
http://forge.scilab.org/index.php/p/jlatexmath/source/commit/1fe5802e9d61d95b86a2181e08126268a5384198/

If Calixte agrees, we can make a release today.


> the patch concerning \mbox-handling definitely needs a
> review (I don't know what the default TeXParserContext should be for a
> few macros).
I guess you are referring to this mail:
http://lists.scilab.org/pipermail/jlatexmath/2012-October/000098.html

If it is the case, could you write some examples which shows the
improvements of your patch ?
And test that your patch is not breaking anything ?
We have an "examples" directory.

Thanks,
Sylvestre
_______________________________________________
jlatexmath mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/jlatexmath
Felix Natter Felix Natter
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Jlatexmath] Option for max. width vs exact width

Sylvestre Ledru <[hidden email]> writes:

> On 17/12/2012 10:55, Felix Natter wrote:
>> hello Calixte,
>>
>> Felix Natter <[hidden email]> writes:
>>> hello,
>>>
>>> I added an option (patch attached) which we need for freeplane: If you
>>> specify widthUnit, textwidth and align, then the Icon will always have
>>> width 'textwidth'. We would like to have icons that are just as wide as
>>> the formula is while still specifying a maximum width for automatic
>>> linebreaks.
>>
>> => could you please reply to my request? It's a very simple change,
>> and it would help us at the Freeplane project very much :-)

hi Sylvestre,

> Here it is:
> http://forge.scilab.org/index.php/p/jlatexmath/source/commit/1fe5802e9d61d95b86a2181e08126268a5384198/

Thanks.

One thing that we should still do is modify the createTeXIcon(...)
factories to use the TeXIconBuilder in order to avoid redundancy.
Shall I provide a patch for this?

I am not sure whether setIsMaxWidth(true) breaks anything for align !=
TeXConstants.ALIGN_LEFT. Could you check this (we're not using this
currently)? If it does, we can just throw an IllegalStateException if
setIsMaxWidth(true) and align != TeXConstants.ALIGN_LEFT are used in
combination.

> If Calixte agrees, we can make a release today.

Perfect, but please see my comment above.

>> the patch concerning \mbox-handling definitely needs a
>> review (I don't know what the default TeXParserContext should be for a
>> few macros).
> I guess you are referring to this mail:
> http://lists.scilab.org/pipermail/jlatexmath/2012-October/000098.html

Please see this one:
  http://lists.scilab.org/pipermail/jlatexmath/2012-November/000103.html
I corrected myself because in 000098 I wrote that in LaTeX, linebreaks
are allowed in spaces in math mode, which is not the case.

> If it is the case, could you write some examples which shows the
> improvements of your patch ?

Yes, sure.

> And test that your patch is not breaking anything ?

Yes, I'll do that. \mbox-handling does not have high priority for us so
it may take some time.

Many Thanks,
--
Felix Natter
_______________________________________________
jlatexmath mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/jlatexmath
Sylvestre Ledru-4 Sylvestre Ledru-4
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Jlatexmath] Option for max. width vs exact width

>
> One thing that we should still do is modify the createTeXIcon(...)
> factories to use the TeXIconBuilder in order to avoid redundancy.
> Shall I provide a patch for this?
Please do it :)

> I am not sure whether setIsMaxWidth(true) breaks anything for align !=
> TeXConstants.ALIGN_LEFT. Could you check this (we're not using this
> currently)? If it does, we can just throw an IllegalStateException if
> setIsMaxWidth(true) and align != TeXConstants.ALIGN_LEFT are used in
> combination.
I don't know. I leave the answer to Calixte.

>> If Calixte agrees, we can make a release today.
>
> Perfect, but please see my comment above.
Sure

> Yes, sure.
>
>> And test that your patch is not breaking anything ?
>
> Yes, I'll do that. \mbox-handling does not have high priority for us so
> it may take some time.
OK. I will apply your patch as soon as you send the examples. Deal ? :)

Sylvestre
_______________________________________________
jlatexmath mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/jlatexmath
Felix Natter Felix Natter
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Jlatexmath] Option for max. width vs exact width

Sylvestre Ledru <[hidden email]> writes:

hi Sylvestre,

>>
>> One thing that we should still do is modify the createTeXIcon(...)
>> factories to use the TeXIconBuilder in order to avoid redundancy.
>> Shall I provide a patch for this?
> Please do it :)

Patch is attached :-)

>> I am not sure whether setIsMaxWidth(true) breaks anything for align !=
>> TeXConstants.ALIGN_LEFT. Could you check this (we're not using this
>> currently)? If it does, we can just throw an IllegalStateException if
>> setIsMaxWidth(true) and align != TeXConstants.ALIGN_LEFT are used in
>> combination.
> I don't know. I leave the answer to Calixte.

I tried it, there is a strange result when using this:

    String latex = "\\text{hello world}";
                TeXFormula formula = new TeXFormula(latex);
                TeXIcon icon = formula.new TeXIconBuilder().setStyle(TeXConstants.STYLE_TEXT)
                                .setSize(16)
                                .setWidth(TeXConstants.UNIT_PIXEL, 256f, TeXConstants.ALIGN_CENTER)
                                .setIsMaxWidth(true).setInterLineSpacing(TeXConstants.UNIT_PIXEL, 20f)
                                .build();

=> the hello world is cut off, only "o world" is visible
=> with setIsMaxWidth(false) the text is correctly centered on 256px.

Similar problem exists for ALIGN_RIGHT. Does it make sense to use align
!= ALIGN_LEFT with setIsMaxWidth(true)?
=> do we just want to always set set ALIGN:=ALIGN_LEFT if
setIsMaxWidth==true?

A complete example is attached (ExampleSwing2.java).

BTW: is the style currently ignored? If I use "hello world" with
STYLE_TEXT, then "hello world" is rendered in math mode.

>>> If Calixte agrees, we can make a release today.
>>
>> Perfect, but please see my comment above.
> Sure
>
>> Yes, sure.
>>
>>> And test that your patch is not breaking anything ?
>>
>> Yes, I'll do that. \mbox-handling does not have high priority for us so
>> it may take some time.
> OK. I will apply your patch as soon as you send the examples. Deal ?
> :)
Yes, I will also do a round of testing :-)

Best Regards,
--
Felix Natter

diff --git a/src/org/scilab/forge/jlatexmath/TeXFormula.java b/src/org/scilab/forge/jlatexmath/TeXFormula.java
index 805496a..462ff49 100644
--- a/src/org/scilab/forge/jlatexmath/TeXFormula.java
+++ b/src/org/scilab/forge/jlatexmath/TeXFormula.java
@@ -783,38 +783,19 @@ public class TeXFormula {
      * @return the created TeXIcon
      */
     public TeXIcon createTeXIcon(int style, float size) {
-        TeXEnvironment te = new TeXEnvironment(style, new DefaultTeXFont(size));
-        Box box = createBox(te);
-        TeXIcon ti = new TeXIcon(box, size);
-        ti.isColored = te.isColored;
-        return ti;
+     return new TeXIconBuilder().setStyle(style).setSize(size).build();
     }
 
     public TeXIcon createTeXIcon(int style, float size, int type) {
-        TeXEnvironment te = new TeXEnvironment(style, createFont(size, type));
-        Box box = createBox(te);
-        TeXIcon ti = new TeXIcon(box, size);
-        ti.isColored = te.isColored;
-        return ti;
+     return new TeXIconBuilder().setStyle(style).setSize(size).setType(type).build();
     }
 
     public TeXIcon createTeXIcon(int style, float size, int type, Color fgcolor) {
-        TeXEnvironment te = new TeXEnvironment(style, createFont(size, type));
-        Box box = createBox(te);
-        TeXIcon ti = new TeXIcon(box, size);
-        if (fgcolor != null) {
-            ti.setForeground(fgcolor);
-        }
-        ti.isColored = te.isColored;
-        return ti;
+     return new TeXIconBuilder().setStyle(style).setSize(size).setType(type).setFGColor(fgcolor).build();
     }
 
     public TeXIcon createTeXIcon(int style, float size, boolean trueValues) {
-        TeXEnvironment te = new TeXEnvironment(style, new DefaultTeXFont(size));
-        Box box = createBox(te);
-        TeXIcon ti = new TeXIcon(box, size, trueValues);
-        ti.isColored = te.isColored;
-        return ti;
+     return new TeXIconBuilder().setStyle(style).setSize(size).setTrueValues(trueValues).build();
     }
 
     public TeXIcon createTeXIcon(int style, float size, int widthUnit, float textwidth, int align) {
@@ -822,13 +803,7 @@ public class TeXFormula {
     }
 
     public TeXIcon createTeXIcon(int style, float size, int type, int widthUnit, float textwidth, int align) {
-        TeXEnvironment te = new TeXEnvironment(style, createFont(size, type), widthUnit, textwidth);
-        Box box = createBox(te);
-        HorizontalBox hb = new HorizontalBox(box, te.getTextwidth(), align);
-
-        TeXIcon ti = new TeXIcon(hb, size, true);
-        ti.isColored = te.isColored;
-        return ti;
+     return new TeXIconBuilder().setStyle(style).setSize(size).setType(type).setWidth(widthUnit, textwidth, align).build();
     }
 
     public TeXIcon createTeXIcon(int style, float size, int widthUnit, float textwidth, int align, int interlineUnit, float interline) {
@@ -836,14 +811,8 @@ public class TeXFormula {
     }
 
     public TeXIcon createTeXIcon(int style, float size, int type, int widthUnit, float textwidth, int align, int interlineUnit, float interline) {
-        TeXEnvironment te = new TeXEnvironment(style, createFont(size, type), widthUnit, textwidth);
-        Box box = createBox(te);
-        float il = interline * SpaceAtom.getFactor(interlineUnit, te);
-        HorizontalBox hb = new HorizontalBox(BreakFormula.split(box, te.getTextwidth(), il), te.getTextwidth(), align);
-
-        TeXIcon ti = new TeXIcon(hb, size, true);
-        ti.isColored = te.isColored;
-        return ti;
+     return new TeXIconBuilder().setStyle(style).setSize(size).setType(type).setWidth(widthUnit, textwidth, align).setInterLineSpacing(interlineUnit, interline)
+     .build();
     }
 
     public void createImage(String format, int style, float size, String out, Color bg, Color fg, boolean transparency) {

import java.awt.Dimension;

import javax.swing.BorderFactory;
import javax.swing.JFrame;
import javax.swing.JLabel;
import org.scilab.forge.jlatexmath.TeXConstants;
import org.scilab.forge.jlatexmath.TeXFormula;
import org.scilab.forge.jlatexmath.TeXIcon;


public class ExampleSwing2 {
        public static void main(String[] args)
        {
        String latex = "\\text{hello world}";
                TeXFormula formula = new TeXFormula(latex);
                TeXIcon icon = formula.new TeXIconBuilder().setStyle(TeXConstants.STYLE_DISPLAY)
                                .setSize(16)
                                .setWidth(TeXConstants.UNIT_PIXEL, 256f, TeXConstants.ALIGN_CENTER)
                                .setIsMaxWidth(true).setInterLineSpacing(TeXConstants.UNIT_PIXEL, 20f)
                                .build();
               
                JFrame frame = new JFrame();
                final JLabel label = new JLabel(icon);
                label.setMaximumSize(new Dimension(100,300));
                label.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
                frame.getContentPane().add(label);

                frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                frame.pack();
                frame.setVisible(true);
        }

}

_______________________________________________
jlatexmath mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/jlatexmath
Felix Natter Felix Natter
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Jlatexmath] Option for max. width vs exact width

In reply to this post by Sylvestre Ledru-4
Sylvestre Ledru <[hidden email]> writes:

hi Sylvestre,

>>
>> One thing that we should still do is modify the createTeXIcon(...)
>> factories to use the TeXIconBuilder in order to avoid redundancy.
>> Shall I provide a patch for this?
> Please do it :)

Would you accept a patch that changes the examples to use the new
builder interface? (maybe not for 1.0.1, I could do it Thursday or on the
weekend).

BTW:
- Example3.java does yield this for me:
"Exception in thread "main" org.scilab.forge.jlatexmath.ParseException:
Problem with command array@@env at position 0:2278"

Best Regards,
--
Felix Natter
_______________________________________________
jlatexmath mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/jlatexmath
Sylvestre Ledru-4 Sylvestre Ledru-4
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Jlatexmath] Option for max. width vs exact width

On 18/12/2012 17:03, Felix Natter wrote:
> Sylvestre Ledru <[hidden email]> writes:
>
> hi Sylvestre,
>
>>>
>>> One thing that we should still do is modify the createTeXIcon(...)
>>> factories to use the TeXIconBuilder in order to avoid redundancy.
>>> Shall I provide a patch for this?
>> Please do it :)
Merged:
http://forge.scilab.org/index.php/p/jlatexmath/source/commit/fd1a11808c980c3aa1bbb827f86cf88e9ea3f250/
Thanks again.

> Would you accept a patch that changes the examples to use the new
> builder interface? (maybe not for 1.0.1, I could do it Thursday or on the
> weekend).
Well, I would clearly prefer to keep the backward compatibility.


> BTW:
> - Example3.java does yield this for me:
> "Exception in thread "main" org.scilab.forge.jlatexmath.ParseException:
> Problem with command array@@env at position 0:2278"
Hmm, you broke the current behavior ?

Sylvestre
_______________________________________________
jlatexmath mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/jlatexmath
Calixte DENIZET Calixte DENIZET
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Jlatexmath] Option for max. width vs exact width

On 18/12/2012 17:14, Sylvestre Ledru wrote:

> On 18/12/2012 17:03, Felix Natter wrote:
>> Sylvestre Ledru<[hidden email]>  writes:
>>
>> hi Sylvestre,
>>
>>>> One thing that we should still do is modify the createTeXIcon(...)
>>>> factories to use the TeXIconBuilder in order to avoid redundancy.
>>>> Shall I provide a patch for this?
>>> Please do it :)
> Merged:
> http://forge.scilab.org/index.php/p/jlatexmath/source/commit/fd1a11808c980c3aa1bbb827f86cf88e9ea3f250/
> Thanks again.
>
>> Would you accept a patch that changes the examples to use the new
>> builder interface? (maybe not for 1.0.1, I could do it Thursday or on the
>> weekend).
> Well, I would clearly prefer to keep the backward compatibility.
>
>
>> BTW:
>> - Example3.java does yield this for me:
>> "Exception in thread "main" org.scilab.forge.jlatexmath.ParseException:
>> Problem with command array@@env at position 0:2278"
> Hmm, you broke the current behavior ?

No, it is a bug of mine... (I don't understand why I didn't see it
before...)

C

>
> Sylvestre
> _______________________________________________
> jlatexmath mailing list
> [hidden email]
> http://lists.scilab.org/mailman/listinfo/jlatexmath


--
Calixte Denizet
Software Development Engineer
-----------------------------------------------------------
Scilab Enterprises
143bis rue Yves Le Coz - 78000 Versailles, France
http://www.scilab-enterprises.com

_______________________________________________
jlatexmath mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/jlatexmath
Felix Natter Felix Natter
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Jlatexmath] Option for max. width vs exact width

In reply to this post by Sylvestre Ledru-4
Sylvestre Ledru <[hidden email]> writes:

> On 18/12/2012 17:03, Felix Natter wrote:
>> Sylvestre Ledru <[hidden email]> writes:
>>
>> hi Sylvestre,
>>
>>>>
>>>> One thing that we should still do is modify the createTeXIcon(...)
>>>> factories to use the TeXIconBuilder in order to avoid redundancy.
>>>> Shall I provide a patch for this?
>>> Please do it :)
> Merged:
> http://forge.scilab.org/index.php/p/jlatexmath/source/commit/fd1a11808c980c3aa1bbb827f86cf88e9ea3f250/
> Thanks again.
>
>> Would you accept a patch that changes the examples to use the new
>> builder interface? (maybe not for 1.0.1, I could do it Thursday or on the
>> weekend).
> Well, I would clearly prefer to keep the backward compatibility.

We definitely want to keep the old API for backwards compatibility. The
question is: do we want to make the builder the _default_ API?

>> BTW:
>> - Example3.java does yield this for me:
>> "Exception in thread "main" org.scilab.forge.jlatexmath.ParseException:
>> Problem with command array@@env at position 0:2278"
> Hmm, you broke the current behavior ?

I don't think so. I went back to the 1.0.0 tag and get the same error.

Best Regards,
--
Felix Natter
_______________________________________________
jlatexmath mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/jlatexmath
Calixte DENIZET Calixte DENIZET
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Jlatexmath] Option for max. width vs exact width

On 18/12/2012 17:44, Felix Natter wrote:

> Sylvestre Ledru<[hidden email]>  writes:
>
>> On 18/12/2012 17:03, Felix Natter wrote:
>>> Sylvestre Ledru<[hidden email]>  writes:
>>>
>>> hi Sylvestre,
>>>
>>>>> One thing that we should still do is modify the createTeXIcon(...)
>>>>> factories to use the TeXIconBuilder in order to avoid redundancy.
>>>>> Shall I provide a patch for this?
>>>> Please do it :)
>> Merged:
>> http://forge.scilab.org/index.php/p/jlatexmath/source/commit/fd1a11808c980c3aa1bbb827f86cf88e9ea3f250/
>> Thanks again.
>>
>>> Would you accept a patch that changes the examples to use the new
>>> builder interface? (maybe not for 1.0.1, I could do it Thursday or on the
>>> weekend).
>> Well, I would clearly prefer to keep the backward compatibility.
> We definitely want to keep the old API for backwards compatibility. The
> question is: do we want to make the builder the _default_ API?

Yes you can comment the old line (with a comment to precise that is the
old way) and add the new one (with a comment too) in the examples...
Always sorry for the lag, I have difficulties to make 15000 things at
the same time....

C


>
>>> BTW:
>>> - Example3.java does yield this for me:
>>> "Exception in thread "main" org.scilab.forge.jlatexmath.ParseException:
>>> Problem with command array@@env at position 0:2278"
>> Hmm, you broke the current behavior ?
> I don't think so. I went back to the 1.0.0 tag and get the same error.
>
> Best Regards,


--
Calixte Denizet
Software Development Engineer
-----------------------------------------------------------
Scilab Enterprises
143bis rue Yves Le Coz - 78000 Versailles, France
http://www.scilab-enterprises.com

_______________________________________________
jlatexmath mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/jlatexmath
Loading...