4

I'm a new LaTeX learner.

Is there anybody who knows "Example environment" in "The LaTeX Companion" book? Thanks in advance.

  • 1
    Welcome to TeX.SX! Your question is quite unclear. – user31729 Sep 9 '14 at 5:59
  • 1
    As Christian Hupfer says, your question is really quite unclear. What exactly is it you want to do with this "example environment"? – moewe Sep 9 '14 at 6:15
  • 1
    @ChristianHupfer That might be the case, so you can answer the question with "yes" :-). The objective of the question still beats me, though. – moewe Sep 9 '14 at 6:20
  • 1
    @moewe: It's an assumption only, so I stay with 'The answer is perhaps' for the moment ;-) – user31729 Sep 9 '14 at 6:23
  • 2
    I suspect the question can be rephrased as: "Who knows where I can read up on how an environment works in the "LaTeX companion?" – 1010011010 Sep 9 '14 at 7:09
7

The book is made using a makefile (unix style build script) each example is a separate document that is run as a separate latex job to produce a pdf file that is then included as an image into the main document. These example document sources are in the main document source but written out (using something equivalent to the filecontents environment)

The sources of the example documents use a series of conventional comments that are used in a modified verbatim environment to hide parts of the preamble, just to save space in the main book. (I don't actually have the sources to hand here so no examples:-) If I remember correctly the first edition used a different scheme that processed all the examples in the main run, but that becomes increasingly hard to avoid artifacts from interactions between the packages, especially given the number and complexity of some of the packages in the book.

4

The examples can be run as follows:

\documentclass{ttctexa}

\pagestyle{empty}
\setcounter{page}{6}
\setlength\textwidth{159.0pt}

\StartShownPreambleCommands
\usepackage{ragged2e}
\StopShownPreambleCommands
\begin{document}
The right column shows the input text to be treated by
\LaTeX{} with preamble material shown in blue. In the
left column one sees the result after typesetting.
\end{document}

Where the class ttctexa.cls is at tug

What is missing is the script to run them all automatically from one directory (as David Carlisle described in his answer), but maybe someone has a link. However, you can run the examples without the script. Just save the class in the same directory.

  • The .zip file of examples for the book includes the ttctexa.cls file. (Along with ttctexamargin.cls and ttctexareport.cls). Some of the example files end with the extension .ltx and others with the extension .ltx2 . For some reason, when I run the .ltx files everything works properly, but when I try to run the .ltx2 files, I get the message ! LaTeX Error: File 'ttctexa.cls' not found. – Bryan M-H Feb 5 '18 at 17:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.