# Is it possible to compile hidden files?

(This question may make sense only in Linux.)

I have the following simple file called .main.tex. Note that it is a "hidden" file because of its name.

\documentclass[]{article}
\begin{document}
sample
\end{document}


I cannot compile it the usual way pdflatex .main.tex because I get this error:

$pdflatex .interpolation.tex This is pdfTeX, Version 3.1415926-2.6-1.40.14 (TeX Live 2014/dev) restricted \write18 enabled. entering extended mode (./.main.tex ... No file .main.aux. pdflatex: Not writing to .main.aux (openout_any = p). ! I can't write on file .main.aux'. \document ...ate \openout \@mainaux \jobname .aux \immediate \write \@mainau... l.4 \begin{document} (Press Enter to retry, or Control-D to exit; default file extension is .tex') Please type another output file name:  Of course if the filename were main.tex it would work. Is there a workaround to compile dot files directly? Or is this another limitation of how TeX detects file extensions (confused by the dots)? Note that other related but different questions where asked before, this is however different: (limitations of extension handling) How to avoid automatic .tex extension in filenames? - ## 1 Answer It depends on how paranoid your settings in texmf.cnf are. Mine (default texlive 2014) says: % 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


So this gives the error you get, tex can read your main file, but is prevented from writing the aux file with a name starting with a dot.

note r prevents opening dotfiles.

-
openout_any = a in my /usr/share/texlive/texmf-dist/web2c/texmf.cnf (line 598) solved it. This also explains why I was never able to compile from a different directory! (It is the first time I see that creating dot files is a security problem.) –  alfC Aug 30 at 8:48
@alfC if you leave it as a generally then copying a malicious MWE from a tex web site and running it could trash your system files like .profile .login etc... unless you are totally sure what the macros are doing –  David Carlisle Aug 30 at 8:55