Latex output bugs?

Messages in english

Modérateur : xcasadmin

XcasEngGuy
Messages : 76
Inscription : mer. janv. 13, 2010 3:20 pm

Latex output bugs?

Message par XcasEngGuy » sam. oct. 10, 2020 5:31 pm

I have been using the latex output for elegant printouts of work and when I started to use units in the calculations I think I noticed a few bugs.

Please find attached a diff printout of the tex file produced by Xcas with the modifications I needed to do to prevent errrors when creating a PDF. When I ran: latex <my original tex file> in cygwin I got the following errors:

! Missing { inserted.
<to be read again>
\left
l.96 \mathrm{Rl}=(_\left
(1,\mathrm{\_ft}\right)) \\
?
! Missing } inserted.
<inserted text>
}
l.96 ...hrm{Rl}=(_\left(1,\mathrm{\_ft}\right)) \\

?

Underfull \hbox (badness 10000) in paragraph at lines 99--101

[2]
! Missing { inserted.
<to be read again>
\left
l.102 \mathrm{Dl}=(_\left
(0.785398163397,\mathrm{\_ft}\right))
?
! You can't use `\eqno' in math mode.
\endequation ->\eqno
\hbox {\@eqnnum }$$\@ignoretrue
l.103 \end{equation}

?
! Missing } inserted.
<inserted text>
}
l.103 \end{equation}

?

Underfull \hbox (badness 10000) in paragraph at lines 103--105

! Missing { inserted.
<to be read again>
\left
l.106 \mathrm{Al}=(_\left
(512.065886703,\frac{\mathrm{\_ft}^{2}\cdot \mathrm...

?
! You can't use `\eqno' in math mode.
\endequation ->\eqno
\hbox {\@eqnnum }$$\@ignoretrue
l.107 \end{equation}

?
! Missing } inserted.
<inserted text>
}
l.107 \end{equation}

?

Underfull \hbox (badness 10000) in paragraph at lines 107--109

! Missing { inserted.
<to be read again>
\left
l.110 \mathrm{Al}=(_\left
(512.065886703,\frac{\mathrm{\_ft}}{\mathrm{\_s}^{2...

?
! You can't use `\eqno' in math mode.
\endequation ->\eqno
\hbox {\@eqnnum }$$\@ignoretrue
l.111 \end{equation}

?
! Missing } inserted.
<inserted text>
}
l.111 \end{equation}

?

Underfull \hbox (badness 10000) in paragraph at lines 111--113


Underfull \hbox (badness 10000) in paragraph at lines 111--113


Underfull \hbox (badness 10000) in paragraph at lines 115--117

! Missing { inserted.
<to be read again>
\left
l.118 \mathrm{Fl}=(_\left
(512.065886703,\frac{\mathrm{\_ft}\cdot \mathrm{\_l...

?
! You can't use `\eqno' in math mode.
\endequation ->\eqno
\hbox {\@eqnnum }$$\@ignoretrue
l.119 \end{equation}

?
! Missing } inserted.
<inserted text>
}
l.119 \end{equation}

?

Underfull \hbox (badness 10000) in paragraph at lines 119--121

! Missing { inserted.
<to be read again>
\left
l.122 \mathrm{Fl}=(_\left
(15.9119171679,\mathrm{\_lbf}\right))
?
! You can't use `\eqno' in math mode.
\endequation ->\eqno
\hbox {\@eqnnum }$$\@ignoretrue
l.123 \end{equation}

?
! Missing } inserted.
<inserted text>
}
l.123 \end{equation}

?

I also attached the PDF produced by the "repaired" tex file.
The following is a bash script that I use as a work around right now to "fix" the tex file.

sed '
s/_\\left/\\left/g
s/,\\/\\/g
/(\\/{/))$/{s/(\\/\\/; s/))$/)/}}
/(\\/{/))[ \]*$/{s/(\\/\\/; s/))\([ \]*\)$/)\1/}}
' $1
Pièces jointes
attachments.zip
PDFs inside
(71.83 Kio) Téléchargé 19 fois

parisse
Messages : 5340
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: Latex output bugs?

Message par parisse » lun. oct. 12, 2020 6:25 am

Can you send the xws file? It will make easy to reproduce the bug.

XcasEngGuy
Messages : 76
Inscription : mer. janv. 13, 2010 3:20 pm

Re: Latex output bugs?

Message par XcasEngGuy » lun. oct. 12, 2020 8:06 pm

No problem.

Thanks
Pièces jointes
tex_latex_files.zip
I think this is everything
(11.58 Kio) Téléchargé 18 fois

parisse
Messages : 5340
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: Latex output bugs?

Message par parisse » mer. oct. 14, 2020 10:43 am

It's not that straightforward to fix, because under linux, the translation is handled by markup.cc, not by my code anymore.
I have fixed units printing in my code: now latex(_g_) will return "1\_\mathrm{\_g\_}". I hope this will be sufficient...

XcasEngGuy
Messages : 76
Inscription : mer. janv. 13, 2010 3:20 pm

Re: Latex output bugs?

Message par XcasEngGuy » mer. oct. 14, 2020 9:32 pm

Thanks. I think the most troublesome error is caused by the underscore after the = sign, before \left (see attached image)

Matt
Pièces jointes
fix01.jpg
fix01.jpg (5.24 Kio) Consulté 813 fois
error_clip.jpg
error_clip.jpg (44.67 Kio) Consulté 813 fois

parisse
Messages : 5340
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: Latex output bugs?

Message par parisse » dim. oct. 18, 2020 5:35 pm

Yes, that should be fixed. And \_ will be infixed.

XcasEngGuy
Messages : 76
Inscription : mer. janv. 13, 2010 3:20 pm

Re: Latex output bugs?

Message par XcasEngGuy » dim. oct. 18, 2020 8:57 pm

I just updated to 1.6.0. Works great.

Thank you very much,
Matt

lukamar
Messages : 299
Inscription : ven. juin 30, 2017 9:55 am
Localisation : Zagreb, Croatia

Re: Latex output bugs?

Message par lukamar » ven. oct. 23, 2020 4:12 pm

Hello,

thank you Matt for reporting bugs, I made several fixes in markup.cc regarding typesetting of physical constants. I also improved deciding on whether multiplication should be explicit or not (now it is explicit also when multi-character symbols are involved).

I compiled the stable version 1.6.0 with the above fixes and everything works as expected. In particular, test.xws is typeset properly. I attached the output files below.

Note that latex export supports identifiers with subscripts: if you name a variable as e.g. "name_sub", everthing after underscore (_) will be typeset as subscript in latex output.
Pièces jointes
test.zip
(114.44 Kio) Téléchargé 20 fois

XcasEngGuy
Messages : 76
Inscription : mer. janv. 13, 2010 3:20 pm

Re: Latex output bugs?

Message par XcasEngGuy » ven. oct. 23, 2020 9:41 pm

This appears to be exactly what I'm looking for. Is there a way for me to get a copy of this update?

Matt

lukamar
Messages : 299
Inscription : ven. juin 30, 2017 9:55 am
Localisation : Zagreb, Croatia

Re: Latex output bugs?

Message par lukamar » sam. oct. 24, 2020 1:26 am

It would be possible as soon as Bernard synchronizes the source. I'm maintaining markup.cc in a separate repository. You can get the new version from here: https://github.com/marohnicluka/giac and compile it yourself (replace the file in the latest stable source tarball).

parisse
Messages : 5340
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: Latex output bugs?

Message par parisse » dim. oct. 25, 2020 7:59 am

The unstable bzip2 source file is synchronized.
https://www-fourier.univ-grenoble-alpes ... .0.tar.bz2

XcasEngGuy
Messages : 76
Inscription : mer. janv. 13, 2010 3:20 pm

Re: Latex output bugs?

Message par XcasEngGuy » lun. oct. 26, 2020 8:38 pm

I noticed the xcas64inst.exe was updated 24-Oct-2020. Does it include your code?

lukamar
Messages : 299
Inscription : ven. juin 30, 2017 9:55 am
Localisation : Zagreb, Croatia

Re: Latex output bugs?

Message par lukamar » mar. oct. 27, 2020 10:25 am

XcasEngGuy a écrit :
lun. oct. 26, 2020 8:38 pm
I noticed the xcas64inst.exe was updated 24-Oct-2020. Does it include your code?
As it appears, it is compiled with the old version...

XcasEngGuy
Messages : 76
Inscription : mer. janv. 13, 2010 3:20 pm

Re: Latex output bugs?

Message par XcasEngGuy » ven. oct. 30, 2020 5:03 pm

I am trying to compile the unstable bzip2 source file under cygwin. I am getting missing include file errors. I downloaded the source tarballs for GMP, GNU readline, FLTK, MPFR, gsl, NTL (there is a windows version also, don't know which one to use), CoCoA, and PARI. Unfortunately, I don't know how to load them into cygwin so gcc can find everything.

I know you must be busy, but could you point me to a little more detail in how to successfully compile Xcas?

Matt

parisse
Messages : 5340
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: Latex output bugs?

Message par parisse » sam. oct. 31, 2020 8:25 am

Most packages are already available in cygwin, so you don't need to compile them. Make sure you have installed the dev version (with headers). After that

Code : Tout sélectionner

make -f Makefile.win64 
should do the job. Maybe you will have to edit Makefile.win64 and remove a library that you did not compile. The only mandatory library is GMP.

BTW, I have compiled a new version for windows.

Répondre