0

I solved my problem, but I would like to know why it appeared in the first place.

The following code is a MWE of the code I had. It worked for quite long until I updated a lot of my software on my computer. After that it just did not work anymore and with the errors I couldn't directly find the solution.

\documentclass{scrbook}
\usepackage{tikz}
\usetikzlibrary{external}
\tikzexternalize
\begin{document}
    \tikzsetnextfilename{.tikz_external/fig1}%
    \begin{tikzpicture}
        \draw (0,0 ) -- (1,1);
    \end{tikzpicture}
\end{document}

If you notice, I used to store all externalized figure stuff in the folder .tikz_external. After a long while I noticed that this is the problem. If I delete the point in the folder name, everything works again.

Now I would like to know why this behavior changed. Furthermore, even after finding the problem, I found nothing about that behavior. Is this not described anywhere?

edit: I'm using the latest MikTex distribution (2.9.6360).

the error ist

! I can't write on file `.tikz_external/fig1.md5'.
<to be read again> 
                   \relax 
l.10    \end{tikzpicture}

Please type another output file name
! Emergency stop.
<to be read again> 
                   \relax 
l.10    \end{tikzpicture}

*** (job aborted, file error in nonstop mode)

from this error, I just knew pdflatex can't write on the file but not why. And as I said, before I updated the distribution everything worked as expected.

5
  • @PierPaolo : the point in the folder name was intended, the folder should start with the point.
    – bene
    Commented Sep 20, 2017 at 11:15
  • The thing with the hidden files was my intention. I mainly work on Windows, here it's just nice to have these folders always on top in my file manager. Now that I know why it is not working, I can live with it. It's just that I would like to know why and if I could have solved the problem earlier.
    – bene
    Commented Sep 20, 2017 at 11:29
  • Need to know you TeX distro. I can tell you why it won't work with TeX Live.
    – cfr
    Commented Sep 20, 2017 at 22:13
  • That error is much less informative than TL's. It still shows it has nothing to do with externalisation, but, as you say, it doesn't tell you what it doesn't like about that file name.
    – cfr
    Commented Sep 21, 2017 at 11:49

1 Answer 1

1

You don't give any of the following pieces of information:

  1. what error message you get, if any, or whether it fails to work in some other way;
  2. which distribution of TeX you are using.

Hence, it is impossible to say for sure.

On a current TeX Live installation, the code fails simply because a path beginning with a dot is among those which, by default, TeX is forbidden to open as an output stream.

This is determined in texmf.cnf

% Do we allow TeX \input or \openin (openin_any), or \openout
% (openout_any) 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 dot files
% p (paranoid)   : as `r' and disallow going to parent directories, and
%                  restrict absolute paths to be under $TEXMFOUTPUT.
openin_any = a
openout_any = p

The setting p for openout_any tells you which files TeX may and may not open for output streams; the setting a for openin_any tells you which it may and may not open for input streams.

Clearly, p forbids writing to dot files. The problem has nothing to do with externalisation. The error is triggered simply because you can't write to such a file and explains why.

pdflatex: Not writing to .tikz_external/fig1.md5 (openout_any = p).

! I can't write on file `.tikz_external/fig1.md5'.
<to be read again> 
                   \relax 
l.41     \end{tikzpicture}

(Press Enter to retry, or Control-D to exit; default file extension is `.tex')
Please type another output file name: 
1
  • I'm using MikTex. I added the exact error message I got in my original comment. With MikTex there is no hint on the openout_any = p
    – bene
    Commented Sep 21, 2017 at 6:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .