TeX Live 中的 .tex 文件有什么用途?

TeX Live 中的 .tex 文件有什么用途?

如果我跑

kpsewhich .tex

我明白了

/usr/local/texlive/2013/texmf-dist/tex/latex/tools/.tex

该文件属于 LaTeX 核心文件,几乎是空的:

%%
%% This is file `.tex',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% fileerr.dtx  (with options: `return')
%% 
%% This is a generated file.
%% 
%% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005
%% 2006 2008 2009
%% The LaTeX3 Project and any individual authors listed elsewhere
%% in this file.
%% 
%% This file was generated from file(s) of the Standard LaTeX `Tools Bundle'.
%% --------------------------------------------------------------------------
%% 
%% It may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3c
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%%    http://www.latex-project.org/lppl.txt
%% and version 1.3c or later is part of all distributions of LaTeX
%% version 2005/12/01 or later.
%% 
%% This file may only be distributed together with a copy of the LaTeX
%% `Tools Bundle'. You may however distribute the LaTeX `Tools Bundle'
%% without such generated files.
%% 
%% The list of all files belonging to the LaTeX `Tools Bundle' is
%% given in the file `manifest.txt'.
%% 
 \message{File ignored}
\endinput
%%
%% End of file `.tex'.

我猜这与一些

文件未找到

错误,但我在 中找不到任何相关信息source2e。那么它是用来做什么的呢?

答案1

如果你看一下目录,你还会看到一些其他tex\latex\tools\奇怪的文件:h.tex、、和。这些都是当 LaTeX 提示你输入文件名时你可以给出的单字母响应。考虑这个文档:e.texq.texr.texs.tex

\documentclass{article}

\begin{document}

\input{foo}

\end{document}

假设foo.tex不存在,如果您以交互模式运行 LaTeX,您将获得:

! LaTeX Error: File `foo.tex' not found.

Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: tex)

Enter file name: 

LaTeX 正在等待您输入文件名,然后它会尝试加载它。如果您提供的文件名也不存在,您将再次收到提示。如果您只是按下回车键,您实际上是在请求文件.tex,LaTeX 会继续加载该文件。这个文件实际上什么也不做,但它会跳出提示Enter file name:

假设你输入h后按回车键,你会得到:

Enter file name: h
(/home/texlive/2013/texmf-dist/tex/latex/tools/h.tex
! The file name provided could not be found.
Use `<enter>' to continue processing,
`S' to scroll future errors
`R' to run without stopping,
`Q' to run quietly,
or `X' to terminate TeX
! .
l.41 \errmessage{}

? 

也就是说,LaTeX 具有h.tex提供帮助消息和提示的输入。同样,如果您在提示符x下键入Enter file name:x.tex则是输入,这会导致 LaTeX 运行过早退出,依此类推。

相关内容