是否可以编译隐藏文件?

是否可以编译隐藏文件?

(这个问题可能只有在Linux下才有意义。)

我有以下名为 的简单文件.main.tex。请注意,由于其名称,它是一个“隐藏”文件。

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

我无法按通常的方式进行编译,pdflatex .main.tex因为我收到此错误:

$ 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: 

当然,如果文件名是的话main.tex它就会起作用。

有没有直接编译点文件的解决方法?

或者这是 TeX 检测文件扩展名的另一个限制(被点混淆)?


请注意,之前曾问过其他相关但不同的问题,但这个问题有所不同:

(视窗)TeX 引擎无法在 Windows 中写入隐藏的辅助文件

(清理相关)有没有办法配置 pdflatex 以使除 .tex 和 .pdf 文件之外的所有文件都变成隐藏文件?

(扩展处理的限制)如何避免文件名中自动出现 .tex 扩展名?

答案1

这取决于你的设置有多严格texmf.cnf。我的(默认 texlive 2014)设置如下:

% 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

因此,这会导致错误,tex 可以您的主文件,但无法写入aux以点开头的名称的文件。

注意:r请避免打开点文件。

相关内容