Is there unresizable space in latex? Pictures in good looking grid.

Posted by drasto on Stack Overflow See other posts from Stack Overflow or by drasto
Published on 2010-04-08T20:23:23Z Indexed on 2010/04/08 21:43 UTC
Read the original article Hit count: 179

Filed under:
|
|
|

I've created latex macro to typeset guitar chords diagrams(using picture environment). Now I want to make diagrams of different appear in good looking grid when typeset one next to each other as the picture shows:

The picture. (on the picture: Labeled "First" bad layout of diagrams, labeled "Second" correct layout when equal number of diagrams in line)

I'm using \hspace to make some skips between diagrams, otherwise they would be too near to each other. As you can see in second case when latex arrange pictures in so that there is same number of them in each line it works. However if there is less pictures in the last line they become "shifted" to the right. I don't want this.

I guess is because latex makes the space between diagrams in first line a little longer for the line to exactly fit the page width. How do I tell latex not to resize spaces created by \hspace ? Or is there any other way ?

I guess I cannot use tables because I don't know how many diagrams will fit in one line...

This is current state of code:

\newcommand{\spaceForChord}{1.7cm}

\newcommnad{\chordChart}[1]{%
  %calculate dimensions xdim and ydim according to setings
  \begin{picture}(xdim, ydim){%
    %draw the diagram inside defined area
  }%
  \hspace*{\spaceForChord}%
  \hspace*{-\xdim}%
}%

%end preambule and begin document
\begin{document}
First:\\*
\\*
\chordChart{...some arguments for to change diagram look...}
\chordChart{...some arguments for to change diagram look...}
\chordChart{...some arguments for to change diagram look...}
\chordChart{...some arguments for to change diagram look...}
\chordChart{...some arguments for to change diagram look...}
%...above line is repeated 12 more times to produce result shown at the picture
\end{document}

Thanks for any help.

© Stack Overflow or respective owner

Related posts about latex

Related posts about macros