Thread: [MiKTeX] Use of TEXMFOUTPUT on Windows
MiKTeX source code moved to GitHub
Brought to you by:
csc
From: Stephen B. <ste...@go...> - 2013-05-10 08:44:40
|
Hi, I'm trying to use TEXMFOUTPUT to enable me to write this sort of thing in my LaTeX document, and it not complain about not being able to write the file: \begin{document} \section{A section} Some text in a section \newwrite\tempfile \immediate\openout\tempfile=C:/docs/test.tex \immediate\write\tempfile{Some text} \immediate\closeout\tempfile \end{document} At the moment I get this error: ! I can't write on file `C:/docs/test.tex' kpsewhich tells me that TEXMFOUTPUT is set to what I think it is: >kpsewhich --var-value=TEXMFOUTPUT C:/docs If I remove the path in my document like this: \begin{document} \section{A section} Some text in a section \newwrite\tempfile \immediate\openout\tempfile=test.tex \immediate\write\tempfile{Some text} \immediate\closeout\tempfile \end{document} And specify the output directory to pdflatex: >pdflatex -output-directory %TEXMFOUTPUT% doc.tex then the test.tex fle is created where I want. However, I'm using LyX, and don't want to specify the output directory like this since it then puts all files in that directory, but I actually just want my explicitly written files from the LaTeX document in that directory, so I'd like to be able to use TEXMFOUTPUT as I think it is supposed to work. I've tried this in a Unix system, and it works as I expect. Any thoughts as to why TEXMFOUTPUT isn't allowing me to write files into the directory so specified? Many thanks in advance, Steve |
From: Ulrike F. <li...@ni...> - 2013-05-10 09:03:54
|
Am Fri, 10 May 2013 09:44:32 +0100 schrieb Stephen Brooking: > Hi, > > I'm trying to use TEXMFOUTPUT to enable me to write this sort of thing in > my LaTeX document, and it not complain about not being able to write the > file: > > \begin{document} > > \section{A section} > Some text in a section > > \newwrite\tempfile > \immediate\openout\tempfile=C:/docs/test.tex Don't use such absolute pathes. This is a security risk. Write the files in some subfolder of your main document. -- Ulrike Fischer http://www.troubleshooting-tex.de/ |
From: Stephen B. <ste...@go...> - 2013-05-23 10:50:13
|
Ulrike Fischer <list <at> nililand.de> writes: > > Am Fri, 10 May 2013 09:44:32 +0100 schrieb Stephen Brooking: > > > Hi, > > > > I'm trying to use TEXMFOUTPUT to enable me to write this sort of thing in > > my LaTeX document, and it not complain about not being able to write the > > file: > > > > \begin{document} > > > > \section{A section} > > Some text in a section > > > > \newwrite\tempfile > > \immediate\openout\tempfile=C:/docs/test.tex > > Don't use such absolute pathes. This is a security risk. Write the > files in some subfolder of your main document. > The trouble I have with that is that I'm using LyX, and it wants to put all the output files in a temporary directory. So writing to files/test.tex, for example, will write the file to a directory within the temporary hierarchy, rather than a subfolder of the main document. Maybe this therefore comes to be a question for LyX. However, if I have control over TEXMFOUTPUT, why is this still a security risk? Also, any idea why TEXMFOUTPUT doesn't seem to be having the effect that I would expect? Thanks and regards, Steve |