Re: eLyXer for Document Parsing
On 04/02/2012 19:07, slitt wrote: One more question: You sure you want to go in-memory? What happens if a guy has a 1200 page book with 100 chapters each containing 10 sections, each containing 10 subsections, and tries to parse it on a machine with 512 MB RAM? You in a heap of trouble son. I am almost sure LyX is able to do that. Abdel.
Re: eLyXer for Document Parsing
On 04/02/2012 18:03, Rob Oakes wrote: Dear eLyXer Users and Developers, I'm still at work on the import/export module for Microsoft Word documents. I'm making pretty good progress. I've got a rough prototype that works pretty well and I'm now starting to refine it. My approach up to now has been to use regular expressions to match portions of the document and then use a library to translate those to the corresponding Word XML structures. It's working pretty well with my simple test documents. Before going too far with this approach, though, I wanted to post (another general query). In the eLyXer library, there is already a robust set of tools used for converting LyX documents to HTML. Does anyone know if the library is written in such as way that getting a generic in-memory representation of the document would be possible? It would be awesome to re-use as much existing code for the Word document export as possible. That would allow me to support a broader number of features, and gives me a framework for working with maths. Strong suggestion: use LyX proper. I am quite sure you already know that because I saw some patches from you in this area but I'll explain anyway: LyX's html own export is so good and fast because it effectively knows the in-memory representation of the document. You can't be faster nor more accurate than that. I mean, unless you want to rewrite LyX in python. IIUC you want a single module in python for both import and export in python. But I don't think this is a valid argument. As for the word to lyx format conversion, if you want to use this epub library there must be a way to use that in C++ I'm sure... Any thoughts Alex (and others)? I've downloaded the sources and have begun to work through them, but before spending hours to days trying to wrap my head around them, I thought I would ask. AFAIK, eLyXer doesn't construct a document model. So you'd better spend this time reading the C++ code for exporting to html/xhtml ;-) Abdel.
Re: eLyXer for Document Parsing
Hi all, I am currently travelling so excuse my android top-posting. Actually building a reusable in-memory representation for Python scripting of LyX documents was a requisite for eLyXer. You should not have trouble with large documents as my puny netbook eats 1000 page documents for lunch. Look at the Container class, and best of luck! Please ask in private any further questions. Alex. El 04/02/2012 18:03, Rob Oakes lyx-de...@oak-tree.us escribió: Dear eLyXer Users and Developers, I'm still at work on the import/export module for Microsoft Word documents. I'm making pretty good progress. I've got a rough prototype that works pretty well and I'm now starting to refine it. My approach up to now has been to use regular expressions to match portions of the document and then use a library to translate those to the corresponding Word XML structures. It's working pretty well with my simple test documents. Before going too far with this approach, though, I wanted to post (another general query). In the eLyXer library, there is already a robust set of tools used for converting LyX documents to HTML. Does anyone know if the library is written in such as way that getting a generic in-memory representation of the document would be possible? It would be awesome to re-use as much existing code for the Word document export as possible. That would allow me to support a broader number of features, and gives me a framework for working with maths. Any thoughts Alex (and others)? I've downloaded the sources and have begun to work through them, but before spending hours to days trying to wrap my head around them, I thought I would ask. Cheers, Rob
Re: eLyXer for Document Parsing
On Feb 5, 2012, at 2:04 AM, Abdelrazak Younes wrote: Strong suggestion: use LyX proper. I am quite sure you already know that because I saw some patches from you in this area but I'll explain anyway: LyX's html own export is so good and fast because it effectively knows the in-memory representation of the document. You can't be faster nor more accurate than that. I mean, unless you want to rewrite LyX in python. Extremely good point, I'm also more comfortable with the HTML export available in LyX. I initially was interested in eLyXer because I thought I might be able to use it to help with an import filter as well. I'm not sure that it can, though. As you note in your email, it doesn't create a document model. IIUC you want a single module in python for both import and export in python. But I don't think this is a valid argument. As for the word to lyx format conversion, if you want to use this epub library there must be a way to use that in C++ I'm sure… I though about using Python because I'd found a tool capable of generating docx for me. After working with it a little more, though, I'm less enamored with it. docx is a pretty straightforward file format, and there's quite a few things that are sloppily implemented. AFAIK, eLyXer doesn't construct a document model. So you'd better spend this time reading the C++ code for exporting to html/xhtml ;-) Following Steve's suggestion, I decided to try the easy way and directly parse the XHTML created by eLyXer. Turns out that it's not only easy, but probably the best way forward. There are some excellent libraries for reading XML in python. Using lxml, in particular, looks like a good solution. You generate the XHTML, parse it with lxml, and then iterate over the elements, translating as you go. My current script is about 50 lines long, and can be used with either native XHTML or eLyXer. To add new features, you add additional cases describing how to translate the XHTML. Which brings us to an important point: there's already a pretty good LyX - XHTML - LibreOffice - Word pathway for translating documents. Unless I directly implement Word as another backend (which, while a lot of work, isn't difficult), I'm not sure there's much reason for a direct MS Word export. The real need seems to be for an MS Word import, anyway. Cheers, Rob
Re: eLyXer for Document Parsing
On 05/02/2012 17:48, Rob Oakes wrote: My current script is about 50 lines long, and can be used with either native XHTML or eLyXer. To add new features, you add additional cases describing how to translate the XHTML. Which brings us to an important point: there's already a pretty good LyX - XHTML - LibreOffice - Word pathway for translating documents. Unless I directly implement Word as another backend (which, while a lot of work, isn't difficult), I'm not sure there's much reason for a direct MS Word export. The real need seems to be for an MS Word import, anyway. The native MSWord backend would be very interesting to have and useful and much better than anything you could produce with your python script. But I agree with you that the docx import looks more useful. And if the thing can be extended to pptx, it will be even more useful :-) Cheers, Abdel.
Re: Arrays or similar in \xymatrix{
I'm not entirely sure I know what you want. Does the following file do it? Paul #LyX 2.0 created this file. For more info see http://www.lyx.org/ \lyxformat 413 \begin_document \begin_header \textclass article \use_default_options true \maintain_unincluded_children false \language english \language_package default \inputencoding auto \fontencoding global \font_roman default \font_sans default \font_typewriter default \font_default_family default \use_non_tex_fonts false \font_sc false \font_osf false \font_sf_scale 100 \font_tt_scale 100 \graphics default \default_output_format default \output_sync 0 \bibtex_command default \index_command default \paperfontsize default \spacing single \use_hyperref false \papersize letterpaper \use_geometry true \use_amsmath 2 \use_esint 1 \use_mhchem 1 \use_mathdots 1 \cite_engine basic \use_bibtopic false \use_indices false \paperorientation portrait \suppress_date false \use_refstyle 1 \index Index \shortcut idx \color #008000 \end_index \leftmargin 1in \topmargin 1in \rightmargin 1in \bottommargin 1in \secnumdepth 3 \tocdepth 3 \paragraph_separation skip \defskip smallskip \quotes_language english \papercolumns 1 \papersides 1 \paperpagestyle default \tracking_changes false \output_changes false \html_math_output 0 \html_css_as_file 0 \html_be_strict false \end_header \begin_body \begin_layout Standard \begin_inset Formula $\xymatrix{S_{0}u^{2}\\ S_{0}u\ar[urr]\ar[drr]\\ S_{0}\ar[urr]\ar[drr]\genfrac{}{}{0pt}{0}{S_{0}u}{f_{u}}\\ S_{0}d\ar[urr]\ar[drr]\\ S_{0}d^{2} } $ \end_inset \end_layout \end_body \end_document
automatique reference of sub figure
Hello, I use the following preambule \AtBeginDocument{\renewcommand{\ref}[1]{\mbox{\autoref{#1 to add the word Figure when referencing figure. However, the word figure is not added when referencing sub-figure. For example it write 3a instead of Figure 3a. Please, what to add in order to get the word Figure before number of fig Thanks in advance,
Re: errors typesetting UserGuide.lyx
So I found a problem with the 'convert' utility (part of ImageMagick 6.6.9) that MacTex 2011 installs. The installation fails to install the necessary xml files that 'convert' needs to function correctly at the command line. Over at the macosx-tex mailing list, Dick Koch provided a link to the necessary xml files with this comment: We supply convert mainly for tex4html, thinking that users familiar with the Unix version will want to install the full ImageMagick. So the conversion you are using was never tested. So I got 'convert' working at the command line. Unfortunately, this turned out to be a red herring. I still can't typeset LyX's user manual from within LyX. Pdf and eps files (such as mobius.eps) still don't display within LyX ('Error converting to loadable format') and typesetting still fails. I tried exporting the LyX user manual to LaTeX(plain) and typesetting the resulting TeX file in TeXShop. That actually works, except cross references break ('see section ??' in the resulting pdf). But the pdf and eps files that are problematic in LyX typeset in TeXShop. What am I missing? -- Rich On Sat, Feb 4, 2012 at 2:47 PM, Richard Talley rich.tal...@gmail.comwrote: I had been running MacTex 2009 and Lyx 1.6.8. and using them extensively for technical documentation and homework assignments. I upgraded this morning to MacTex 2011 (using the Tex Live Utility to bring all the packages up to date) and Lyx 2.0.2. I tried to create a pdf of the UserGuide (located in /Applications/LyX.app/Contents/Resources/doc/ - opens as read only) Four eps files are generating 'Error converting to loadable format' in the LyX document. The LaTeX error dialog shows: Package pdftex.def Error: File `34_Applications_LyX_app_Contents_Resources_doc_clipart_mobius.pdf} Using draft setting for this image. Try typing return to proceed. If that doesn't work, type X return to quit. - OR - Package pdftex.def Error: File `42_Applications_LyX_app_Contents_Resources_doc_clipart_escher-lsd.pdf}} \hfill{}\subfloat[\label{f... So my system doesn't seem to be converting eps files correctly into pdfs for LyX to use. Any suggestions for troubleshooting? I've saved the complete LaTeX log, but it's huge and I'm not sure what's relevant. -- Rich MacBook Pro/OS X 10.6.8
Re: errors typesetting UserGuide.lyx
Assuming convert is really the problem, perhaps you can try a different imagemagick installation. Two options would be Macports, http://www.macports.org/install.php or Fink, http://www.finkproject.org/download/index.php?phpLang=en You only need one of these. Most people seem to choose Macports nowadays, but it really doesn't matter for your purposes. After following the installation instructions for one of these package managers, you can then install imagemagick by typing either sudo port install imagemagick (for Macports) or fink install imagemagick (for Fink). This won't interfere with the MacTeX installation, so it can't hurt to try. I have used both methods and found convert to work fine. Jens On Feb 5, 2012, at 5:41 PM, Richard Talley wrote: So I found a problem with the 'convert' utility (part of ImageMagick 6.6.9) that MacTex 2011 installs. The installation fails to install the necessary xml files that 'convert' needs to function correctly at the command line. Over at the macosx-tex mailing list, Dick Koch provided a link to the necessary xml files with this comment: We supply convert mainly for tex4html, thinking that users familiar with the Unix version will want to install the full ImageMagick. So the conversion you are using was never tested. So I got 'convert' working at the command line. Unfortunately, this turned out to be a red herring. I still can't typeset LyX's user manual from within LyX. Pdf and eps files (such as mobius.eps) still don't display within LyX ('Error converting to loadable format') and typesetting still fails. I tried exporting the LyX user manual to LaTeX(plain) and typesetting the resulting TeX file in TeXShop. That actually works, except cross references break ('see section ??' in the resulting pdf). But the pdf and eps files that are problematic in LyX typeset in TeXShop. What am I missing? -- Rich On Sat, Feb 4, 2012 at 2:47 PM, Richard Talley rich.tal...@gmail.com wrote: I had been running MacTex 2009 and Lyx 1.6.8. and using them extensively for technical documentation and homework assignments. I upgraded this morning to MacTex 2011 (using the Tex Live Utility to bring all the packages up to date) and Lyx 2.0.2. I tried to create a pdf of the UserGuide (located in /Applications/LyX.app/Contents/Resources/doc/ - opens as read only) Four eps files are generating 'Error converting to loadable format' in the LyX document. The LaTeX error dialog shows: Package pdftex.def Error: File `34_Applications_LyX_app_Contents_Resources_doc_clipart_mobius.pdf} Using draft setting for this image. Try typing return to proceed. If that doesn't work, type X return to quit. - OR - Package pdftex.def Error: File `42_Applications_LyX_app_Contents_Resources_doc_clipart_escher-lsd.pdf}} \hfill{}\subfloat[\label{f... So my system doesn't seem to be converting eps files correctly into pdfs for LyX to use. Any suggestions for troubleshooting? I've saved the complete LaTeX log, but it's huge and I'm not sure what's relevant. -- Rich MacBook Pro/OS X 10.6.8
Re: eLyXer for Document Parsing
On 04/02/2012 19:07, slitt wrote: One more question: You sure you want to go in-memory? What happens if a guy has a 1200 page book with 100 chapters each containing 10 sections, each containing 10 subsections, and tries to parse it on a machine with 512 MB RAM? You in a heap of trouble son. I am almost sure LyX is able to do that. Abdel.
Re: eLyXer for Document Parsing
On 04/02/2012 18:03, Rob Oakes wrote: Dear eLyXer Users and Developers, I'm still at work on the import/export module for Microsoft Word documents. I'm making pretty good progress. I've got a rough prototype that works pretty well and I'm now starting to refine it. My approach up to now has been to use regular expressions to match portions of the document and then use a library to translate those to the corresponding Word XML structures. It's working pretty well with my simple test documents. Before going too far with this approach, though, I wanted to post (another general query). In the eLyXer library, there is already a robust set of tools used for converting LyX documents to HTML. Does anyone know if the library is written in such as way that getting a generic in-memory representation of the document would be possible? It would be awesome to re-use as much existing code for the Word document export as possible. That would allow me to support a broader number of features, and gives me a framework for working with maths. Strong suggestion: use LyX proper. I am quite sure you already know that because I saw some patches from you in this area but I'll explain anyway: LyX's html own export is so good and fast because it effectively knows the in-memory representation of the document. You can't be faster nor more accurate than that. I mean, unless you want to rewrite LyX in python. IIUC you want a single module in python for both import and export in python. But I don't think this is a valid argument. As for the word to lyx format conversion, if you want to use this epub library there must be a way to use that in C++ I'm sure... Any thoughts Alex (and others)? I've downloaded the sources and have begun to work through them, but before spending hours to days trying to wrap my head around them, I thought I would ask. AFAIK, eLyXer doesn't construct a document model. So you'd better spend this time reading the C++ code for exporting to html/xhtml ;-) Abdel.
Re: eLyXer for Document Parsing
Hi all, I am currently travelling so excuse my android top-posting. Actually building a reusable in-memory representation for Python scripting of LyX documents was a requisite for eLyXer. You should not have trouble with large documents as my puny netbook eats 1000 page documents for lunch. Look at the Container class, and best of luck! Please ask in private any further questions. Alex. El 04/02/2012 18:03, Rob Oakes lyx-de...@oak-tree.us escribió: Dear eLyXer Users and Developers, I'm still at work on the import/export module for Microsoft Word documents. I'm making pretty good progress. I've got a rough prototype that works pretty well and I'm now starting to refine it. My approach up to now has been to use regular expressions to match portions of the document and then use a library to translate those to the corresponding Word XML structures. It's working pretty well with my simple test documents. Before going too far with this approach, though, I wanted to post (another general query). In the eLyXer library, there is already a robust set of tools used for converting LyX documents to HTML. Does anyone know if the library is written in such as way that getting a generic in-memory representation of the document would be possible? It would be awesome to re-use as much existing code for the Word document export as possible. That would allow me to support a broader number of features, and gives me a framework for working with maths. Any thoughts Alex (and others)? I've downloaded the sources and have begun to work through them, but before spending hours to days trying to wrap my head around them, I thought I would ask. Cheers, Rob
Re: eLyXer for Document Parsing
On Feb 5, 2012, at 2:04 AM, Abdelrazak Younes wrote: Strong suggestion: use LyX proper. I am quite sure you already know that because I saw some patches from you in this area but I'll explain anyway: LyX's html own export is so good and fast because it effectively knows the in-memory representation of the document. You can't be faster nor more accurate than that. I mean, unless you want to rewrite LyX in python. Extremely good point, I'm also more comfortable with the HTML export available in LyX. I initially was interested in eLyXer because I thought I might be able to use it to help with an import filter as well. I'm not sure that it can, though. As you note in your email, it doesn't create a document model. IIUC you want a single module in python for both import and export in python. But I don't think this is a valid argument. As for the word to lyx format conversion, if you want to use this epub library there must be a way to use that in C++ I'm sure… I though about using Python because I'd found a tool capable of generating docx for me. After working with it a little more, though, I'm less enamored with it. docx is a pretty straightforward file format, and there's quite a few things that are sloppily implemented. AFAIK, eLyXer doesn't construct a document model. So you'd better spend this time reading the C++ code for exporting to html/xhtml ;-) Following Steve's suggestion, I decided to try the easy way and directly parse the XHTML created by eLyXer. Turns out that it's not only easy, but probably the best way forward. There are some excellent libraries for reading XML in python. Using lxml, in particular, looks like a good solution. You generate the XHTML, parse it with lxml, and then iterate over the elements, translating as you go. My current script is about 50 lines long, and can be used with either native XHTML or eLyXer. To add new features, you add additional cases describing how to translate the XHTML. Which brings us to an important point: there's already a pretty good LyX - XHTML - LibreOffice - Word pathway for translating documents. Unless I directly implement Word as another backend (which, while a lot of work, isn't difficult), I'm not sure there's much reason for a direct MS Word export. The real need seems to be for an MS Word import, anyway. Cheers, Rob
Re: eLyXer for Document Parsing
On 05/02/2012 17:48, Rob Oakes wrote: My current script is about 50 lines long, and can be used with either native XHTML or eLyXer. To add new features, you add additional cases describing how to translate the XHTML. Which brings us to an important point: there's already a pretty good LyX - XHTML - LibreOffice - Word pathway for translating documents. Unless I directly implement Word as another backend (which, while a lot of work, isn't difficult), I'm not sure there's much reason for a direct MS Word export. The real need seems to be for an MS Word import, anyway. The native MSWord backend would be very interesting to have and useful and much better than anything you could produce with your python script. But I agree with you that the docx import looks more useful. And if the thing can be extended to pptx, it will be even more useful :-) Cheers, Abdel.
Re: Arrays or similar in \xymatrix{
I'm not entirely sure I know what you want. Does the following file do it? Paul #LyX 2.0 created this file. For more info see http://www.lyx.org/ \lyxformat 413 \begin_document \begin_header \textclass article \use_default_options true \maintain_unincluded_children false \language english \language_package default \inputencoding auto \fontencoding global \font_roman default \font_sans default \font_typewriter default \font_default_family default \use_non_tex_fonts false \font_sc false \font_osf false \font_sf_scale 100 \font_tt_scale 100 \graphics default \default_output_format default \output_sync 0 \bibtex_command default \index_command default \paperfontsize default \spacing single \use_hyperref false \papersize letterpaper \use_geometry true \use_amsmath 2 \use_esint 1 \use_mhchem 1 \use_mathdots 1 \cite_engine basic \use_bibtopic false \use_indices false \paperorientation portrait \suppress_date false \use_refstyle 1 \index Index \shortcut idx \color #008000 \end_index \leftmargin 1in \topmargin 1in \rightmargin 1in \bottommargin 1in \secnumdepth 3 \tocdepth 3 \paragraph_separation skip \defskip smallskip \quotes_language english \papercolumns 1 \papersides 1 \paperpagestyle default \tracking_changes false \output_changes false \html_math_output 0 \html_css_as_file 0 \html_be_strict false \end_header \begin_body \begin_layout Standard \begin_inset Formula $\xymatrix{S_{0}u^{2}\\ S_{0}u\ar[urr]\ar[drr]\\ S_{0}\ar[urr]\ar[drr]\genfrac{}{}{0pt}{0}{S_{0}u}{f_{u}}\\ S_{0}d\ar[urr]\ar[drr]\\ S_{0}d^{2} } $ \end_inset \end_layout \end_body \end_document
automatique reference of sub figure
Hello, I use the following preambule \AtBeginDocument{\renewcommand{\ref}[1]{\mbox{\autoref{#1 to add the word Figure when referencing figure. However, the word figure is not added when referencing sub-figure. For example it write 3a instead of Figure 3a. Please, what to add in order to get the word Figure before number of fig Thanks in advance,
Re: errors typesetting UserGuide.lyx
So I found a problem with the 'convert' utility (part of ImageMagick 6.6.9) that MacTex 2011 installs. The installation fails to install the necessary xml files that 'convert' needs to function correctly at the command line. Over at the macosx-tex mailing list, Dick Koch provided a link to the necessary xml files with this comment: We supply convert mainly for tex4html, thinking that users familiar with the Unix version will want to install the full ImageMagick. So the conversion you are using was never tested. So I got 'convert' working at the command line. Unfortunately, this turned out to be a red herring. I still can't typeset LyX's user manual from within LyX. Pdf and eps files (such as mobius.eps) still don't display within LyX ('Error converting to loadable format') and typesetting still fails. I tried exporting the LyX user manual to LaTeX(plain) and typesetting the resulting TeX file in TeXShop. That actually works, except cross references break ('see section ??' in the resulting pdf). But the pdf and eps files that are problematic in LyX typeset in TeXShop. What am I missing? -- Rich On Sat, Feb 4, 2012 at 2:47 PM, Richard Talley rich.tal...@gmail.comwrote: I had been running MacTex 2009 and Lyx 1.6.8. and using them extensively for technical documentation and homework assignments. I upgraded this morning to MacTex 2011 (using the Tex Live Utility to bring all the packages up to date) and Lyx 2.0.2. I tried to create a pdf of the UserGuide (located in /Applications/LyX.app/Contents/Resources/doc/ - opens as read only) Four eps files are generating 'Error converting to loadable format' in the LyX document. The LaTeX error dialog shows: Package pdftex.def Error: File `34_Applications_LyX_app_Contents_Resources_doc_clipart_mobius.pdf} Using draft setting for this image. Try typing return to proceed. If that doesn't work, type X return to quit. - OR - Package pdftex.def Error: File `42_Applications_LyX_app_Contents_Resources_doc_clipart_escher-lsd.pdf}} \hfill{}\subfloat[\label{f... So my system doesn't seem to be converting eps files correctly into pdfs for LyX to use. Any suggestions for troubleshooting? I've saved the complete LaTeX log, but it's huge and I'm not sure what's relevant. -- Rich MacBook Pro/OS X 10.6.8
Re: errors typesetting UserGuide.lyx
Assuming convert is really the problem, perhaps you can try a different imagemagick installation. Two options would be Macports, http://www.macports.org/install.php or Fink, http://www.finkproject.org/download/index.php?phpLang=en You only need one of these. Most people seem to choose Macports nowadays, but it really doesn't matter for your purposes. After following the installation instructions for one of these package managers, you can then install imagemagick by typing either sudo port install imagemagick (for Macports) or fink install imagemagick (for Fink). This won't interfere with the MacTeX installation, so it can't hurt to try. I have used both methods and found convert to work fine. Jens On Feb 5, 2012, at 5:41 PM, Richard Talley wrote: So I found a problem with the 'convert' utility (part of ImageMagick 6.6.9) that MacTex 2011 installs. The installation fails to install the necessary xml files that 'convert' needs to function correctly at the command line. Over at the macosx-tex mailing list, Dick Koch provided a link to the necessary xml files with this comment: We supply convert mainly for tex4html, thinking that users familiar with the Unix version will want to install the full ImageMagick. So the conversion you are using was never tested. So I got 'convert' working at the command line. Unfortunately, this turned out to be a red herring. I still can't typeset LyX's user manual from within LyX. Pdf and eps files (such as mobius.eps) still don't display within LyX ('Error converting to loadable format') and typesetting still fails. I tried exporting the LyX user manual to LaTeX(plain) and typesetting the resulting TeX file in TeXShop. That actually works, except cross references break ('see section ??' in the resulting pdf). But the pdf and eps files that are problematic in LyX typeset in TeXShop. What am I missing? -- Rich On Sat, Feb 4, 2012 at 2:47 PM, Richard Talley rich.tal...@gmail.com wrote: I had been running MacTex 2009 and Lyx 1.6.8. and using them extensively for technical documentation and homework assignments. I upgraded this morning to MacTex 2011 (using the Tex Live Utility to bring all the packages up to date) and Lyx 2.0.2. I tried to create a pdf of the UserGuide (located in /Applications/LyX.app/Contents/Resources/doc/ - opens as read only) Four eps files are generating 'Error converting to loadable format' in the LyX document. The LaTeX error dialog shows: Package pdftex.def Error: File `34_Applications_LyX_app_Contents_Resources_doc_clipart_mobius.pdf} Using draft setting for this image. Try typing return to proceed. If that doesn't work, type X return to quit. - OR - Package pdftex.def Error: File `42_Applications_LyX_app_Contents_Resources_doc_clipart_escher-lsd.pdf}} \hfill{}\subfloat[\label{f... So my system doesn't seem to be converting eps files correctly into pdfs for LyX to use. Any suggestions for troubleshooting? I've saved the complete LaTeX log, but it's huge and I'm not sure what's relevant. -- Rich MacBook Pro/OS X 10.6.8
Re: eLyXer for Document Parsing
On 04/02/2012 19:07, slitt wrote: One more question: You sure you want to go in-memory? What happens if a guy has a 1200 page book with 100 chapters each containing 10 sections, each containing 10 subsections, and tries to parse it on a machine with 512 MB RAM? You in a heap of trouble son. I am almost sure LyX is able to do that. Abdel.
Re: eLyXer for Document Parsing
On 04/02/2012 18:03, Rob Oakes wrote: Dear eLyXer Users and Developers, I'm still at work on the import/export module for Microsoft Word documents. I'm making pretty good progress. I've got a rough prototype that works pretty well and I'm now starting to refine it. My approach up to now has been to use regular expressions to match portions of the document and then use a library to translate those to the corresponding Word XML structures. It's working pretty well with my simple test documents. Before going too far with this approach, though, I wanted to post (another general query). In the eLyXer library, there is already a robust set of tools used for converting LyX documents to HTML. Does anyone know if the library is written in such as way that getting a generic in-memory representation of the document would be possible? It would be awesome to re-use as much existing code for the Word document export as possible. That would allow me to support a broader number of features, and gives me a framework for working with maths. Strong suggestion: use LyX proper. I am quite sure you already know that because I saw some patches from you in this area but I'll explain anyway: LyX's html own export is so good and fast because it effectively knows the in-memory representation of the document. You can't be faster nor more accurate than that. I mean, unless you want to rewrite LyX in python. IIUC you want a single module in python for both import and export in python. But I don't think this is a valid argument. As for the word to lyx format conversion, if you want to use this epub library there must be a way to use that in C++ I'm sure... Any thoughts Alex (and others)? I've downloaded the sources and have begun to work through them, but before spending hours to days trying to wrap my head around them, I thought I would ask. AFAIK, eLyXer doesn't construct a document model. So you'd better spend this time reading the C++ code for exporting to html/xhtml ;-) Abdel.
Re: eLyXer for Document Parsing
Hi all, I am currently travelling so excuse my android top-posting. Actually building a reusable in-memory representation for Python scripting of LyX documents was a requisite for eLyXer. You should not have trouble with large documents as my puny netbook eats 1000 page documents for lunch. Look at the Container class, and best of luck! Please ask in private any further questions. Alex. El 04/02/2012 18:03, "Rob Oakes"escribió: > Dear eLyXer Users and Developers, > > I'm still at work on the import/export module for Microsoft Word > documents. I'm making pretty good progress. I've got a rough prototype that > works pretty well and I'm now starting to refine it. > > My approach up to now has been to use regular expressions to match > portions of the document and then use a library to translate those to the > corresponding Word XML structures. It's working pretty well with my simple > test documents. > > Before going too far with this approach, though, I wanted to post (another > general query). > > In the eLyXer library, there is already a robust set of tools used for > converting LyX documents to HTML. Does anyone know if the library is > written in such as way that getting a generic in-memory representation of > the document would be possible? It would be awesome to re-use as much > existing code for the Word document export as possible. That would allow me > to support a broader number of features, and gives me a framework for > working with maths. > > Any thoughts Alex (and others)? I've downloaded the sources and have begun > to work through them, but before spending hours to days trying to wrap my > head around them, I thought I would ask. > > Cheers, > > Rob
Re: eLyXer for Document Parsing
On Feb 5, 2012, at 2:04 AM, Abdelrazak Younes wrote: > Strong suggestion: use LyX proper. I am quite sure you already know that > because I saw some patches from you in this area but I'll explain anyway: > LyX's html own export is so good and fast because it effectively knows the > in-memory representation of the document. You can't be faster nor more > accurate than that. I mean, unless you want to rewrite LyX in python. Extremely good point, I'm also more comfortable with the HTML export available in LyX. I initially was interested in eLyXer because I thought I might be able to use it to help with an import filter as well. I'm not sure that it can, though. As you note in your email, it doesn't create a document model. > IIUC you want a single module in python for both import and export in python. > But I don't think this is a valid argument. As for the word to lyx format > conversion, if you want to use this epub library there must be a way to use > that in C++ I'm sure… I though about using Python because I'd found a tool capable of generating docx for me. After working with it a little more, though, I'm less enamored with it. docx is a pretty straightforward file format, and there's quite a few things that are sloppily implemented. > AFAIK, eLyXer doesn't construct a document model. So you'd better spend this > time reading the C++ code for exporting to html/xhtml ;-) Following Steve's suggestion, I decided to try the "easy" way and directly parse the XHTML created by eLyXer. Turns out that it's not only easy, but probably the best way forward. There are some excellent libraries for reading XML in python. Using lxml, in particular, looks like a good solution. You generate the XHTML, parse it with lxml, and then iterate over the elements, translating as you go. My current script is about 50 lines long, and can be used with either native XHTML or eLyXer. To add new features, you add additional cases describing how to translate the XHTML. Which brings us to an important point: there's already a pretty good LyX -> XHTML -> LibreOffice -> Word pathway for translating documents. Unless I directly implement Word as another backend (which, while a lot of work, isn't difficult), I'm not sure there's much reason for a direct MS Word export. The real need seems to be for an MS Word import, anyway. Cheers, Rob
Re: eLyXer for Document Parsing
On 05/02/2012 17:48, Rob Oakes wrote: My current script is about 50 lines long, and can be used with either native XHTML or eLyXer. To add new features, you add additional cases describing how to translate the XHTML. Which brings us to an important point: there's already a pretty good LyX -> XHTML -> LibreOffice -> Word pathway for translating documents. Unless I directly implement Word as another backend (which, while a lot of work, isn't difficult), I'm not sure there's much reason for a direct MS Word export. The real need seems to be for an MS Word import, anyway. The native MSWord backend would be very interesting to have and useful and much better than anything you could produce with your python script. But I agree with you that the docx import looks more useful. And if the thing can be extended to pptx, it will be even more useful :-) Cheers, Abdel.
Re: Arrays or similar in \xymatrix{
I'm not entirely sure I know what you want. Does the following file do it? Paul #LyX 2.0 created this file. For more info see http://www.lyx.org/ \lyxformat 413 \begin_document \begin_header \textclass article \use_default_options true \maintain_unincluded_children false \language english \language_package default \inputencoding auto \fontencoding global \font_roman default \font_sans default \font_typewriter default \font_default_family default \use_non_tex_fonts false \font_sc false \font_osf false \font_sf_scale 100 \font_tt_scale 100 \graphics default \default_output_format default \output_sync 0 \bibtex_command default \index_command default \paperfontsize default \spacing single \use_hyperref false \papersize letterpaper \use_geometry true \use_amsmath 2 \use_esint 1 \use_mhchem 1 \use_mathdots 1 \cite_engine basic \use_bibtopic false \use_indices false \paperorientation portrait \suppress_date false \use_refstyle 1 \index Index \shortcut idx \color #008000 \end_index \leftmargin 1in \topmargin 1in \rightmargin 1in \bottommargin 1in \secnumdepth 3 \tocdepth 3 \paragraph_separation skip \defskip smallskip \quotes_language english \papercolumns 1 \papersides 1 \paperpagestyle default \tracking_changes false \output_changes false \html_math_output 0 \html_css_as_file 0 \html_be_strict false \end_header \begin_body \begin_layout Standard \begin_inset Formula $\xymatrix{ & & & & S_{0}u^{2}\\ & & S_{0}u\ar[urr]\ar[drr]\\ S_{0}\ar[urr]\ar[drr] & & & & \genfrac{}{}{0pt}{0}{S_{0}u}{f_{u}}\\ & & S_{0}d\ar[urr]\ar[drr]\\ & & & & S_{0}d^{2} } $ \end_inset \end_layout \end_body \end_document
automatique reference of sub figure
Hello, I use the following preambule \AtBeginDocument{\renewcommand{\ref}[1]{\mbox{\autoref{#1 to add the word < Figure > when referencing figure. However, the word figure is not added when referencing sub-figure. For example it write 3a instead of Figure 3a. Please, what to add in order to get the word Figure before number of fig Thanks in advance,
Re: errors typesetting UserGuide.lyx
So I found a problem with the 'convert' utility (part of ImageMagick 6.6.9) that MacTex 2011 installs. The installation fails to install the necessary xml files that 'convert' needs to function correctly at the command line. Over at the macosx-tex mailing list, Dick Koch provided a link to the necessary xml files with this comment: "We supply convert mainly for tex4html, thinking that users familiar with the Unix version will want to install the full ImageMagick. So the conversion you are using was never tested." So I got 'convert' working at the command line. Unfortunately, this turned out to be a red herring. I still can't typeset LyX's user manual from within LyX. Pdf and eps files (such as mobius.eps) still don't display within LyX ('Error converting to loadable format') and typesetting still fails. I tried exporting the LyX user manual to LaTeX(plain) and typesetting the resulting TeX file in TeXShop. That actually works, except cross references break ('see section ??' in the resulting pdf). But the pdf and eps files that are problematic in LyX typeset in TeXShop. What am I missing? -- Rich On Sat, Feb 4, 2012 at 2:47 PM, Richard Talleywrote: > I had been running MacTex 2009 and Lyx 1.6.8. and using them extensively > for technical documentation and homework assignments. > > I upgraded this morning to MacTex 2011 (using the Tex Live Utility to > bring all the packages up to date) and Lyx 2.0.2. > > I tried to create a pdf of the UserGuide (located in > /Applications/LyX.app/Contents/Resources/doc/ - opens as read only) > > Four eps files are generating 'Error converting to loadable format' in the > LyX document. The LaTeX error dialog shows: > > Package pdftex.def Error: File > `34_Applications_LyX_app_Contents_Resources_doc_clipart_mobius.pdf} > > Using draft setting for this image. > > Try typing to proceed. > > If that doesn't work, type X to quit. > > > > - OR - > > > Package pdftex.def Error: File > `42_Applications_LyX_app_Contents_Resources_doc_clipart_escher-lsd.pdf}} > > \hfill{}\subfloat[\label{f... > > > > So my system doesn't seem to be converting eps files correctly into pdfs > for LyX to use. Any suggestions for troubleshooting? I've saved the > complete LaTeX log, but it's huge and I'm not sure what's relevant. > > > -- Rich > > MacBook Pro/OS X 10.6.8 > > >
Re: errors typesetting UserGuide.lyx
Assuming convert is really the problem, perhaps you can try a different imagemagick installation. Two options would be Macports, http://www.macports.org/install.php or Fink, http://www.finkproject.org/download/index.php?phpLang=en You only need one of these. Most people seem to choose Macports nowadays, but it really doesn't matter for your purposes. After following the installation instructions for one of these package managers, you can then install imagemagick by typing either sudo port install imagemagick (for Macports) or fink install imagemagick (for Fink). This won't interfere with the MacTeX installation, so it can't hurt to try. I have used both methods and found convert to work fine. Jens On Feb 5, 2012, at 5:41 PM, Richard Talley wrote: > So I found a problem with the 'convert' utility (part of ImageMagick 6.6.9) > that MacTex 2011 installs. The installation fails to install the necessary > xml files that 'convert' needs to function correctly at the command line. > > Over at the macosx-tex mailing list, Dick Koch provided a link to the > necessary xml files with this comment: > > "We supply convert mainly for tex4html, thinking that users familiar with the > Unix version > will want to install the full ImageMagick. So the conversion you are using > was never tested." > > So I got 'convert' working at the command line. Unfortunately, this turned > out to be a red herring. I still can't typeset LyX's user manual > from within LyX. Pdf and eps files (such as mobius.eps) still don't display > within LyX ('Error converting to loadable format') and > typesetting still fails. > > I tried exporting the LyX user manual to LaTeX(plain) and typesetting the > resulting TeX file in TeXShop. That actually works, > except cross references break ('see section ??' in the resulting pdf). But > the pdf and eps files that are problematic in LyX typeset > in TeXShop. > > What am I missing? > > -- Rich > > > On Sat, Feb 4, 2012 at 2:47 PM, Richard Talleywrote: > I had been running MacTex 2009 and Lyx 1.6.8. and using them extensively for > technical documentation and homework assignments. > > I upgraded this morning to MacTex 2011 (using the Tex Live Utility to bring > all the packages up to date) and Lyx 2.0.2. > > I tried to create a pdf of the UserGuide (located in > /Applications/LyX.app/Contents/Resources/doc/ - opens as read only) > > Four eps files are generating 'Error converting to loadable format' in the > LyX document. The LaTeX error dialog shows: > > Package pdftex.def Error: File > `34_Applications_LyX_app_Contents_Resources_doc_clipart_mobius.pdf} > > Using draft setting for this image. > Try typing to proceed. > If that doesn't work, type X to quit. > > > - OR - > > Package pdftex.def Error: File > `42_Applications_LyX_app_Contents_Resources_doc_clipart_escher-lsd.pdf}} > \hfill{}\subfloat[\label{f... > > > So my system doesn't seem to be converting eps files correctly into pdfs for > LyX to use. Any suggestions for troubleshooting? I've saved the complete > LaTeX log, but it's huge and I'm not sure what's relevant. > > -- Rich > MacBook Pro/OS X 10.6.8 > >