| 1 |
%* filecontents |
| 2 |
% $Id: includex-test.tex,v 1.2 1999/02/27 05:09:26 swift Exp $ |
| 3 |
|
| 4 |
%** includex-test-aux.tex |
| 5 |
\begin{filecontents}{includex-test-aux.tex} |
| 6 |
This text is in a separate file that just contains text, and some \LaTeX\ code. |
| 7 |
For a change, let's quote \emph{Moby Dick}, chapter~94: |
| 8 |
\begin{quotation} % |
| 9 |
Squeeze!\ squeeze!\ squeeze!\ all the morning long; I squeezed that sperm |
| 10 |
till I myself almost melted into it; I squeezed that sperm till a strange |
| 11 |
sort of insanity came over me; and I found myself unwittingly squeezing my |
| 12 |
co-laborers' hands in it, mistaking their hands for the gentle globules. |
| 13 |
Such an abounding, affectionate, friendly, loving feeling did this avocation |
| 14 |
beget; that at last I was continually squeezing their hands, and looking up |
| 15 |
into their eyes sentimentally; as much as to say,---Oh!\ my dear fellow |
| 16 |
beings, why should we longer cherish any social acerbities, or know the |
| 17 |
slightest ill-humor or envy! Come; let us squeeze hands all round; nay, let |
| 18 |
us all squeeze ourselves into each other; let us squeeze ourselves |
| 19 |
universally into the very milk and sperm of kindness. |
| 20 |
|
| 21 |
Would that I could keep squeezing that sperm for ever! For now, since by many |
| 22 |
prolonged, repeated experiences, I have perceived that in all cases man must |
| 23 |
eventually lower, or at least shift, his conceit of attainable felicity; not |
| 24 |
placing it anywhere in the intellect or the fancy; but in the wife, the |
| 25 |
heart, the bed, the table, the saddle, the fire-side, the country; now that I |
| 26 |
have perceived all this, I am ready to squeeze case eternally. In thoughts |
| 27 |
of the visions of the night, I saw long rows of angels in paradise, each with |
| 28 |
his hands in a jar of spermaceti. |
| 29 |
\end{quotation} |
| 30 |
\end{filecontents} |
| 31 |
%** includex-test-aux1.tex |
| 32 |
\begin{filecontents}{includex-test-aux1.tex} |
| 33 |
\documentclass{article} |
| 34 |
|
| 35 |
\usepackage{alltt} |
| 36 |
|
| 37 |
\newcommand\preamblecmd |
| 38 |
{This line is due to the preamble of the included file.} |
| 39 |
|
| 40 |
\tdisable |
| 41 |
\tdisableone{flue} |
| 42 |
\tdisableopt[glue]{shoe} |
| 43 |
\tdisabletwo{blue}{grue} |
| 44 |
|
| 45 |
\begin{document} |
| 46 |
|
| 47 |
\tdisable |
| 48 |
\tdisableone{flue} |
| 49 |
\tdisableopt[glue]{shoe} |
| 50 |
\tdisabletwo{blue}{grue} |
| 51 |
|
| 52 |
\preamblecmd |
| 53 |
|
| 54 |
This file could be compiled on its own. |
| 55 |
|
| 56 |
\begin{alltt} |
| 57 |
Here is yet another quotation from Beckett, this time from \emph{Watt} |
| 58 |
(45--46). |
| 59 |
\end{alltt} |
| 60 |
|
| 61 |
\begin{quotation} |
| 62 |
The crocuses and the larch turning green every year a week before the others |
| 63 |
and the pastures red with uneaten sheep's placentas and the long summer days |
| 64 |
and the new-mown hay and the wood-pigeon in the morning and the cuckoo in the |
| 65 |
afternoon and the corncrake in the evening and the wasps in the jam and the |
| 66 |
smell of the gorse and the look of the gorse and the apples falling and the |
| 67 |
children walking in the dead leaves and the larch turning brown a week before |
| 68 |
the others and the chestnuts falling and the howling winds and the sea |
| 69 |
breaking over the pier and the first fires and the hooves on the road and the |
| 70 |
consumptive postman whistling \emph{The Roses Are Blooming in Picardy} and |
| 71 |
the standard oil-lamp and of course the snow and to be sure the sleet and |
| 72 |
bless your heart the slush and every fourth year the February d\`eb\^acle and |
| 73 |
the endless April showers and the crocuses and then the whole bloody business |
| 74 |
starting all over again. |
| 75 |
\end{quotation} |
| 76 |
|
| 77 |
Notice, just as one single thing among dozens, that ``crocus'' |
| 78 |
sounds like ``croak us.'' |
| 79 |
|
| 80 |
\end{document}Error 1 in radical shutdown! |
| 81 |
Error 2 in radical shutdown! |
| 82 |
|
| 83 |
None of this text should ever be set. |
| 84 |
|
| 85 |
\end{filecontents} |
| 86 |
%** includex-test-aux.sty |
| 87 |
\begin{filecontents}{includex-test-aux.sty} |
| 88 |
\renewcommand\autotest {% |
| 89 |
This text is coming from the definition of $\backslash$\texttt{autotest} that |
| 90 |
is in the auxiliary file. |
| 91 |
} |
| 92 |
|
| 93 |
\typeout{Autoload file being loaded!} |
| 94 |
|
| 95 |
\newcommand\madbomber {% |
| 96 |
\emph{I am the mad bomber!}% |
| 97 |
} |
| 98 |
|
| 99 |
\end{filecontents} |
| 100 |
|
| 101 |
%* main document |
| 102 |
|
| 103 |
\documentclass{article} |
| 104 |
\usepackage{includex,compsci} |
| 105 |
|
| 106 |
\begin{document} |
| 107 |
%* Intro |
| 108 |
\def\fileversion{v1} |
| 109 |
\def\filedate{1999/02/26} |
| 110 |
|
| 111 |
\makeatletter |
| 112 |
\def\StripV #1{\E@cdr #1\@nil} |
| 113 |
\makeatother |
| 114 |
|
| 115 |
\date{Version: \StripV\fileversion \qquad Date: \filedate} |
| 116 |
\author{Matt Swift \email{[email protected]}} |
| 117 |
\title{Testing the \package{includex} package} |
| 118 |
\maketitle |
| 119 |
|
| 120 |
\section{New ways to include} |
| 121 |
|
| 122 |
This will take several pages. |
| 123 |
|
| 124 |
First, check that we can |\include| as usual, so the rest of this page should |
| 125 |
be blank, and the Melville quote should be alone on the next page. |
| 126 |
|
| 127 |
\include{includex-test-aux} |
| 128 |
|
| 129 |
This should be on a new page. Now we include the same thing, but it should |
| 130 |
come immediately here because we use |\include*|: |
| 131 |
|
| 132 |
\include*{includex-test-aux} |
| 133 |
|
| 134 |
And this paragraph should immediately follow the Melville. Now, we check |
| 135 |
|\includedoc| and |\includedoc*| in a similar manner. The included file is |
| 136 |
going to use the |alltt| environment. We have loaded the package in the parent |
| 137 |
file. The |\usepackage| command in the included file should be disabled; if |
| 138 |
not, there will be an error when it tries to redefine the environment. Also, |
| 139 |
we disable several commands that will produce an error if they are not. This |
| 140 |
should be the last text on this page. |
| 141 |
|
| 142 |
\newcommand\tdisable{\typeout{Error with \protect\tdisable.}} |
| 143 |
\newcommand\tdisableone[1]{\typeout{Error with \protect\tdisableone.}} |
| 144 |
\newcommand\tdisableopt[2][]{\typeout{Error with \protect\tdisableopt.}} |
| 145 |
\newcommand\tdisabletwo[2]{\typeout{Error with \protect\tdisabletwo.}} |
| 146 |
|
| 147 |
\disable{\let\tdisable\relax} |
| 148 |
\disable{\let\tdisableone\Gobble} |
| 149 |
\disable{\let\tdisableopt\GobbleOM} |
| 150 |
\disable{\let\tdisabletwo\GobbleMM} |
| 151 |
|
| 152 |
\makeatletter |
| 153 |
\newcommand\checkp {% |
| 154 |
\@ifundefined{preamblecmd} {% |
| 155 |
\DTypeout{Preamblecmd undefined.}% |
| 156 |
}{% ELSE |
| 157 |
\DTypeout{Preamblecmd is: (\preamblecmd).}% |
| 158 |
% \let\preamblecmd\relax |
| 159 |
}% |
| 160 |
} |
| 161 |
\makeatother |
| 162 |
\checkp |
| 163 |
|
| 164 |
\includedoc{includex-test-aux1} |
| 165 |
|
| 166 |
\checkp |
| 167 |
|
| 168 |
And this should be on a new page. The first line should have said it |
| 169 |
comes from the preamble. |
| 170 |
|
| 171 |
The |\includedoc| family of commands puts the included file into a group. So |
| 172 |
|\preamblecmd| is not defined now. |
| 173 |
|
| 174 |
Now we do the same thing over, but the file should appear immediately. |
| 175 |
|
| 176 |
\includedoc*{includex-test-aux1} |
| 177 |
|
| 178 |
\checkp |
| 179 |
|
| 180 |
And this paragraph should immediately follow the Beckett. Finally, we have to |
| 181 |
check |\includedocskip| and |\includedocskip*|. The difference will be that |
| 182 |
the first line will say it comes from the parent. This should be the last text |
| 183 |
on the page. |
| 184 |
|
| 185 |
\newcommand\preamblecmd {% |
| 186 |
This def of preamblecmd comes from the parent. |
| 187 |
} |
| 188 |
|
| 189 |
\includedocskip{includex-test-aux1} |
| 190 |
|
| 191 |
\checkp |
| 192 |
This should be on a new page. And once again, the quote should follow |
| 193 |
immediately here: |
| 194 |
|
| 195 |
\includedocskip*{includex-test-aux1} |
| 196 |
|
| 197 |
\checkp |
| 198 |
|
| 199 |
And this text should immediately follow the quote. |
| 200 |
|
| 201 |
%* end |
| 202 |
|
| 203 |
END OF TEST |
| 204 |
|
| 205 |
\end{document} |
| 206 |
|