# Creating a tabular with guitar tablature diagrams

Friends, I'm using the songs package to write a songbook. Besides the lyrics part, there's also a command to create guitar tablature diagrams:

\gtab{C}{X32010}


which will produce this diagram:

Now, I have the following code:

\documentclass{article}

\usepackage[lyric]{songs}

\begin{document}

\gtab{C}{X32010}

\gtab{D}{XX0232}

\gtab{E}{022100}

\gtab{F}{XX3211}

\end{document}


I'd like to put these diagrams side by side, like in a 2x2 tabular. Unfortunately, I couldn't manage to do it.

I suspect that the \gtab command forces a new line or something and breaks the tabular environment.

There are other packages on guitar tablatures, like songbook or gchords. But since I'm already using a package which has this feature, I'd like to stick with it.

Any ideas on how I could fix this?

-
Have you tried with the gtab command inside a minipage? –  YuppieNetworking Jul 4 '11 at 16:30
@YuppieNetworking: I tried, but I had no luck on using it. TBH, I was relying on minipage to save my code. =) –  Paulo Cereda Jul 4 '11 at 16:38

## 1 Answer

Just enclose them in braces:

\documentclass{article}
\usepackage[lyric]{songs}
\begin{document}
\begin{tabular}{cc}
{\gtab{C}{X32010}} &
{\gtab{D}{XX0232}}\\
{\gtab{E}{022100}} &
{\gtab{F}{XX3211}}
\end{tabular}
\end{document}


-
Thanks Alan! I had no idea of that. Cheers! =) –  Paulo Cereda Jul 4 '11 at 17:56
@Paulo Braces are often a way out of these kinds of things, since they effectively limit whatever changes a macro is doing to within the braces. –  Alan Munn Jul 4 '11 at 18:11
I was really unaware of, I always thought the "additional braces" wouldn't make a difference. Thanks for the great explanation! =) –  Paulo Cereda Jul 4 '11 at 18:20