Help save net neutrality! Learn more.
Close

#532 wrong "latex export"

Bug
closed-fixed
SciTE (627)
3
2007-04-24
2007-02-13
Marek
No

I exported some python code to latex but the produced latex code does not compile. I discovered that the buggy lines are \newcommand definitions, for example:

SCITE PRODUCES:
\newcommand{\sciteh}[1]{\noindent{\ttfamily{\textcolor[rgb]{0,5, 0,0, 0,0}{\colorbox[rgb]{1,0, 1,0, 1,0}{#1}}}}}

BUT THERE SHOULD BE:
\newcommand{\sciteh}[1]{\noindent{\ttfamily{\textcolor[rgb]{0.5, 0.0, 0.0}{\colorbox[rgb]{1.0, 1.0, 1.0}{#1}}}}}

(Decimal separator should be a DOT and not COMMA)

p.s.
I'm working on Gentoo Linux.

Discussion

  • Marek

    Marek - 2007-02-13

    Logged In: YES
    user_id=1640648
    Originator: YES

    The most probably the error is produced in the following function in Exporters.cxx:

    static char* getTexRGB(char* texcolor, const char* stylecolor) {
    //texcolor[rgb]{0,0.5,0}{....}
    float r = IntFromHexByte(stylecolor + 1) / 256.0;
    float g = IntFromHexByte(stylecolor + 3) / 256.0;
    float b = IntFromHexByte(stylecolor + 5) / 256.0;
    sprintf(texcolor, "%.1f, %.1f, %.1f", r, g, b);
    return texcolor;
    }

    I don't know however what to change here to get proper output (with dots as decimal separators and not commas).

    Greetings

     
  • Neil Hodgson

    Neil Hodgson - 2007-02-13
    • priority: 5 --> 3
    • assigned_to: nobody --> nyamatongwe
     
  • Neil Hodgson

    Neil Hodgson - 2007-02-14
    • priority: 3 --> 2
    • status: open --> open-accepted
     
  • Neil Hodgson

    Neil Hodgson - 2007-02-14

    Logged In: YES
    user_id=12579
    Originator: NO

    This is most probably a locale issue: your machine is set up to use a European locale where digits are separated by spaces and ',' is used instead of '.'. So 1,234.56 appears as 1 234,56. You could try altering the locale information on your machine.

     
  • Marek

    Marek - 2007-02-14

    Logged In: YES
    user_id=1640648
    Originator: YES

    Unfortunately i don't know where to set up these locale settings. I'm using KDE environment and there is "." as decimal separator just set. I also checked a bash behavior and it seems to understand "." as decimal separator:

    Command:
    echo "scale=4; 7./3." | bc -l
    returns
    2.3333

    I have no ideas where to dig in looking for locale settings.

    Isn't it, the mentioned getTexRGB function should force "." usage independently on locale settings? Latex compilers are not locale dependent.

    Greetings

     
  • Neil Hodgson

    Neil Hodgson - 2007-02-18
    • priority: 2 --> 3
    • status: open-accepted --> open-fixed
     
  • Neil Hodgson

    Neil Hodgson - 2007-02-18

    Logged In: YES
    user_id=12579
    Originator: NO

    Kein-Hong Man has contributed a fix for this which has been committed to CVS.

     
  • Neil Hodgson

    Neil Hodgson - 2007-04-24
    • status: open-fixed --> closed-fixed
     

Log in to post a comment.