Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

This is one of examples the that appears in the TeXbook (pg. 411) and I tried my hands at typseting it but couldn't. I'm a newbie and was hoping someone here could help, please?

The code supposedly is:

\input concert
\tsaologo
\medskip
\centerline{Friday, November 19, 1982, 8:00 p.m.}
\bigskip
\centerline{\bf PROGRAM}
\medskip
\composition{Variations on a Theme by Tchaikovsky}
\composer{Anton S. Arensky (1861--1906)}
\smallskip
{\medtype
\movements{Tema: Moderato\cr
Var.~I: Un poco pi\`u mosso&Var.~V: Andante\cr
Var.~II: Allegro non troppo&Var.~VI: Allegro con spirito\cr
Var.~III: Andantino tranquillo&Var.~VII: Andante con moto\cr
Var.~IV: Vivace&Coda: Moderato\cr}
}
\bigskip
\composition{Concerto for Horn and Hardart, S.\,27}
\composer{P. D. Q. Bach (1807--1742)?}
\smallskip
\movements{Allegro con brillo\cr
Tema con variazione \(su un tema differente)\cr
Menuetto con panna e zucchero\cr}
\medskip
\soloists{Ben Lee User, horn\cr
Peter Schickele, hardart\cr}
\bigskip
\centerline{INTERMISSION}
\bigskip
\composition{Symphony No.\,3 in E\flat\ Major\cr
Op.\,55, ``The Eroica''\cr}
\composer{Ludwig van Beethoven (1770--1827)}
\smallskip
\movements{Allegro con brio\cr
Marcia funebre: Adagio assai\cr
Scherzo: Allegro vivace\cr
Finale: Allegro molto\cr}
\bigskip
\smalltype \noindent
Members of the audience are kindly requested to turn off the
alarms on their digital watches, and to cough only between movements.
\bye

Before entering the code (b/w the \begin and \end), this is what I type:

\documentclass[12pt]{article}
\usepackage{amsmath}
\usepackage{geometry}
\usepackage{graphicx}
\usepackage{calc}
\headheight -0.5in
\textheight 9.5in
\begin{document}
\end{document}

Also, these macros (or definition - I don't know if they're the same thing) are to be used too:

\def\composition#1{\halign{\bf\quad##\hfil\cr
\kern-1em#1\crcr}} % use \cr's if more than one line
\def\composer#1{\rightline{\bf#1}}
\def\movements#1{\halign{\quad\it##\hfil&&\qquad\it##\hfil\cr#1\crcr}}
\def\soloists#1{\centerline{\bf\vbox{\halign{##\hfil\cr#1\crcr}}}}

And

\def\tsaologo{\vbox{\bigtype\bf
\line{\hrulefill}
\kern-.5\baselineskip
\line{\hrulefill\phantom{ THE ST.\,ANFORD ORCHESTRA }\hrulefill}
\kern-.5\baselineskip
\line{\hrulefill\hbox{ THE ST.\,ANFORD ORCHESTRA }\hrulefill}
\kern-.5\baselineskip
\line{\hrulefill\phantom{ R. J. Drofnats, Conductor }\hrulefill}
\kern-.5\baselineskip
\line{\hrulefill\hbox{ R. J. Drofnats, Conductor }\hrulefill}
}}

I've noticed that I can use some of the definitions. For example, I get an error when I try using \tsaologo but \composition{Variations on a Theme by Tchaikovsky} works fine. Also, \centerline command doesn't work, but just \center

share|improve this question

closed as too localized by Lev Bishop, percusse, zeroth, Claudio Fiandrino, Joseph Wright Sep 22 '12 at 19:24

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

5  
The TeXbook is a book about plain TeX. I am not able to rightly comprehend the confusion of ideas that would cause one to think that something intended for plain TeX --- and depending on an external file that doesn't even exist (i.e. "concert.tex") would work unmodified with LaTeX. –  kahen Sep 9 '12 at 17:49
    
@kahen Like I said in my post; completely new at this. I just downloaded the program and started reading the book -- from the end. Some of the things worked so I thought I was on the right path. –  Bakhtiar Kasi Sep 9 '12 at 17:57
add comment

2 Answers 2

up vote 6 down vote accepted

As other have commented, the TeXbook talks about the TeX primitives and also of a possible way to use them at a higher level via a macro package called Plain TeX, which is quite different from LaTeX.

Reading the TeXbook is useful if you want to be more proficient in LaTeX programming. For document creation in LaTeX a good starting point is the "Not so short introduction to LaTeX" which is available in several languages; go to http://texdoc.net and type lshort in the box.

A less hybrid LaTeX form of the same can be as follows

\documentclass[a4paper,12pt]{article}
\usepackage[top=1cm,bottom=3cm]{geometry}
\usepackage{array}

\pagestyle{empty}
\parindent=0pt

\newcommand{\composition}[1]{%
  \par
  {\bfseries
   \begin{tabular}{@{\hspace{1em}}l@{}}
   \hspace*{-1em}#1%
   \end{tabular}%
  }%
  \par
} % use \\ if more than one line
\newcommand{\composer}[1]{\par\makebox[\textwidth][r]{\bfseries#1}\par}
%\def\composer#1{\rightline{\bfseries#1}}
\newcommand{\movements}[1]{%
  \par
  \begin{tabular}{@{\quad}>{\itshape}l@{\qquad}>{\itshape}l@{}}
  #1
  \end{tabular}
  \par
}
\newcommand{\soloists}[1]{%
  \par
  \makebox[\textwidth][c]{\bfseries\begin{tabular}{@{}c@{}}#1\end{tabular}}
  \par
}

\makeatletter
\newcommand{\textflat}{%
  {\if b\expandafter\@car\f@series\@nil\boldmath\fi$\flat$}%
}
\makeatother

\def\tsaologo{\vbox{\Large\bfseries
\hbox to \hsize{\hrulefill}
\kern-.5\baselineskip
\hbox to \hsize{\hrulefill\phantom{ THE ST.\,ANFORD ORCHESTRA }\hrulefill}
\kern-.5\baselineskip
\hbox to \hsize{\hrulefill\hbox{ THE ST.\,ANFORD ORCHESTRA }\hrulefill}
\kern-.5\baselineskip
\hbox to \hsize{\hrulefill\phantom{ R. J. Drofnats, Conductor }\hrulefill}
\kern-.5\baselineskip
\hbox to \hsize{\hrulefill\hbox{ R. J. Drofnats, Conductor }\hrulefill}
}}
\begin{document}

\tsaologo

\medskip

\centerline{Friday, November 19, 1982, 8:00 p.m.}

\bigskip

\centerline{\bfseries PROGRAM}

\medskip

\composition{Variations on a Theme by Tchaikovsky}
\composer{Anton S. Arensky (1861--1906)}
\smallskip
{\small
\movements{Tema: Moderato\\
Var.~I: Un poco pi\`u mosso    & Var.~V: Andante\\
Var.~II: Allegro non troppo    & Var.~VI: Allegro con spirito\\
Var.~III: Andantino tranquillo & Var.~VII: Andante con moto\\
Var.~IV: Vivace&Coda: Moderato}
}

\bigskip

\composition{Concerto for Horn and Hardart, S.\,27}
\composer{P. D. Q. Bach (1807--1742)?}
\smallskip
\movements{Allegro con brillo\\
Tema con variazione \textup{(}su un tema differente\textup{)}\\
Menuetto con panna e zucchero\\}
\medskip
\soloists{Ben Lee User, horn\\
Peter Schickele, hardart}

\bigskip
\centerline{INTERMISSION}
\bigskip

\composition{Symphony No.\,3 in E\textflat\ Major\\
Op.\,55, ``The Eroica''\\}
\composer{Ludwig van Beethoven (1770--1827)}
\smallskip
\movements{Allegro con brio\\
Marcia funebre: Adagio assai\\
Scherzo: Allegro vivace\\
Finale: Allegro molto\\}

\vfill

\footnotesize
Members of the audience are kindly requested to turn off the
alarms on their digital watches, and to cough only between movements.

\newpage

\end{document}

Only the \tsaologo macro has been retained, it's quite hard to produce it with pure LaTeX commands. Of course one could benefit from TikZ for this.

share|improve this answer
add comment

The reason for your problems might be that the original code was written for TeX, not LaTeX. Here's a hybrid solution (still containing most of the TeX code) that works:

enter image description here

\documentclass[12pt]{article}

\def\tsaologo{\vbox{\large\bfseries
  \noindent\hrulefill\par
  \kern-.5\baselineskip
  \noindent\hrulefill\phantom{ THE ST.\,ANFORD ORCHESTRA }\hrulefill\par
  \kern-.5\baselineskip
  \noindent\hrulefill\hbox{ THE ST.\,ANFORD ORCHESTRA }\hrulefill\par
  \kern-.5\baselineskip
  \noindent\hrulefill\phantom{ R.\ J.\ Drofnats, Conductor }\hrulefill\par
  \kern-.5\baselineskip
  \noindent\hrulefill\hbox{ R.\ J.\ Drofnats, Conductor }\hrulefill
}}

\def\composition#1{\halign{\bfseries\quad##\hfil\cr
\kern-1em#1\crcr}} % use \cr's if more than one line
\def\composer#1{\rightline{\bfseries#1}}
\def\movements#1{\halign{\quad\itshape##\hfil&&\qquad\itshape##\hfil\cr#1\crcr}}
\def\soloists#1{\centerline{\bfseries\vbox{\halign{##\hfil\cr#1\crcr}}}}

\begin{document}

%\input concert% Definitions given in preamble
\tsaologo
\medskip
\centerline{Friday, November 19, 1982, 8:00 p.m.}
\bigskip
\centerline{\bfseries PROGRAM}
\medskip
\composition{Variations on a Theme by Tchaikovsky}
\composer{Anton S. Arensky (1861--1906)}
\smallskip
{\normalsize
  \movements{Tema: Moderato\cr
    Var.~I: Un poco pi\`u mosso&Var.~V: Andante\cr
    Var.~II: Allegro non troppo&Var.~VI: Allegro con spirito\cr
    Var.~III: Andantino tranquillo&Var.~VII: Andante con moto\cr
    Var.~IV: Vivace&Coda: Moderato\cr}
}
\bigskip
\composition{Concerto for Horn and Hardart, S.\,27}
\composer{P. D. Q. Bach (1807--1742)?}
\smallskip
\movements{Allegro con brillo\cr
  Tema con variazione $($su un tema differente$)$\cr
  Menuetto con panna e zucchero\cr}
\medskip
\soloists{Ben Lee User, horn\cr
  Peter Schickele, hardart\cr}
\bigskip
\centerline{INTERMISSION}
\bigskip
\composition{Symphony No.\,3 in E$\flat$\ Major\cr
  Op.\,55, ``The Eroica''\cr}
\composer{Ludwig van Beethoven (1770--1827)}
\smallskip
\movements{Allegro con brio\cr
  Marcia funebre: Adagio assai\cr
  Scherzo: Allegro vivace\cr
  Finale: Allegro molto\cr}
\bigskip
\small \noindent
Members of the audience are kindly requested to turn off the
alarms on their digital watches, and to cough only between movements.

\end{document}

Most changes were in terms of font selection. See Does it matter if I use \textit or \it, \bfseries or \bf, etc. and/or Will two-letter font style commands (\bf, \it, …) ever be resurrected in LaTeX?

share|improve this answer
add comment

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