[Bug 330] fix: LyX generates .eps files in user directories
please test with this patch all graphic-files in the doc-dir are untouched, except the user has use_tempdir=false. there is still only one strange situation. for example - no tempdir and file my.gif with an existing my.eps - there is no other way than to overwrite this existing eps file while converting from gif to eps without using a tempdir. The only way is to warn the user, but than we have tons of warnings when using a lot of graphic files. on the other hand the user can work with no tempdir and LyX creates all eps-files and let them undeleted in the doc-dir Herbert -- http://www.lyx.org/help/ Index: src/insets/ChangeLog === RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/ChangeLog,v retrieving revision 1.400 diff -u -r1.400 ChangeLog --- src/insets/ChangeLog19 Apr 2002 17:16:00 - 1.400 +++ src/insets/ChangeLog20 Apr 2002 06:16:50 - @@ -1,3 +1,8 @@ +2002-04-20 Herbert Voss [EMAIL PROTECTED] + + * insetgraphic.C (prepareFile): fix bug with overwriting and + deleting an existing *.eps-file in the doc-dir + 2002-04-19 Herbert Voss [EMAIL PROTECTED] * insetgraphic.C (prepareFile): return filename without Index: src/insets/insetgraphics.C === RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetgraphics.C,v retrieving revision 1.105 diff -u -r1.105 insetgraphics.C --- src/insets/insetgraphics.C 19 Apr 2002 17:16:00 - 1.105 +++ src/insets/insetgraphics.C 20 Apr 2002 06:16:51 - @@ -94,6 +94,7 @@ #include LaTeXFeatures.h #include frontends/Dialogs.h +#include frontends/Alert.h #include frontends/controllers/helper_funcs.h // getVectorFromString #include support/LAssert.h @@ -632,6 +633,8 @@ string const from = getExtFromContents(filename_); string const to = findTargetFormat(from); + lyxerr[Debug::GRAPHICS] \tfrom: from endl; + lyxerr[Debug::GRAPHICS] \tto : to endl; if (from == to) { // No conversion needed! @@ -640,14 +643,28 @@ string const temp = MakeAbsPath(filename_, buf-tmppath); string const outfile_base = RemoveExtension(temp); + // first we copy the original file from the docdir into + // the temp dir but only when use-tmpdir is enabled + if (!IsFileReadable(temp) lyxrc.use_tempdir) { + bool success = lyx::copy(filename_, temp); + lyxerr[Debug::GRAPHICS] [prepareFile] copy from +filename_ to temp \n; + if (!success) { + Alert::alert(_(cannot copy file), filename_, + _(into tempdir)); + return filename_; + } + } - lyxerr[Debug::GRAPHICS] tempname = temp \n; - lyxerr[Debug::GRAPHICS] buf::tmppath = buf-tmppath \n; - lyxerr[Debug::GRAPHICS] filename_ = filename_ \n; - lyxerr[Debug::GRAPHICS] outfile_base = outfile_base endl; - - converters.convert(buf, filename_, outfile_base, from, to); - return RemoveExtension(filename_); + lyxerr[Debug::GRAPHICS] calling convert with these values: endl; + lyxerr[Debug::GRAPHICS] \ttempname = temp endl; + lyxerr[Debug::GRAPHICS] \tbuf-tmppath = buf-tmppath endl; + lyxerr[Debug::GRAPHICS] \toutfile_base = outfile_base endl; + lyxerr[Debug::GRAPHICS] \t(filename_= filename_ )\n; + + converters.convert(buf, temp, outfile_base, from, to); + // from now we only work with the tempfile + return RemoveExtension(temp); }
Re: LaTeX export: invalid command in math mode.
Herbert Voss wrote: R. Lahaye wrote: Hi, I have a REVTeX4 document, which I export to LaTeX. When processing the export file with the latex command, I get a number of warnings of the kind: --- LaTeX Warning: Command \textordmasculine invalid in math mode on input line 72. --- This is related to the degree-symbol I use in my LyX document, for example 45º. In the LaTeX export, this appears as 45\ensuremath{º} and latex chokes on that. Any idea what goes wrong in the export? examplefile, because I have no problems with this in text- and in mathmode. OK. Sample lyx-file attached. It only contains 45º. Open this file in LyX, then export it with File-Export-LaTeX. Open an xterminal and process the LaTeX-exported-file with the latex command: --- $ latex degree_warning.tex This is TeX, Version 3.14159 (Web2C 7.3.1) (degree_warning.tex LaTeX2e 1999/12/01 patch level 1 Babel v3.6Z and hyphenation patterns for american, french, german, ngerman, nohyphenation, loaded. (/usr/local/share/texmf/tex/latex/base/article.cls Document Class: article 1999/09/10 v1.4a Standard LaTeX document class (/usr/local/share/texmf/tex/latex/base/size10.clo)) (/usr/local/share/texmf/tex/latex/base/fontenc.sty (/usr/local/share/texmf/tex/latex/base/t1enc.def)) (/usr/local/share/texmf/tex/latex/base/inputenc.sty (/usr/local/share/texmf/tex/latex/base/latin1.def)) (/usr/local/share/texmf/tex/generic/babel/babel.sty (/usr/local/share/texmf/tex/generic/babel/english.ldf (/usr/local/share/texmf/tex/generic/babel/babel.def))) No file degree_warning.aux. LaTeX Warning: Command \textordmasculine invalid in math mode on input line 15. [1] (degree_warning.aux) ) Output written on degree_warning.dvi (1 page, 280 bytes). Transcript written on degree_warning.log. $ --- Line 15 in degree_warning.tex contains: 45\ensuremath{\xba} What's makes my latex produce a warning message here? Regards, Rob. #LyX 1.2 created this file. For more info see http://www.lyx.org/ \lyxformat 220 \textclass article \language english \inputencoding auto \fontscheme default \graphics default \paperfontsize default \papersize Default \paperpackage a4 \use_geometry 0 \use_amsmath 0 \use_natbib 0 \use_numerical_citations 0 \paperorientation portrait \secnumdepth 3 \tocdepth 3 \paragraph_separation indent \defskip medskip \quotes_language english \quotes_times 2 \papercolumns 1 \papersides 1 \paperpagestyle default \layout Standard 45º \the_end
Re: LaTeX export: invalid command in math mode.
R. Lahaye wrote: OK. Sample lyx-file attached. It only contains 45º. Open this file in LyX, then export it with File-Export-LaTeX. Open an xterminal and process the LaTeX-exported-file with the latex command: understood. don't know, why this is exported as an ensuremath-command. Herbert -- http://www.lyx.org/help/
Re: [PATCH] Re: Graphics: Viewing XPM and stray-EPS files ?!?!
R. Lahaye wrote: [Adding xpm to eps] Hi, I have modified lib/configure.m4 so that it also includes the conversion from XPM to EPS by default, at least for ImageMagick's convert: convert XPM:$$i EPS:$$o Do we also need a netpbm equivalent? Angus? This conversion is required, when loading XPM files and viewing/printing them to Postscript. Patch attached. In addition, I have patched lib/configure.m4 further by adding more conversion-schemes for Grace. From Grace (agr) to EPS, PDF, PNG and JPEG (only if Grace itself and each of these output formats are available). Would that be of help? If so, then do not apply previous patch, but only this one. This one has all diffs with unpatched CVS. Regards, Rob. configure_m4.diff.gz Description: GNU Zip compressed data
Re: LyX Bugzilla problem
First to the lyx-devel list: the STL excessively long symbol names barfing Solaris 2.6 ld problem can be worked around by compiling gcc to use gnu binutils. Took me hours, but now I can confirm success using Solaris-2.6 gcc-3.0.4 binutils-2.12 lyx-1.1.6fix4 I think working around the ld problem would still be worth while as in the current state of affairs I really can't recommend using Lyx to my colleagues. Michael Koziarski writes: The problem appears to be plain and clear a select tag without any option tags. THe textual content of the option tags is visible but presumably someone has stripped, or forgot to add in the first place, the actual tags. There was a bug in the code, it was generating two 'select name=op_sys' tags. Could you try it again please and let me know It may well have to do with assumptions about cookies, but if cookies have to be enabled, I'd rather use email directly, which I believe is a better medium for bug reporting anyway. Does [EMAIL PROTECTED] work? [EMAIL PROTECTED] might or might not work, I don't know. If you don't want to submit bugs via bugzilla, you can e-mail them directly to [EMAIL PROTECTED], though most bugs reported there end up in bugzilla anyway, unless they're trivial to fix. I prefere generally email submission because - I do not have to learn anything new (except bug reporting address) - the forms user interfaces are often awful. For example the Lyx bug reporting form does not offer 80 character wide textarea and my compiler output was wrapped so badly as to render it really difficult to read. - I can not Cc other interested parties, such as my colleagues on the bug report - I am experienced bug reporter so I think I can distill the relevant information without guidance Bugzilla only uses cookies for storing login information, I'm not sure if it works with them turned off, though I'd be surprised if it does. However, you submitted a bug logged in as yourself so . I guess it works ok. I think it works well without them as well. I used it for one project myself two years back. --Sampo __ SymLABSDirectoryScript www.symlabs.com e-nabling triggers and stored mobile=+351-918.731.007 your biz procedures for LDAP fax=+351-214.222.637
[Bug 330] fix: LyX generates .eps files in user directories
please test with this patch all graphic-files in the doc-dir are untouched, except the user has use_tempdir=false. there is still only one strange situation. for example - no tempdir and file my.gif with an existing my.eps - there is no other way than to overwrite this existing eps file while converting from gif to eps without using a tempdir. The only way is to warn the user, but than we have tons of warnings when using a lot of graphic files. on the other hand the user can work with no tempdir and LyX creates all eps-files and let them undeleted in the doc-dir Herbert -- http://www.lyx.org/help/ Index: src/insets/ChangeLog === RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/ChangeLog,v retrieving revision 1.400 diff -u -r1.400 ChangeLog --- src/insets/ChangeLog19 Apr 2002 17:16:00 - 1.400 +++ src/insets/ChangeLog20 Apr 2002 06:16:50 - @@ -1,3 +1,8 @@ +2002-04-20 Herbert Voss <[EMAIL PROTECTED]> + + * insetgraphic.C (prepareFile): fix bug with overwriting and + deleting an existing *.eps-file in the doc-dir + 2002-04-19 Herbert Voss <[EMAIL PROTECTED]> * insetgraphic.C (prepareFile): return filename without Index: src/insets/insetgraphics.C === RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetgraphics.C,v retrieving revision 1.105 diff -u -r1.105 insetgraphics.C --- src/insets/insetgraphics.C 19 Apr 2002 17:16:00 - 1.105 +++ src/insets/insetgraphics.C 20 Apr 2002 06:16:51 - @@ -94,6 +94,7 @@ #include "LaTeXFeatures.h" #include "frontends/Dialogs.h" +#include "frontends/Alert.h" #include "frontends/controllers/helper_funcs.h" // getVectorFromString #include "support/LAssert.h" @@ -632,6 +633,8 @@ string const from = getExtFromContents(filename_); string const to = findTargetFormat(from); + lyxerr[Debug::GRAPHICS] << "\tfrom:" << from << endl; + lyxerr[Debug::GRAPHICS] << "\tto :" << to << endl; if (from == to) { // No conversion needed! @@ -640,14 +643,28 @@ string const temp = MakeAbsPath(filename_, buf->tmppath); string const outfile_base = RemoveExtension(temp); + // first we copy the original file from the docdir into + // the temp dir but only when use-tmpdir is enabled + if (!IsFileReadable(temp) && lyxrc.use_tempdir) { + bool success = lyx::copy(filename_, temp); + lyxerr[Debug::GRAPHICS] << "[prepareFile] copy from " + << filename_ << " to " << temp << "\n"; + if (!success) { + Alert::alert(_("cannot copy file"), filename_, + _("into tempdir")); + return filename_; + } + } - lyxerr[Debug::GRAPHICS] << "tempname = " << temp << "\n"; - lyxerr[Debug::GRAPHICS] << "buf::tmppath = " << buf->tmppath << "\n"; - lyxerr[Debug::GRAPHICS] << "filename_ = " << filename_ << "\n"; - lyxerr[Debug::GRAPHICS] << "outfile_base = " << outfile_base << endl; - - converters.convert(buf, filename_, outfile_base, from, to); - return RemoveExtension(filename_); + lyxerr[Debug::GRAPHICS] << "calling convert with these values:" << endl; + lyxerr[Debug::GRAPHICS] << "\ttempname = " << temp << endl; + lyxerr[Debug::GRAPHICS] << "\tbuf->tmppath = " << buf->tmppath << endl; + lyxerr[Debug::GRAPHICS] << "\toutfile_base = " << outfile_base << endl; + lyxerr[Debug::GRAPHICS] << "\t(filename_= " << filename_ << ")\n"; + + converters.convert(buf, temp, outfile_base, from, to); + // from now we only work with the tempfile + return RemoveExtension(temp); }
Re: LaTeX export: invalid command in math mode.
Herbert Voss wrote: > > R. Lahaye wrote: > > > Hi, > > > > I have a REVTeX4 document, which I export to LaTeX. When processing > > the export file with the latex command, I get a number of warnings > > of the kind: > > > > --- > > LaTeX Warning: Command \textordmasculine invalid in math mode on > > input line 72. > > --- > > > > This is related to the degree-symbol I use in my LyX document, for > > example "45º". In the LaTeX export, this appears as "45\ensuremath{º}" > > and latex chokes on that. > > > > Any idea what goes wrong in the export? > > examplefile, because I have no problems with this in text- > and in mathmode. OK. Sample lyx-file attached. It only contains "45º". Open this file in LyX, then export it with File->Export->LaTeX. Open an xterminal and process the LaTeX-exported-file with the latex command: --- $ latex degree_warning.tex This is TeX, Version 3.14159 (Web2C 7.3.1) (degree_warning.tex LaTeX2e <1999/12/01> patch level 1 Babel and hyphenation patterns for american, french, german, ngerman, nohyphenation, loaded. (/usr/local/share/texmf/tex/latex/base/article.cls Document Class: article 1999/09/10 v1.4a Standard LaTeX document class (/usr/local/share/texmf/tex/latex/base/size10.clo)) (/usr/local/share/texmf/tex/latex/base/fontenc.sty (/usr/local/share/texmf/tex/latex/base/t1enc.def)) (/usr/local/share/texmf/tex/latex/base/inputenc.sty (/usr/local/share/texmf/tex/latex/base/latin1.def)) (/usr/local/share/texmf/tex/generic/babel/babel.sty (/usr/local/share/texmf/tex/generic/babel/english.ldf (/usr/local/share/texmf/tex/generic/babel/babel.def))) No file degree_warning.aux. LaTeX Warning: Command \textordmasculine invalid in math mode on input line 15. [1] (degree_warning.aux) ) Output written on degree_warning.dvi (1 page, 280 bytes). Transcript written on degree_warning.log. $ --- Line 15 in degree_warning.tex contains: 45\ensuremath{\xba} What's makes my latex produce a warning message here? Regards, Rob. #LyX 1.2 created this file. For more info see http://www.lyx.org/ \lyxformat 220 \textclass article \language english \inputencoding auto \fontscheme default \graphics default \paperfontsize default \papersize Default \paperpackage a4 \use_geometry 0 \use_amsmath 0 \use_natbib 0 \use_numerical_citations 0 \paperorientation portrait \secnumdepth 3 \tocdepth 3 \paragraph_separation indent \defskip medskip \quotes_language english \quotes_times 2 \papercolumns 1 \papersides 1 \paperpagestyle default \layout Standard 45º \the_end
Re: LaTeX export: invalid command in math mode.
R. Lahaye wrote: > OK. Sample lyx-file attached. It only contains "45º". > > Open this file in LyX, then export it with File->Export->LaTeX. > > Open an xterminal and process the LaTeX-exported-file with > the latex command: understood. don't know, why this is exported as an ensuremath-command. Herbert -- http://www.lyx.org/help/
Re: [PATCH] Re: Graphics: Viewing XPM and stray-EPS files ?!?!
R. Lahaye wrote: > [Adding xpm to eps] > > Hi, > > I have modified lib/configure.m4 so that it also includes the conversion > from XPM to EPS by default, at least for ImageMagick's convert: > > convert XPM:$$i EPS:$$o > > Do we also need a netpbm equivalent? Angus? > > This conversion is required, when loading XPM files and viewing/printing > them to Postscript. > > Patch attached. In addition, I have patched lib/configure.m4 further by adding more conversion-schemes for Grace. From Grace (agr) to EPS, PDF, PNG and JPEG (only if Grace itself and each of these output formats are available). Would that be of help? If so, then do not apply previous patch, but only this one. This one has all diffs with unpatched CVS. Regards, Rob. configure_m4.diff.gz Description: GNU Zip compressed data
Re: LyX Bugzilla problem
First to the lyx-devel list: the STL excessively long symbol names barfing Solaris 2.6 ld problem can be worked around by compiling gcc to use gnu binutils. Took me hours, but now I can confirm success using Solaris-2.6 gcc-3.0.4 binutils-2.12 lyx-1.1.6fix4 I think working around the ld problem would still be worth while as in the current state of affairs I really can't recommend using Lyx to my colleagues. Michael Koziarski writes: >> The problem appears to be plain and clear a tag without any >> tags. THe textual content of the option tags is visible >> but presumably someone has stripped, or forgot to add in the first place, >> the actual tags. > > There was a bug in the code, it was generating two ' name=op_sys' tags. Could you try it again please and let me know > > >> It may well have to do with assumptions about cookies, >> but if cookies have to be enabled, I'd rather use email directly, which >> I believe is a better medium for bug reporting anyway. Does [EMAIL PROTECTED] >> work? > > [EMAIL PROTECTED] might or might not work, I don't know. If you don't want > to submit bugs via bugzilla, you can e-mail them directly to > [EMAIL PROTECTED], though most bugs reported there end up in > bugzilla anyway, unless they're trivial to fix. I prefere generally email submission because - I do not have to learn anything new (except bug reporting address) - the forms user interfaces are often awful. For example the Lyx bug reporting form does not offer 80 character wide textarea and my compiler output was wrapped so badly as to render it really difficult to read. - I can not Cc other interested parties, such as my colleagues on the bug report - I am experienced bug reporter so I think I can distill the relevant information without guidance > Bugzilla only uses cookies for storing login information, I'm not sure > if it works with them turned off, though I'd be surprised if it does. > However, you submitted a bug logged in as yourself so . I guess it > works ok. I think it works well without them as well. I used it for one project myself two years back. --Sampo __ SymLABSDirectoryScript www.symlabs.com e-nabling triggers and stored mobile=+351-918.731.007 your biz procedures for LDAP fax=+351-214.222.637