Hi all,
New user to both Kile and Linux/Ubuntu (9.04). I love both, and am enjoying learning this stuff.
Lately, I've been working on setting up a bunch of additional custom "Build" tools for Kile.
In particular, I wanted one that would take my active .tex file, convert it to plain text and then feed it into a TTS (text-to-speech) interpreter to read it out loud. I've mainly been using the festival tts system.
The best solution I've found so far is to create Tools in Kile for ps2ascii with options '%S.ps' '%S.txt', another for festival with options --tts '%S.txt', and then create a Sequence Tool that executes LaTeX then DVItoPS then the ps2ascii tool then the festival tool.
That works, but it seems a little involved, and less than ideal. Partly this is because I usually use pdflatex not latex, and this requires me to switch, not to mention populate my harddrive with extra .dvi, .ps and .txt files. I considered using pdftotext instead of ps2ascii, but pdftotext doesn't handle ligatures in a way that Festival can deal with, so all words with ligatures are misspoken. (The same goes for dvi2tty if I want to spare myself the DVI>PS step.)
Another thing I thought about trying is to bypass compiling altogether, and just use detex (or the similar untex) to strip out the LaTeX commands and feed its result into the TTS program.
The problem is that detex uses stdout for its output, and so to save it, you need to redirect it. E.g., from the commandline, it would be:
detex myfile.tex > myfile.txt
But Kile won't seem to let me define a tool that does that, because it can't handle the ">". If I try to create a tool to execute detex with options '%source' > '%S.txt', it appears, from Kile's output box, that it's changing ">" to the HTML code ">", which of course doesn't work. Piping it directly to festival with options '%source' | festival --tts, which works from the commandline, also doesn't work in Kile. (Not sure why not: maybe it just doesn't do piping or redirection.)
Is it possible to do redirection or piping with Kile tools? If not, is it possible to define custom tools for programs that use stdout with Kile at all?
Not an urgent thing -- the ps2ascii method does work well enough for the time being.