6

I wish to do in LaTeX what I did in mathjax here in a very lousy way:

$$A$$
$$B \qquad B$$
$$R \qquad R \qquad R $$
$$A\qquad A \qquad A \qquad A $$
$$C\qquad C\qquad C\qquad C\qquad C$$
$$A\qquad A \qquad A \qquad A \qquad A\qquad A$$
$$D\qquad D\qquad D\qquad D\qquad D$$
$$A\qquad A \qquad A \qquad A $$
$$B \qquad B \qquad B $$
$$R \qquad R$$
$$A$$

enter image description here

11

One option would be to use the gather* environment from amsmath:

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{gather*}
  A \\
  B \qquad B \\
  R \qquad R \qquad R \\ 
  A\qquad A \qquad A \qquad A \\ 
  C\qquad C\qquad C\qquad C\qquad C \\
  A\qquad A \qquad A \qquad A \qquad A\qquad A \\
  D\qquad D\qquad D\qquad D\qquad D \\
  A\qquad A \qquad A \qquad A \\
  B \qquad B \qquad B \\
  R \qquad R \\
  A
\end{gather*}

\begin{gather*}
  A \\
  B \quad B \\
  R \quad R \quad R \\ 
  A\quad A \quad A \quad A \\ 
  C\quad C\quad C\quad C\quad C \\
  A\quad A \quad A \quad A \quad A\quad A \\
  D\quad D\quad D\quad D\quad D \\
  A\quad A \quad A \quad A \\
  B \quad B \quad B \\
  R \quad R \\
  A
\end{gather*}

\end{document}

EDIT: a simple TikZ approach:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{matrix}

\begin{document}

\begin{tikzpicture}
\matrix[matrix of math nodes,column sep=0pt,inner sep=0pt,row sep=10pt]
{
  &&&&& A \\
  &&&& B && B \\
  &&& R && R && R \\ 
  && A && A && A && A \\ 
  & C && C && C && C && C \\
  A && A && A && A && A && A \\
  & D && D && D && D && D \\
  && A && A && A && A \\ 
  &&& B && B && B \\ 
  &&&& R && R \\
  &&&&& A \\
};
\end{tikzpicture}

\end{document}

EDIT2: a more "pintoresque" design using TikZ:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{positioning,shadows,backgrounds}

\begin{document}
\centering

\begin{tikzpicture}[x=13mm,y=9mm]
  \tikzset{every node/.style={
    minimum height=5mm,
    inner sep=.7mm,
    text width=10mm,
    align=center,
    font=\small\bfseries\sffamily,
    text=olive!50!black,
    draw=olive,
    top color=olive!5,
    bottom color=olive!40,
    rounded corners=2.3mm,
    drop shadow={fill=olive!40!gray,fill opacity=.8}}
}
  \foreach \row/\letterT/\letterB in {0/A/A,1/B/R,2/R/B,3/A/A,4/C/D,5/A} {
    \foreach \col in {0,...,\row} {
        \coordinate (pos) at (-\row/2+\col,-\row);
        \node at (pos) {\letterT};
        \coordinate (posB) at (-\row/2+\col,\row-10); % use: \row-2 times the max. value for \row
        \node at (posB) {\letterB};
    }
  }
\end{tikzpicture}

\end{document}

2
  • @doncherry: thank you for re-uploading the images! Sep 8 '11 at 0:00
  • You're very welcome. I'm always curious what the solutions look like so it's really just to satisfy my nosiness :)
    – doncherry
    Sep 8 '11 at 0:02
6

Put it into a center environment without math

\documentclass{article}
\begin{document}
\begin{center}
A\\
B B\\
R R R\\ 
A A A A\\
C C C C C\\
A A A A A A\\
D D D D D\\
A A A A\\ 
B B B\\ 
R R\\
A
\end{center}

\begin{center}\fontdimen2\font=12pt
A\\
B B\\
R R R\\ 
A A A A\\
C C C C C\\
A A A A A A\\
D D D D D\\
A A A A\\ 
B B B\\ 
R R\\
A
\end{center}

\end{document}

enter image description here

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.