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.texe.texq.tex和。這些都是當 LaTeX 提示您輸入檔案名稱時您可以給出的單字母回應。考慮這個文檔:r.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 正在等待您輸入檔案名,然後它會嘗試載入它。如果您提供的檔案名稱也不存在,您將再次收到提示。如果您只是按下 Enter 鍵,您實際上是在請求該文件.tex,LaTeX 會繼續載入該文件。該文件實際上不執行任何操作,但它打破了Enter file name:提示。

假設您輸入h後按 Enter 鍵,您將得到:

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提供幫助訊息和提示的輸入。同樣,如果您xEnter file name:提示字元下鍵入x.texis 輸入,這會導致 LaTeX 運行過早退出,等等。

相關內容