Next section of the novel is forthcoming.
Warning: Techy stuff ahead
If you've read my previous post: A Note on Writing Software, you'll know that I am currently using LaTeX to write my story. There are many tools that I use. The three main programs that I use are pdflatex (makes PDFs), oolatex (makes ODT [OpenDocumentText file]), and latex2html (makes a HTML file). The ease in which I can convert into all of these filetypes is one reason why I use LaTeX. Recently though, I discovered something. For those of you who know, oolatex is a part of Tex4ht, which is itself capable of making an HTML file via the htlatex command. Now I have found that when copy/pasting the html produced by the htlatex command into Blogspot, the paragraphs get all messed up. This is why I turned to latex2html. The only caveat with latex2html is that the Table of Contents hyperlinks do not work (keyed to file). This problem was quickly solved by a few sed commands replacing part of the HTML code that tied the links to the file. Anyways I wrote a little bash script so that I can easily convert my .tex file into .odt, .pdf, and .html all in one go. Here is said script
#!/bin/bash
cd /home/ray/Documents/Novel/Tex/
sed "s_\\\usepackage_%\\\usepackage_"
sed "s_\\\hypersetup_%\\\hypersetup_"
mk4ht oolatex Master.tex
sed "s_%\\\usepackage_\\\usepackage_"
sed "s_%\\\hypersetup_\\\hypersetup_"
pdflatex Master.tex
#htlatex Master.tex
latex2html -split 0 -no_navigation -dir /home/ray/Documents/Novel/Tex/ Master.tex
sed 's_Master.html#_#_'
rm index.html
rm Master.html
mv Master.html.new Master.html
rm $(ls --hide=*.tex --hide=*.sh --hide=*.html --hide=*.odt --hide=*.pdf)
cd ~
Now there's probably an easier way to do all of this, and I welcome suggestions, but this is the one I've settled upon for now.
No comments:
Post a Comment