【问题标题】:Is there unresizable space in latex? Pictures in good looking grid乳胶中有不可调整的空间吗?漂亮的网格中的图片
【发布时间】: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}

感谢您的帮助。

【问题讨论】:

  • 我添加了一些代码。如果还不够,请要求更多。

标签: latex macros image chord


【解决方案1】:

很长一段时间,因为我无法轻松重现您的情况:将 flushleft 环境包裹在您的 \chordCart 周围会有所帮助吗?

即,

First:\\*
\begin{flushleft}
\chordChart{...some arguments to change diagram look...}
...
\end{flushleft}

Second:\\*

如果您的假设是正确的,并且 LaTeX 确实在尝试拉伸空格以对齐行,那么上面应该通过关闭右侧的对齐来解决您的问题。

【讨论】:

  • 非常感谢,问题解决了。这很简单,但我没有想到。抱歉这个愚蠢的问题......现在还有一个问题:我如何标记这个问题已回答? :)
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2021-07-05
  • 2012-06-08
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-10-25
  • 1970-01-01
相关资源
最近更新 更多