TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to use the vc bundle to add version information to my files. I'd like to go the "write18" route, rather than the makefile route, for now at least. I believe to make it work, I need to allow the vc script to run. TeXlive has a restricted write18 list, of commands that can be run. (I believe I've understood this correctly...) So my question is: how do I the vc script to this list?

I'm on ubuntu 10.10 with the packaged version of TeXlive 2009. I think I found the right file, in /etc/texmf/texmf.d/95NonPath.cnf but it is write only. So before I sudo emacs it, I wanted to check I am doing the right thing. Is there a way I could keep my configuration files I've changed in my ~/texmf tree?

I could just emacs-fu my way to automatically have vc run, but I'd rather have a write18 solution...

So here's the relevant part of my preamble:

\immediate\write18{sh ./vc}

I have tried adding vc to the shell_escape_commands list in /etc/texmf/texmf.d/95NonPath.cnf but this didn't work. kpsewhich -expand-var '$shell_escape_commands' still doesn't list it. So I add vc directly into /usr/share/texmf/web2c/texmf.cnf but this doesn't work either. I don't think I can add sh ./vc to the shell escape list, since I'm not allowed spaces in that list right? Would adding sh to the list work? Is that a good idea? I'm pretty sure that would be dangerous...

share|improve this question
Thank you for letting me know about the vc bundle. Looks very useful. I had been using svninfo but it puts stuff on the page by default. – Matthew Leingang Dec 17 '10 at 20:24
Yeah I like it. I've just been doing M-! then sh ./vc in emacs, which is not ideal. But it's a neat, simple appraoch... – Seamus Dec 17 '10 at 22:19
Adding sh would be a very bad idea. – TH. Dec 18 '10 at 23:58
I thought so... – Seamus Dec 19 '10 at 12:28
up vote 4 down vote accepted

TeX Live 2009 had a restricted write18, but it was apparently not safe and so disabled by default. It is enabled in TeX Live 2010.

I cannot help with Ubuntu's packed version specifically because I always install TeX Live myself. Using TeX Live installed by the standard install script, the file that should be changed is .../texlive/2010/texmf.cnf. You would add it to the shell_escape_commands list.

I'm not a kpathsea expert, so I'm not sure if there's a way to just add to the list without overriding. The obvious thing to try

shell_escape_commands = ./vc, ${shell_escape_commands}

does not work:

$ kpsewhich -expand-var '$shell_escape_commands'
warning: kpathsea: variable `shell_escape_commands' references itself (eventually).

But you can just duplicate the original list and then add in ./vc.

share|improve this answer
In the ubuntu version of tl09 it seems to be enabled: shell_escape=p. I've updated my question. Maybe I'm trying to add the wrong thing to the list? – Seamus Dec 18 '10 at 18:35
@Seamus: What happens if you add ./vc to the list? – TH. Dec 19 '10 at 3:53
It doesn't work. Also if I open a terminal in emacs and type ./vc I get Permission Denied. I need to type sh ./vc in the terminal... I'm beginning to think this might not be a LaTeX question? – Seamus Dec 19 '10 at 12:13
@Seamus: Sounds like you need to change the mode on vc. Namely, chmod +x vc. – TH. Dec 19 '10 at 12:59
For the record, what needs doing is adding ./vc to the texmf.cnf file, and adding permissions as suggested in an earlier comment. then the line in the tex file: \immediate\write18{./vc} – Seamus Jan 21 '11 at 18:21

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.