Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

docstripprovides the macro \batchinput, which calls a separate ins file. This file can be in a different directory with, say:

\batchinput{../contrib/xx.ins}

and they are generated, but in the same directory as the master ins. However, I want them to be generated in the same directory as the dtx/ins files. I've tried

\def\WriteToDir{../contrib/}

But then I get

! I can't write on file `../contrib/xx.ldf'.

Edit ... because TeXLive doesn't allow paths beginning with two dots.

I know \BaseDirectory, but this is intended for specifing the root directory of the TEX hierarchy (locally, by administrators).

How can I tell docstrip the files must be generated in the same directory as the dtx/ins files? Edit In other words, I wonder if these ins files can be run without having to set the path of the corresponding files (only the ins one).

share|improve this question
4  
TeX Live and MiKTeX disallow writing in directories above the current one or those specified with a full path. –  egreg Jun 22 '12 at 14:51
    
Assuming bash, you can say openout_any=a tex file.ins; use at your own risk. –  egreg Jun 22 '12 at 17:00
    
@egreg. Well, assuming bash, I think I can write an script running directly all those ins files, intead of using a master ins. –  Javier Bezos Jun 22 '12 at 17:02
    
Of course. But this is a security issue, so without specific and explicit user intervention, writing is disallowed except in the current directory or subdirectories thereof. –  egreg Jun 22 '12 at 17:14
    
Clearly, there is no hope... except moving the ins file to the "local" root directory, so that all ins files are in subdirectories (base and contrib). Not very elegant, imo, but it works. –  Javier Bezos Jun 22 '12 at 17:49

1 Answer 1

TeX Live sets up his options in the file texmf.cnf located in texlive/20XX/texmf/web2c/ However this file needn't to be edit. You should edit instead the file texmf.cnf in the directory texlive/20XX/.

In the main file you will find the following hint:

% Allow TeX \openin, \openout, or \input on filenames starting with `.'
% (e.g., .rhosts) or outside the current tree (e.g., /etc/passwd)?
% a (any)        : any file can be opened.
% r (restricted) : disallow opening "dotfiles".
% p (paranoid)   : as `r' and disallow going to parent directories, and
%                  restrict absolute paths to be under $TEXMFOUTPUT.
openout_any = p
openin_any = a

Based on this information you can edit the file texmf.cnf and set up openout_any=a

share|improve this answer
    
Thanks, but the ins files should work out of the box. –  Javier Bezos Jun 22 '12 at 17:51

Your Answer

 
discard

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.