\documentclass[11pt]{article} %--------------- Various Style Declarations ---------------------------- \textheight 9.00in \textwidth 6.30in \oddsidemargin 0.00in \evensidemargin 0.00in \topmargin -0.75in %************************************************************************ % * % End of preamble and beginning of text. * % * %************************************************************************ \begin{document} \newcommand{\guffwidth}{p{4in}} % guffwidth controls the width of the 3 items at the bottom \newcommand{\keletable}[6]{\begin{center} \begin{tabular}{*{2}{c}*{4}{p{1in}}} % heading is the first variable \multicolumn{6}{c}{\Large\bf{ #1 }} \\[0.1in] % commence \multicolumn{6}{c}{\small\sf{ #2 }} \\[0.02in] % \hline {\bf{Step}} & {\bf{Count}} & \multicolumn{1}{c}{\bf{Legs \& Feet}} & %% NB \& is the & character \multicolumn{1}{c}{\bf{Leads \& Holds}} & \multicolumn{1}{c}{\bf{Relationship }} & \multicolumn{1}{c}{\bf{Quick Reference}} \\ \hline % main body of table #3 \hline \multicolumn{6}{\guffwidth}{ #4 } \\ \multicolumn{6}{\guffwidth}{\footnotesize{#5}} \\ \multicolumn{6}{\guffwidth}{ #6 } \\ \end{tabular} \end{center}} % % END OF KELETABLE defn % % this makes 3a4 , etc \newcommand{\aaa}[2]{#1{$\,$}a{$\,$}#2} % % % Two possible fraction definitions - \vfrac{1}{2} or \dfrac{1}{2} \newcommand{\vfrac}[2]{$\textstyle\frac{#1}{#2}$} \newcommand{\dfrac}[2]{\mbox{\makebox[0mm][l]{\raisebox{3pt}{\footnotesize{#1}}}% \hspace{1.2mm}{\raisebox{2pt}{\small{/}}}\hspace{-0.85mm}% {{\footnotesize{#2}}}}} \newcommand{\quarter}{\dfrac{1}{4}} \newcommand{\half}{\dfrac{1}{2}} \noindent \keletable{ Send Out } { Commence in closed hold } { 1 & 1 & LF back & & & Rock step \\ 2 & 2 & RF replace & Leader moves R hand to center of follower's back \\ 3-5 & \aaa{3}{4} & Triples Step in place LRL & & Turning up to \quarter L & Triple step in place \\ 6-8 & \aaa{5}{6} & Triple Step in place RLR & \\ } % 4th variable { % leave a blank line to start a new paragraph End in open hold. Shout Ol\'e! } % 5th variable { 5th variable, just for David! } % 6 { {\sf Notes:} % a list \begin{itemize} \item Leader may send blah \item Follower may dance Twists \item {\em Hook styling!} \item {\sc whole discussion on embellishment}. \end{itemize} } \newpage \begin{center} \Large\textbf{On the phase transition at the end of the universe} \end{center} \section{Introduction} This is some text in a paragraph. This is some text in a paragraph. This is some text in a paragraph. Some more text in another paragraph. Some more text in another paragraph. Some more text in another paragraph. \begin{center} \begin{tabular}{lcc} \hline relativistic mass & $m$ & $M$ \\ rest mass & $m_0$ & $M$ \\ speed & $v$ & $LT^{-1}$ \\ speed of light & $c$ & $LT^{-1}$ \\ \hline & 4 & only 2 constraints \\ \hline \end{tabular} \end{center} \begin{raggedright} \begin{tabular}{lcc} \hline mass & $m$ & $M$ \\ speed & $v$ & $LT^{-1}$ \\ kinetic energy & $T$ & $ML^2T^{-2}$ \\ \hline & 3 & only 2 constraints \\ \hline \end{tabular} \end{raggedright} Tables can also appear \begin{tabular}{*{4}{p{1.2in}}} \hline while I was going to the fair & I met a man who wasn't there & he wasn't there again today & I wish i wish he'd go away \\ thank you very much & you've been a great audience \\ \hline \end{tabular} like words in the middle of a sentence. \subsection{newcommands} You can define macros -- `newcommands' -- at any point you wish. I recommend defining them all up top of the document. {\bf I also recommend writing the thing you are trying to create longhand, first, beacuse it is easier to debug that way.} Commands can be simple definitions like {\tt{flipflop}} (see the source file). \newcommand{\flipflop}{FliPflOp$^{\rm TM}$} \newcommand{\usualreminder}{(see the source file)} I can use the command \flipflop\ all over the document, for example at the end of a sentence \flipflop. If I want to ensure there is a space after the command \flipflop\ I use a backslash-space \usualreminder. If on the other hand I just say \flipflop then the output of the command {\tt{flipflop}} is run up against the next word. \subsubsection{newcommands with variables} To make a macro with `variables', the syntax is as shown in the source file. \newcommand{\duration}[2]{from #1 to #2} The game lasted \duration{yesterday}{2080}, and the commentary lasted \duration{BC}{AD}. The next example makes a table with four columns. Too simple an example really, there is little point in using a macro for this. \newcommand{\favouritetable}[1]{\begin{tabular}{*{4}{p{1.2in}}} \hline #1 \hline \end{tabular}} Let us use the macro: %% whenever a line begins with '%' it is a comment line \favouritetable{ while I was going to the fair & I met a man who wasn't there & he wasn't there again today & I wish i wish he'd go away \\ thank you very much & you've been a great audience \\ } %% note, this ``}'' is the end of the favouritetable The next example includes a silly separator, defined by this object \verb+@{...}+. \newcommand{\headedtable}[2]{\begin{tabular}{*{4}{p{1.2in}@{$\rightarrow$}}} % heading is the first variable \hline \multicolumn{4}{c}{\bf{ #1 }} \\ \hline #2 \hline \end{tabular}} \headedtable{ Silly poem }{ while I was going to the fair & I met a man who wasn't there & he wasn't there again today & I wish i wish he'd go away \\ thank you very much & you've been a great audience \\ } \renewcommand{\headedtable}[2]{\begin{tabular}{*{4}{p{1.2in}@{\hspace{2mm}}}} % heading is the first variable \hline \multicolumn{4}{c}{\bf{ #1 }} \\ \hline #2 \hline \end{tabular}} Another use of modified macro: \noindent \headedtable{ Silly poemII }{ while I was going to the fair fair & I met a man who wasn't there there & he wasn't there again today today & I wish i wish he'd go away away \\ thank you very much & you've been a great audience \\ } {\dfrac{1}{4}} or {\vfrac{1}{2}}, {\vfrac{1}{4}} or {\dfrac{1}{2}}? \end{document}