【发布时间】:2010-04-08 20:23:23
【问题描述】:
我创建了 Latex 宏来排版吉他和弦图(使用图片环境)。 现在我想让不同的图表在排版时出现在好看的网格中,如图所示:
The picture. (上图:标记为“第一”的图表布局错误,标记为“第二”正确的布局,当图表数量相等时)
我正在使用 \hspace 在图表之间进行一些跳过,否则它们会彼此太靠近。正如您在第二种情况下看到的那样,当乳胶排列图片时,每行中的图片数量相同。但是,如果最后一行中的图片较少,它们就会“向右移动”。我不想要这个。
我猜是因为乳胶使第一行图表之间的空间稍长一些,以使该行完全适合页面宽度。如何告诉乳胶不要调整 \hspace 创建的空间?或者还有其他方法吗?
我想我不能使用表格,因为我不知道一行可以容纳多少张图表...
这是代码的当前状态:
\newcommand{\spaceForChord}{1.7cm}
\newcommnad{\chordChart}[1]{%
%calculate dimensions xdim and ydim according to settings
\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 to change diagram look...}
\chordChart{...some arguments to change diagram look...}
\chordChart{...some arguments to change diagram look...}
\chordChart{...some arguments to change diagram look...}
\chordChart{...some arguments to change diagram look...}
%...above line is repeated 12 more times to produce result shown at the picture
\end{document}
感谢您的帮助。
【问题讨论】:
-
我添加了一些代码。如果还不够,请要求更多。