Re: is it possible to create a lyx file as flat ASCII file?
Sooo ... the answer is: yes it is possible I just had no idea how sensitive LyX is for whitespace when loading a file. I found an extra space at the end of a sentence can create the wobble of not loading the document settings properly. Anyway, the python script below works for me - it loads all the .eps files in a folder and creates a lyx file that can be imported as an appendix. For me this is a roundabout way to add multipage pdf files (reports) to the document. First export the pdf to 1 page eps files. Then run this script and add to the main document. If someone knows a more elegant way - suggestions are welcome. Cheers import glob, os Use: python lyx_eps_appendix.py MyLyxFile.lyx def main(): removeSpace(r'*.eps') lyxHeader() lyxGraphic(r'*.eps') print '\n\n\end_layout\n\n\end_body\n\end_document' def removeSpace(pattern): for filename in glob.glob(pattern): os.rename(filename, filename.replace( , 0)) def lyxGraphic(pattern): for filename in sorted(glob.glob(pattern)): bodypart1 = '\\begin_inset Graphics\n\tfilename ' bodypart2 = filename bodypart3 = '\n\tdisplay false\n\twidth 12cm\n\n\\end_inset\n\n\n' bodypart4 = '\\begin_inset Newpage clearpage\n\\end_inset\n\n' lyxbody = bodypart1 + bodypart2 + bodypart3 + bodypart4 print lyxbody def lyxHeader(): print '#LyX 2.0 created this file. For more info see http://www.lyx.org/\n\\lyxformat http://www.lyx.org//n//lyxformat 413\n\\begin_document\n\\begin_header\n\\textclass article\n\\use_default_options true\n\\maintain_unincluded_children false\n\\language english\n\\language_package default\n\\inputencoding auto\n\\fontencoding global\n\\font_roman default\n\\font_sans default\n\\font_typewriter default\n\\font_default_family default\n\\use_non_tex_fonts false\n\\font_sc false\n\\font_osf false\n\\font_sf_scale 100\n\\font_tt_scale 100\n\n\\graphics default\n\\default_output_format default\n\\output_sync 0\n\\bibtex_command default\n\\index_command default\n\\paperfontsize default\n\\use_hyperref false\n\\papersize default\n\\use_geometry false\n\\use_amsmath 1\n\\use_esint 1\n\\use_mhchem 1\n\\use_mathdots 1\n\\cite_engine basic\n\\use_bibtopic false\n\\use_indices false\n\\paperorientation portrait\n\\suppress_date false\n\\use_refstyle 1\n\\index Index\n\\shortcut idx\n\\color #008000\n\\end_index\n\\secnumdepth 3\n\\tocdepth 3\n\\paragraph_separation indent\n\\paragraph_indentation default\n\\quotes_language english\n\\papercolumns 1\n\\papersides 1\n\\paperpagestyle default\n\\tracking_changes false\n\\output_changes false\n\\html_math_output 0\n\\html_css_as_file 0\n\\html_be_strict false\n\\end_header\n\n\\begin_body\n\n\\begin_layout Standard' if __name__ == __main__: main() 2014-05-10 19:18 GMT-03:00 Thirsty Camel thirstycam...@gmail.com: Hey, that is new for me. Thanks a lot, I will have a look Still, if anyone can tell me if the lyx-file format has any hidden data or quirks that would be most welcome. If I know I can create lyx files without using lyx (e.g. emacs or python), that would be very useful. Many thanks 2014-05-10 17:30 GMT-03:00 Stephan Witt st.w...@gmx.net: Am 10.05.2014 um 17:35 schrieb Thirsty Camel thirstycam...@gmail.com: Nope, I would not like to export What I would like is: 1. create a plain text file (*.lyx) 2. import into main document One step more: ideally I would like to use a script to select all figures in a folder and create a lyx file that can be imported into the main document. LyX is scriptable. But you need a running instance. See the chapter about the LyX Server in the Additional Manual. Perhaps this is helpful to solve your task. Stephan 2014-05-10 5:09 GMT-03:00 Stephan Witt st.w...@gmx.net: Am 10.05.2014 um 02:36 schrieb Thirsty Camel thirstycam...@gmail.com: Hmm, I spent quite a lot of time doing that without much success even with very simple files. Is there anyone who has working tried and made it work? Is it necessary to copy the complete header of lyx files - is there a minimum header and footer? Is Export = Simple Text what you want?
Re: is it possible to create a lyx file as flat ASCII file?
Sooo ... the answer is: yes it is possible I just had no idea how sensitive LyX is for whitespace when loading a file. I found an extra space at the end of a sentence can create the wobble of not loading the document settings properly. Anyway, the python script below works for me - it loads all the .eps files in a folder and creates a lyx file that can be imported as an appendix. For me this is a roundabout way to add multipage pdf files (reports) to the document. First export the pdf to 1 page eps files. Then run this script and add to the main document. If someone knows a more elegant way - suggestions are welcome. Cheers import glob, os Use: python lyx_eps_appendix.py MyLyxFile.lyx def main(): removeSpace(r'*.eps') lyxHeader() lyxGraphic(r'*.eps') print '\n\n\end_layout\n\n\end_body\n\end_document' def removeSpace(pattern): for filename in glob.glob(pattern): os.rename(filename, filename.replace( , 0)) def lyxGraphic(pattern): for filename in sorted(glob.glob(pattern)): bodypart1 = '\\begin_inset Graphics\n\tfilename ' bodypart2 = filename bodypart3 = '\n\tdisplay false\n\twidth 12cm\n\n\\end_inset\n\n\n' bodypart4 = '\\begin_inset Newpage clearpage\n\\end_inset\n\n' lyxbody = bodypart1 + bodypart2 + bodypart3 + bodypart4 print lyxbody def lyxHeader(): print '#LyX 2.0 created this file. For more info see http://www.lyx.org/\n\\lyxformat http://www.lyx.org//n//lyxformat 413\n\\begin_document\n\\begin_header\n\\textclass article\n\\use_default_options true\n\\maintain_unincluded_children false\n\\language english\n\\language_package default\n\\inputencoding auto\n\\fontencoding global\n\\font_roman default\n\\font_sans default\n\\font_typewriter default\n\\font_default_family default\n\\use_non_tex_fonts false\n\\font_sc false\n\\font_osf false\n\\font_sf_scale 100\n\\font_tt_scale 100\n\n\\graphics default\n\\default_output_format default\n\\output_sync 0\n\\bibtex_command default\n\\index_command default\n\\paperfontsize default\n\\use_hyperref false\n\\papersize default\n\\use_geometry false\n\\use_amsmath 1\n\\use_esint 1\n\\use_mhchem 1\n\\use_mathdots 1\n\\cite_engine basic\n\\use_bibtopic false\n\\use_indices false\n\\paperorientation portrait\n\\suppress_date false\n\\use_refstyle 1\n\\index Index\n\\shortcut idx\n\\color #008000\n\\end_index\n\\secnumdepth 3\n\\tocdepth 3\n\\paragraph_separation indent\n\\paragraph_indentation default\n\\quotes_language english\n\\papercolumns 1\n\\papersides 1\n\\paperpagestyle default\n\\tracking_changes false\n\\output_changes false\n\\html_math_output 0\n\\html_css_as_file 0\n\\html_be_strict false\n\\end_header\n\n\\begin_body\n\n\\begin_layout Standard' if __name__ == __main__: main() 2014-05-10 19:18 GMT-03:00 Thirsty Camel thirstycam...@gmail.com: Hey, that is new for me. Thanks a lot, I will have a look Still, if anyone can tell me if the lyx-file format has any hidden data or quirks that would be most welcome. If I know I can create lyx files without using lyx (e.g. emacs or python), that would be very useful. Many thanks 2014-05-10 17:30 GMT-03:00 Stephan Witt st.w...@gmx.net: Am 10.05.2014 um 17:35 schrieb Thirsty Camel thirstycam...@gmail.com: Nope, I would not like to export What I would like is: 1. create a plain text file (*.lyx) 2. import into main document One step more: ideally I would like to use a script to select all figures in a folder and create a lyx file that can be imported into the main document. LyX is scriptable. But you need a running instance. See the chapter about the LyX Server in the Additional Manual. Perhaps this is helpful to solve your task. Stephan 2014-05-10 5:09 GMT-03:00 Stephan Witt st.w...@gmx.net: Am 10.05.2014 um 02:36 schrieb Thirsty Camel thirstycam...@gmail.com: Hmm, I spent quite a lot of time doing that without much success even with very simple files. Is there anyone who has working tried and made it work? Is it necessary to copy the complete header of lyx files - is there a minimum header and footer? Is Export = Simple Text what you want?
Re: is it possible to create a lyx file as flat ASCII file?
Sooo ... the answer is: yes it is possible I just had no idea how sensitive LyX is for whitespace when loading a file. I found an extra space at the end of a sentence can create the wobble of not loading the document settings properly. Anyway, the python script below works for me - it loads all the .eps files in a folder and creates a lyx file that can be imported as an appendix. For me this is a roundabout way to add multipage pdf files (reports) to the document. First export the pdf to 1 page eps files. Then run this script and add to the main document. If someone knows a more elegant way - suggestions are welcome. Cheers import glob, os """ Use: python lyx_eps_appendix.py > MyLyxFile.lyx """ def main(): removeSpace(r'*.eps') lyxHeader() lyxGraphic(r'*.eps') print '\n\n\end_layout\n\n\end_body\n\end_document' def removeSpace(pattern): for filename in glob.glob(pattern): os.rename(filename, filename.replace(" ", "0")) def lyxGraphic(pattern): for filename in sorted(glob.glob(pattern)): bodypart1 = '\\begin_inset Graphics\n\tfilename ' bodypart2 = filename bodypart3 = '\n\tdisplay false\n\twidth 12cm\n\n\\end_inset\n\n\n' bodypart4 = '\\begin_inset Newpage clearpage\n\\end_inset\n\n' lyxbody = bodypart1 + bodypart2 + bodypart3 + bodypart4 print lyxbody def lyxHeader(): print '#LyX 2.0 created this file. For more info see http://www.lyx.org/\n\\lyxformat <http://www.lyx.org//n//lyxformat> 413\n\\begin_document\n\\begin_header\n\\textclass article\n\\use_default_options true\n\\maintain_unincluded_children false\n\\language english\n\\language_package default\n\\inputencoding auto\n\\fontencoding global\n\\font_roman default\n\\font_sans default\n\\font_typewriter default\n\\font_default_family default\n\\use_non_tex_fonts false\n\\font_sc false\n\\font_osf false\n\\font_sf_scale 100\n\\font_tt_scale 100\n\n\\graphics default\n\\default_output_format default\n\\output_sync 0\n\\bibtex_command default\n\\index_command default\n\\paperfontsize default\n\\use_hyperref false\n\\papersize default\n\\use_geometry false\n\\use_amsmath 1\n\\use_esint 1\n\\use_mhchem 1\n\\use_mathdots 1\n\\cite_engine basic\n\\use_bibtopic false\n\\use_indices false\n\\paperorientation portrait\n\\suppress_date false\n\\use_refstyle 1\n\\index Index\n\\shortcut idx\n\\color #008000\n\\end_index\n\\secnumdepth 3\n\\tocdepth 3\n\\paragraph_separation indent\n\\paragraph_indentation default\n\\quotes_language english\n\\papercolumns 1\n\\papersides 1\n\\paperpagestyle default\n\\tracking_changes false\n\\output_changes false\n\\html_math_output 0\n\\html_css_as_file 0\n\\html_be_strict false\n\\end_header\n\n\\begin_body\n\n\\begin_layout Standard' if __name__ == "__main__": main() 2014-05-10 19:18 GMT-03:00 Thirsty Camel <thirstycam...@gmail.com>: > Hey, that is new for me. Thanks a lot, I will have a look > > Still, if anyone can tell me if the lyx-file format has any hidden data or > quirks that would be most welcome. If I know I can create lyx files without > using lyx (e.g. emacs or python), that would be very useful. > > Many thanks > > > > > 2014-05-10 17:30 GMT-03:00 Stephan Witt <st.w...@gmx.net>: > > Am 10.05.2014 um 17:35 schrieb Thirsty Camel <thirstycam...@gmail.com>: >> >> > Nope, I would not like to export >> > >> > What I would like is: >> > 1. create a plain text file (*.lyx) >> > 2. import into main document >> > >> > One step more: ideally I would like to use a script to select all >> figures in a folder and create a lyx file that can be imported into the >> main document. >> >> LyX is scriptable. But you need a running instance. >> >> See the chapter about the LyX Server in the Additional Manual. >> >> Perhaps this is helpful to solve your task. >> >> Stephan >> >> > 2014-05-10 5:09 GMT-03:00 Stephan Witt <st.w...@gmx.net>: >> > Am 10.05.2014 um 02:36 schrieb Thirsty Camel <thirstycam...@gmail.com>: >> > >> > > Hmm, I spent quite a lot of time doing that without much success even >> with very simple files. Is there anyone who has working tried and made it >> work? >> > > >> > > Is it necessary to copy the complete header of lyx files - is there a >> minimum header and footer? >> > >> > Is "Export => Simple Text" what you want? >> >> >
Re: is it possible to create a lyx file as flat ASCII file?
Nope, I would not like to export What I would like is: 1. create a plain text file (*.lyx) 2. import into main document One step more: ideally I would like to use a script to select all figures in a folder and create a lyx file that can be imported into the main document. 2014-05-10 5:09 GMT-03:00 Stephan Witt st.w...@gmx.net: Am 10.05.2014 um 02:36 schrieb Thirsty Camel thirstycam...@gmail.com: Hmm, I spent quite a lot of time doing that without much success even with very simple files. Is there anyone who has working tried and made it work? Is it necessary to copy the complete header of lyx files - is there a minimum header and footer? Is Export = Simple Text what you want? Stephan
Re: is it possible to create a lyx file as flat ASCII file?
Hey, that is new for me. Thanks a lot, I will have a look Still, if anyone can tell me if the lyx-file format has any hidden data or quirks that would be most welcome. If I know I can create lyx files without using lyx (e.g. emacs or python), that would be very useful. Many thanks 2014-05-10 17:30 GMT-03:00 Stephan Witt st.w...@gmx.net: Am 10.05.2014 um 17:35 schrieb Thirsty Camel thirstycam...@gmail.com: Nope, I would not like to export What I would like is: 1. create a plain text file (*.lyx) 2. import into main document One step more: ideally I would like to use a script to select all figures in a folder and create a lyx file that can be imported into the main document. LyX is scriptable. But you need a running instance. See the chapter about the LyX Server in the Additional Manual. Perhaps this is helpful to solve your task. Stephan 2014-05-10 5:09 GMT-03:00 Stephan Witt st.w...@gmx.net: Am 10.05.2014 um 02:36 schrieb Thirsty Camel thirstycam...@gmail.com: Hmm, I spent quite a lot of time doing that without much success even with very simple files. Is there anyone who has working tried and made it work? Is it necessary to copy the complete header of lyx files - is there a minimum header and footer? Is Export = Simple Text what you want?
Re: is it possible to create a lyx file as flat ASCII file?
Nope, I would not like to export What I would like is: 1. create a plain text file (*.lyx) 2. import into main document One step more: ideally I would like to use a script to select all figures in a folder and create a lyx file that can be imported into the main document. 2014-05-10 5:09 GMT-03:00 Stephan Witt st.w...@gmx.net: Am 10.05.2014 um 02:36 schrieb Thirsty Camel thirstycam...@gmail.com: Hmm, I spent quite a lot of time doing that without much success even with very simple files. Is there anyone who has working tried and made it work? Is it necessary to copy the complete header of lyx files - is there a minimum header and footer? Is Export = Simple Text what you want? Stephan
Re: is it possible to create a lyx file as flat ASCII file?
Hey, that is new for me. Thanks a lot, I will have a look Still, if anyone can tell me if the lyx-file format has any hidden data or quirks that would be most welcome. If I know I can create lyx files without using lyx (e.g. emacs or python), that would be very useful. Many thanks 2014-05-10 17:30 GMT-03:00 Stephan Witt st.w...@gmx.net: Am 10.05.2014 um 17:35 schrieb Thirsty Camel thirstycam...@gmail.com: Nope, I would not like to export What I would like is: 1. create a plain text file (*.lyx) 2. import into main document One step more: ideally I would like to use a script to select all figures in a folder and create a lyx file that can be imported into the main document. LyX is scriptable. But you need a running instance. See the chapter about the LyX Server in the Additional Manual. Perhaps this is helpful to solve your task. Stephan 2014-05-10 5:09 GMT-03:00 Stephan Witt st.w...@gmx.net: Am 10.05.2014 um 02:36 schrieb Thirsty Camel thirstycam...@gmail.com: Hmm, I spent quite a lot of time doing that without much success even with very simple files. Is there anyone who has working tried and made it work? Is it necessary to copy the complete header of lyx files - is there a minimum header and footer? Is Export = Simple Text what you want?
Re: is it possible to create a lyx file as flat ASCII file?
Nope, I would not like to export What I would like is: 1. create a plain text file (*.lyx) 2. import into main document One step more: ideally I would like to use a script to select all figures in a folder and create a lyx file that can be imported into the main document. 2014-05-10 5:09 GMT-03:00 Stephan Witt <st.w...@gmx.net>: > Am 10.05.2014 um 02:36 schrieb Thirsty Camel <thirstycam...@gmail.com>: > > > Hmm, I spent quite a lot of time doing that without much success even > with very simple files. Is there anyone who has working tried and made it > work? > > > > Is it necessary to copy the complete header of lyx files - is there a > minimum header and footer? > > Is "Export => Simple Text" what you want? > > Stephan > >
Re: is it possible to create a lyx file as flat ASCII file?
Hey, that is new for me. Thanks a lot, I will have a look Still, if anyone can tell me if the lyx-file format has any hidden data or quirks that would be most welcome. If I know I can create lyx files without using lyx (e.g. emacs or python), that would be very useful. Many thanks 2014-05-10 17:30 GMT-03:00 Stephan Witt <st.w...@gmx.net>: > Am 10.05.2014 um 17:35 schrieb Thirsty Camel <thirstycam...@gmail.com>: > > > Nope, I would not like to export > > > > What I would like is: > > 1. create a plain text file (*.lyx) > > 2. import into main document > > > > One step more: ideally I would like to use a script to select all > figures in a folder and create a lyx file that can be imported into the > main document. > > LyX is scriptable. But you need a running instance. > > See the chapter about the LyX Server in the Additional Manual. > > Perhaps this is helpful to solve your task. > > Stephan > > > 2014-05-10 5:09 GMT-03:00 Stephan Witt <st.w...@gmx.net>: > > Am 10.05.2014 um 02:36 schrieb Thirsty Camel <thirstycam...@gmail.com>: > > > > > Hmm, I spent quite a lot of time doing that without much success even > with very simple files. Is there anyone who has working tried and made it > work? > > > > > > Is it necessary to copy the complete header of lyx files - is there a > minimum header and footer? > > > > Is "Export => Simple Text" what you want? > >
is it possible to create a lyx file as flat ASCII file?
Is it possible to create a lyx file as pure ascii text, particularly a chapter? I have been trying to create appendix files that should be imported into the main document. I would like to use a script to create my appendix files with 30-100 figures each instead of doing all this manually. Unfortunately I cannot seem to create a lyx file that is accepted by the main document, even if it looks to be 100% the same as a manual file. Is there some invisible text generated by lyx? Many thanks for any help
Re: is it possible to create a lyx file as flat ASCII file?
Hmm, I spent quite a lot of time doing that without much success even with very simple files. Is there anyone who has working tried and made it work? Is it necessary to copy the complete header of lyx files - is there a minimum header and footer? 2014-05-09 20:44 GMT-03:00 Liviu Andronic landronim...@gmail.com: On Sat, May 10, 2014 at 1:28 AM, Thirsty Camel thirstycam...@gmail.com wrote: Is it possible to create a lyx file as pure ascii text, particularly a chapter? I have been trying to create appendix files that should be imported into the main document. I would like to use a script to create my appendix files with 30-100 figures each instead of doing all this manually. Unfortunately I cannot seem to create a lyx file that is accepted by the main document, even if it looks to be 100% the same as a manual file. Is there some invisible text generated by lyx? I heard people were doing this. Have you checked the EOL characters in both documents? Make sure that they're the same in both the main .lyx file and the generated one. Liviu Many thanks for any help -- Do you know how to read? http://www.alienetworks.com/srtest.cfm http://goodies.xfce.org/projects/applications/xfce4-dict#speed-reader Do you know how to write? http://garbl.home.comcast.net/~garbl/stylemanual/e.htm#e-mail
is it possible to create a lyx file as flat ASCII file?
Is it possible to create a lyx file as pure ascii text, particularly a chapter? I have been trying to create appendix files that should be imported into the main document. I would like to use a script to create my appendix files with 30-100 figures each instead of doing all this manually. Unfortunately I cannot seem to create a lyx file that is accepted by the main document, even if it looks to be 100% the same as a manual file. Is there some invisible text generated by lyx? Many thanks for any help
Re: is it possible to create a lyx file as flat ASCII file?
Hmm, I spent quite a lot of time doing that without much success even with very simple files. Is there anyone who has working tried and made it work? Is it necessary to copy the complete header of lyx files - is there a minimum header and footer? 2014-05-09 20:44 GMT-03:00 Liviu Andronic landronim...@gmail.com: On Sat, May 10, 2014 at 1:28 AM, Thirsty Camel thirstycam...@gmail.com wrote: Is it possible to create a lyx file as pure ascii text, particularly a chapter? I have been trying to create appendix files that should be imported into the main document. I would like to use a script to create my appendix files with 30-100 figures each instead of doing all this manually. Unfortunately I cannot seem to create a lyx file that is accepted by the main document, even if it looks to be 100% the same as a manual file. Is there some invisible text generated by lyx? I heard people were doing this. Have you checked the EOL characters in both documents? Make sure that they're the same in both the main .lyx file and the generated one. Liviu Many thanks for any help -- Do you know how to read? http://www.alienetworks.com/srtest.cfm http://goodies.xfce.org/projects/applications/xfce4-dict#speed-reader Do you know how to write? http://garbl.home.comcast.net/~garbl/stylemanual/e.htm#e-mail
is it possible to create a lyx file as flat ASCII file?
Is it possible to create a lyx file as pure ascii text, particularly a chapter? I have been trying to create appendix files that should be imported into the main document. I would like to use a script to create my appendix files with 30-100 figures each instead of doing all this manually. Unfortunately I cannot seem to create a lyx file that is accepted by the main document, even if it looks to be 100% the same as a manual file. Is there some invisible text generated by lyx? Many thanks for any help
Re: is it possible to create a lyx file as flat ASCII file?
Hmm, I spent quite a lot of time doing that without much success even with very simple files. Is there anyone who has working tried and made it work? Is it necessary to copy the complete header of lyx files - is there a minimum header and footer? 2014-05-09 20:44 GMT-03:00 Liviu Andronic <landronim...@gmail.com>: > On Sat, May 10, 2014 at 1:28 AM, Thirsty Camel <thirstycam...@gmail.com> > wrote: > > Is it possible to create a lyx file as pure ascii text, particularly a > > chapter? > > > > I have been trying to create appendix files that should be imported into > the > > main document. I would like to use a script to create my appendix files > with > > 30-100 figures each instead of doing all this manually. Unfortunately I > > cannot seem to create a lyx file that is accepted by the main document, > even > > if it looks to be 100% the same as a manual file. Is there some invisible > > text generated by lyx? > > > I heard people were doing this. Have you checked the EOL characters in > both documents? Make sure that they're the same in both the main .lyx > file and the generated one. > > Liviu > > > > Many thanks for any help > > > > > > > > -- > Do you know how to read? > http://www.alienetworks.com/srtest.cfm > http://goodies.xfce.org/projects/applications/xfce4-dict#speed-reader > Do you know how to write? > http://garbl.home.comcast.net/~garbl/stylemanual/e.htm#e-mail >