GNOME Bugzilla – Bug 325656
Save as latex2e minus is converted to ?
Last modified: 2006-01-23 17:09:50 UTC
Using Gnumeric on Ubuntu I observed the following bug when saving a .gnumeric document as a latex2e file. To reproduce the bug just open Gnumeric and type a NEGATIVE number in one of the fields e.g. -1 Than go to the File Save as Dialog and choose latex2e as the File Type and save. The generated document is fine with the exeption that the minus sign "-" is converted to a question mark "?". So the field does not show up as -1 but instead as ?1 This can be checked by opening the Book1.tex file with a text-editor - and is also visible if you compile the document by using latex Book1.tex and looking at the Book1.dvi file. Thanks a lot for providing great Gnumeric. The Save as latex2e is a GREAT feature and saves me a lot of time in my work. Best regards Christian
Confirmed. Actually, "?" is what you get in ISO-8859-1 mode. In UTF-8 mode you get the unicode minus.
...and the cause is that latex.c uses cell_get_rendered_text. Crazy wrong. Changing to HTML component which, perhaps surprisingly, covers latex.
Well, I cannot replicate this. The latex code shows: \usepackage[utf8]{inputenc} ... \gnumericPB{\raggedleft}\gnumbox[r]{â\210'1} which should typeset -1 and does for me. Do you have the required package inputenc.sty available? Morten, what do you mean with "in ISO-8859-1 mode". THe latex file uses utf8 encoding as specified. And why is cell_get_rendered_text inappropriate? We want to have exactly the output as rendered on screen in gnumeric.
Could somebody who thinks they can replicate this please attach their latex log file from a compile run of the created latex file. Thanks
Created attachment 56762 [details] The .gnumeric file A simple .gnumeric file with negative values.
Created attachment 56763 [details] the converted (Save as latex2e) Book1.tex The file like it is saved by the Save as Dialog if latex2e is choosen as a file type. When I open this file with gedit the minus shows up as question marks already in this file.
Created attachment 56764 [details] the .log file of a latex run Here is the .log file when I compile the document with latex (no further options used): latex Book1.tex
Created attachment 56765 [details] the resulting .dvi file This is the resulting .dvi file. As reported the minus sign shows up as a question mark.
Ah I see, I was not able to replicate the problem because my preference is set to "use utf8 in latex export" (in preferende dialog under "Files"). The problem occurs only with latin1. Christian, to work around this bug please change your preference setting.
well, glib's g_convert_with_fallback () does not know how to convert a utf8 minus sign to latin1.
Thanks a lot. Indeed setting the option "Use UTF-8 in LaTeX Export" in the preference dialogue generates a document which works well. However than we have to use UTF-8 to compile with latex and as a consequence I couldn't compile without installing the ucs package (latex-ucs for Debian users) which is not included in the standard installation of tetex. Is there a way to use the UTF-setting for the tables when including the tables via a \input{} command in a otherwise latin-encoded document? Sorry this is probably a question for a latex power user mailing list.
this should do the job for you: \inputencoding{utf8} \input{...} \inputencoding{latin1}
This might be slightly offtopic - but perhaps I am not the only one who has this problem: Howto include a table generated by gnumeric with utf8 ecoding into a otherwise latin encoded document? To make the task more difficult enable the use of German fonts and use fonts which look also good in .pdf files. In the header of the latex file type: \documentclass[11pt,english,figtopcap,latin1,utf8]{article} \usepackage{palatino} \usepackage[T1]{fontenc} \usepackage[latin1]{inputenc} %%\usepackage[utf8]{inputenc} At the place you want to put the table: \inputencoding{utf8} \input{yourtable.tex} \inputencoding{latin1} At least this worked for me.
I have committed a small temporary fix to this issue, by just marking all untranslated unicode characters by "-" rather than "?". Clearly we should translate all unicode minus signs to hyphens and keep the "?" for all otehr characters.
fixed in cvs