LATEX-L Archives

Mailing list for the LaTeX3 project

LATEX-L@LISTSERV.UNI-HEIDELBERG.DE

Options: Use Forum View

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

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

Print Reply
Subject:
From:
Hans Aberg <[log in to unmask]>
Reply To:
Mailing list for the LaTeX3 project <[log in to unmask]>
Date:
Thu, 30 Aug 2001 12:31:49 +0200
Content-Type:
text/plain
Parts/Attachments:
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
code):
-------------------------------------------------------------
% File begin.tex:
%
\ifx\beginned\relax\message{file already read.}%
\let\rebeginned\relax\let\mayendfileinput\endinput%
\else\global\let\beginned\relax\let\mayendfileinput\relax\fi
%
\mayendfileinput    % End or not end file input, as set above.
%
% Add user commands here below:

\documentclass[leqno]{article}

\usepackage{color}
\usepackage{hyperref}

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

% AMS LaTeX Package
\usepackage{amsmath}
\usepackage{amscd}

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

\usepackage{abergmath}

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

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

\end{document}
%\end

% 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

ATOM RSS1 RSS2