April, 2009
Passing Command Line Arguments to a LaTeX Document
Some time ago, someone asked me if I knew a way to pass command line arguments to LaTeX documents. My first response was that this ought to be impossible; being a compiler, LaTeX cannot in any way alter it’s input files. But command line parameters can alter the output without touching the input of course.
This has kept me thinking for a while, and at the end I came up with some kind of a solution.
Let’s take a simple LaTeX file:
\documentclass{article}
\begin{document}
\someinput{}
\end{document}
and call it test.tex.
We will define the output of \someinput{} as a command line parameter at LaTeX invocation, as follows:
echo '\\newcommand{\\someinput}{hello world} \\input test' | latex
Result: test.dvi containing the text “hello world”. Admitted, it’s not the easiest solution, but it does make LaTeX useful inside simple batch jobs!
For more advanced LaTeX templating, I advise using Perl and Text::Template.
Posted in Open Source Adventures, scripting No Comments »
Explaining Open Source to computer illiterates
Yesterday I was invited as a guest speaker at Foras (Forum voor Academici uit
Schoten). Foras is a monthly meetup of academics somehow related to Schoten. Every month, a speaker is invited to
talk about a general topic of interest. Overseeing the list of the past 25
years, I found a lot of interesting topic and speakers. Being part of this
list now honestly humbles me. A big thanks to Foras for inviting me.
I have been giving talks about Open Source (and other topics) here and there
for quite some time now, but this was the first time my audience had an
average age of over 50, was mainly computer illiterate, but highly educated.
Here are the slides I used for the presentation. I usually present without
slides, or with only very few. This time I opted for a fully slide-supported
presentation:
However unacquainted the audience with the topic, the questions and discussion afterwards were very much in line with what one would expect:
- What about the quality assurance of Open Source software?
- If it was all so straightforward, then why isn’t the world convinced yet?
- Can one use Open Source software together with proprietary software?
- …
In the future I should address these elements in the presentation itself. Frametitle could be “Open Source Myths” or so. :-)
One thing surprised me a lot. In my presentation I never mention Microsoft. Still, people afterwards were constantly asking my opinion about their practices. Interesting how clear it was for them Microsoft does not have a place in the picture I hung up about Open Source.
I can recommend everyone giving a presentation about their favourite topic to an audience with no prejudices or even knowledge about your subject. It’s an eye-opener!
Posted in Open Source Adventures No Comments »
![[Zoocamp -- 23/05/2009]](http://bbbart.eu/blog/wp-content/uploads/2009/04/zoocamp.png)