LATEX-L Archives

Mailing list for the LaTeX3 project


Options: Use Forum View

Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Hans Aberg <[log in to unmask]>
Reply To:
Mailing list for the LaTeX3 project <[log in to unmask]>
Thu, 30 Aug 2001 12:31:49 +0200
text/plain (86 lines)
I make use of a feature that in a project that consists of several files
allows me to compile each LaTeX file individually, thus saving some
compilation time while writing the manuscript. I think such a system might
be useful for inclusion in LaTeX3.

One way to view it is as a workaround for LaTeX's Pascal preamble style: If
this preamble declaration style is dropped from LaTeX (replaced by a more
OO system admitting local definitions), perhaps this feature I suggest
would not be needed.

So I use two files, "begin.tex" and "end.tex", and each text part file with
in the project contains:
  \input begin
  ...  % Text
  \input end

The files "begin.tex" and "end.tex" look as follows (with some example user
% File begin.tex:
\ifx\beginned\relax\message{file already read.}%
\mayendfileinput    % End or not end file input, as set above.
% Add user commands here below:



% AMS Fonts Package
\usepackage{amscal}    % Use AMS calligraphic instead of TeX.

% AMS LaTeX Package

\usepackage{rsfs}   % Use RSFS to define \mathscr


%\input hyphenations    % Hyphenation file
%\input definitions     % Definitions file

% EOF begin.tex
% File end.tex:
\ifx\rebeginned\relax\message{file: Not yet.}%
\else\message{file: Now.}\let\mayendfileinput\relax\fi
\mayendfileinput    % End or not end file input, as set above.
% Add user commands here below:


% EOF end.tex

If one use the stuff above, then if say main.tex contains
  \input chapter1
  \input chapter2
and all files, main.tex, chapter1, ..., contain the
  \input begin
  ... % text
  \input end
pair, then the user defined commands of this pair will only be read once,
so it becomes possible to compile each chapter1.tex, ... individually.
However, LaTeX will be confused when later compiling main.tex because of
multiply defined labels (but only on the level of warnings, I think).

The idea would be to somehow integrate such a system into LaTeX, so that it
works correctly with respect to labels, perhaps with a \begin{...} ...
\end{...} pair replacing the \input being ... \input end stuff.

  Hans Aberg