Karakas Online

5.21. The final step: invoking lyxtox

If you have followed all the above, your working directory should now contain:

awkscr_create_index_items
awkscr_insert_index_items
awkscr_math
awkscr_refdb_html
awkscr_refdb_print
ck-style.css
images
jadetex.cfg
lyxtox
lyxtox-html.dsl
lyxtox-onehtml.dsl
lyxtox-print.dsl
lyxtox-print-howto.dsl
lyxtox-print-pdf.dsl
lyxtox-print-ps.dsl
lyxtox-print-rtf.dsl
lyxtox-print-txt.dsl
sedscr
sedscr_abi
sedscr_app
sedscr_bib
sedscr_delete_index_items
sedscr_list_index_items
sedscr_math
sedscr_ris
sedscr_top
sedscr_val

Now, to create all the other formats from your LyX source, you just call lyxtox with one argument: the name of your . lyx file without the . lyx ending:

lyxtox myTemplate

It's time for a cup of coffee now. Relax while your computer is busy creating a whole bunch of nice formatted documents. cool

For a detailed explanation of what is going behind the scenes, see Chapter 7.

Now, let's see a more realistic example: the creation of the GNU/Linux Command-Line Tools Summary HowTo. This HowTo is an attempt to provide a comprehensive summary of useful command-line tools available to a GNU/Linux based operating system, i.e. commands needed by the majority of users. The document is authored by Gareth Anderson and I assist him in the document conversion process. So, how do I go about such a project?

Here's how[1]:

My home directory is /home/chris. This is not my working directory for a lyxtox project. A working directory is, say, myLinuxCommands, beneath my home directory. That is, I create a working directory specific to a project. In our case, let's say this is /home/chris/myLinuxCommands.

Now, I change to the working directory and make sure I have all files mentioned above. These are at least

awkscr_create_index_items
awkscr_insert_index_items
awkscr_math
awkscr_refdb_html
awkscr_refdb_print
ck-style.css
images
jadetex.cfg
lyxtox
lyxtox-html.dsl
lyxtox-onehtml.dsl
lyxtox-print.dsl
lyxtox-print-howto.dsl
lyxtox-print-pdf.dsl
lyxtox-print-ps.dsl
lyxtox-print-rtf.dsl
lyxtox-print-txt.dsl
sedscr
sedscr_abi
sedscr_app
sedscr_bib
sedscr_delete_index_items
sedscr_list_index_items
sedscr_math
sedscr_ris
sedscr_top
sedscr_val
sedscr_ima
sedscr_apa

and may well have forgotten others (please tell me if I have). I copy these files from yet another directory in my home, where I have extracted a pristine copy of mySGML.tar.gz.

So now I have created the files

/home/chris/myLinuxCommands/awkscr_create_index_items
/home/chris/myLinuxCommands/awkscr_insert_index_items
/home/chris/myLinuxCommands/awkscr_math
/home/chris/myLinuxCommands/awkscr_refdb_html
/home/chris/myLinuxCommands/awkscr_refdb_print
/home/chris/myLinuxCommands/ck-style.css
/home/chris/myLinuxCommands/images
/home/chris/myLinuxCommands/jadetex.cfg
/home/chris/myLinuxCommands/lyxtox
/home/chris/myLinuxCommands/lyxtox-html.dsl
/home/chris/myLinuxCommands/lyxtox-onehtml.dsl
/home/chris/myLinuxCommands/lyxtox-print.dsl
/home/chris/myLinuxCommands/lyxtox-print-howto.dsl
/home/chris/myLinuxCommands/lyxtox-print-pdf.dsl
/home/chris/myLinuxCommands/lyxtox-print-ps.dsl
/home/chris/myLinuxCommands/lyxtox-print-rtf.dsl
/home/chris/myLinuxCommands/lyxtox-print-txt.dsl
/home/chris/myLinuxCommands/sedscr
/home/chris/myLinuxCommands/sedscr_abi
/home/chris/myLinuxCommands/sedscr_app
/home/chris/myLinuxCommands/sedscr_bib
/home/chris/myLinuxCommands/sedscr_delete_index_items
/home/chris/myLinuxCommands/sedscr_list_index_items
/home/chris/myLinuxCommands/sedscr_math
/home/chris/myLinuxCommands/sedscr_ris
/home/chris/myLinuxCommands/sedscr_top
/home/chris/myLinuxCommands/sedscr_val
/home/chris/myLinuxCommands/sedscr_ima
/home/chris/myLinuxCommands/sedscr_apa

as exact copies of the original ones (which are, as I said, in some other directory).

Now, in the /home/chris/myLinuxCommands directory, I create (or copy) the LyX file that I want to process. In our case, this is the gnu-linux-tools-summary.lyx file, together with bibliography.lyx and appendix.lyx. In other cases, the bibliography.lyx and appendix.lyx are not needed, so they are not there.

I change to the /home/chris/myLinuxCommands directory, which, as I said, is the working directory for the specific project in our example. Since my LyX file is gnu-linux-tools-summary.lyx, I call lyxtox with the basename of gnu-linux-tools-summary.lyx, i.e. with "gnu-linux-tools-summary", as its first and only parameter:

lyxtox gnu-linux-tools-summary

The name of the parameter is $1 in the lyxtox script.

(Of cource, I have taken care to adjust all parameters at the start of lyxtox to my situation, as described in Chapter 4).

If all goes well, I get another directory inside my working directory, named exactly as the parameter of the script, in our case gnu-linux-tools-summary. Everything I need is there: the one, big HTML file, the many HTML files ("chunks"), the PDF, PS.GZ, TXT files, the images directory, the math directory...simply everything. I can just tar the whole directory, upload it to my web site, extract it and I will have the whole project there!

Indeed, it is here: http://www.karakas-online.de/gnu-linux-tools-summary/. smile

Thus http://www.karakas-online.de/gnu-linux-tools-summary is an exact copy of my local /home/chris/myLinuxCommands/gnu-linux-tools-summary, as created by the lyxtox invocation

lyxtox gnu-linux-tools-summary
Note

Notice that you are supposed to have an "images" directory inside your working directory. Mine is /home/chris/myLinuxCommands/images. When you run lyxtox with "gnu-linux-tools-summary" as parameter, you get another one: /home/chris/myLinuxCommands/gnu-linux-tools-summary/images. This is perfectly OK: it is a copy of the original images directory. It is done this way, so that you only need to copy the gnu-linux-tools-summary to your website and be up and running without needing anything else.

Notes

[1]

See also How to correctly invoke the lyxtox script.

Last updated Mon Sep 24 01:19:25 CEST 2007 Permalink: http://www.karakas-online.de/mySGML/lyxtox.html All contents © 2002-2007 Chris Karakas