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.

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:

C Major

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?

share|improve this question
    
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
add comment

1 Answer 1

up vote 4 down vote accepted

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}

output of code

share|improve this answer
    
Thanks Alan! I had no idea of that. Cheers! =) –  Paulo Cereda Jul 4 '11 at 17:56
1  
@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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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