收藏 分享(赏)

latex并列图.doc

上传人:kpmy5893 文档编号:7328769 上传时间:2019-05-15 格式:DOC 页数:7 大小:80KB
下载 相关 举报
latex并列图.doc_第1页
第1页 / 共7页
latex并列图.doc_第2页
第2页 / 共7页
latex并列图.doc_第3页
第3页 / 共7页
latex并列图.doc_第4页
第4页 / 共7页
latex并列图.doc_第5页
第5页 / 共7页
点击查看更多>>
资源描述

1、27.3 并列的子图形 在某些情况下,有时会希望将并列的图形组成一组,而其中的每一幅图 都保持其独立性。 paisubfigure 宏包的 subfigure 命令将这一 组做为一幅图形,其中的每一幅图做为子图形。例如: beginfigure centering subfigureSmall Box with a Long Caption labelfig:subfig:a % label for first subfigure includegraphicswidth=1.0ingraphic.eps hspace1in subfigureBig Box labelfig:subfig:b

2、 % label for second subfigure includegraphicswidth=1.5ingraphic.eps captionTwo Subfigures labelfig:subfig % label for entire figure endfigure生成图 27.9。这里使用 LATEX 的引用命令 reffig:subfig:a 会得到27.9(a), reffig:subfig:b 得到 27.9(b), reffig:subfig 得到27.9。 像其它的并列图形一样,子图也可以在小页环境中使用。而且在一些情况下, 这样做还能更方便的得到理想的图形间距。例

3、如: beginfigure subfigureSmall Box with a Long Caption labelfig:mini:subfig:a % label for first subfigure beginminipageb0.5textwidth centering includegraphicswidth=1ingraphic.eps endminipage% subfigureBig Box labelfig:mini:subfig:b % label for second subfigure beginminipageb0.5textwidth centering inc

4、ludegraphicswidth=1.5ingraphic.eps endminipage captionMinipages Inside Subfigures labelfig:mini:subfig % label for entire figure endfigure得到图 27.10,其中包括两个子图 27.10(a) 和 27.10(b)。 图 27.10 中的子图标题比图 27.9 中的要宽一些。 这是因为子图标题的宽度和子图的宽度相同,图 27.9 中的子图 只包含图形,而图 27.10 中的子图包含了宽度为 0.5textwidth 的小页。 子图的标记有两种形式: 1. 一

5、种是出现在子图的下面作为标题的一部分。这通过命令thesubfigure 来生成。 2. 另一种是在使用 ref 命令的时候出现。这通过将命令 psubfigure 的输出处理后传递给 thesubfigure 命令来生成。 上面的这些命令使用 subfigure 计数器和 thefigure 命令。 子图的标记的格式由下面的命令来控制。 命令 thefigure 印出当前图形的编号。 计数器 subfigure 记录子图的编号,命令 alphsubfigure 将计数器 subfigure 的值用小写字母印出,而 命令 romansubfigure 则是用小写罗马数字印出(有关印出 计数器值

6、的命令可参见文献 1, 第 98页 和 3, 第 446 页。)。 命令 thesubfigure 缺省使用小写字母,如 (a),(b) 等。 命令 thesubfigure 缺省为 thesubfigurespace,即在 标题标记和文本之间加上一个空白。 命令 psubfigure 缺省为 thefigure。 如果改变子图标题的标记,字体等的缺省值,可参见文献 10。下面 给出几个简单的例子: 若想让子图标题标记使用小写罗马数字如 (i), (ii)等, ref 命令的结果 如 12i, 12ii 等,可使用下面的命令(最好放在导言区中) renewcommandthesubfigure

7、romansubfigure makeatletter renewcommandthesubfigure(thesubfigure)space renewcommandpsubfigurethefigure makeatother 若想让子图标题标记使用阿拉伯数字如 12.1:, 12.2: 等, ref 命令的结果 如 12.1, 12.2 等,可使用下面的命令 renewcommandthesubfigure% thefigure.arabicsubfigure makeatletter renewcommandthesubfigurethesubfigure:space renewcom

8、mandpsubfigure makeatother缺省情况下,用 listoffigures 命令生成的图形目录中只包括图形, 而不包括子图。要想在图形目录中包括子图,要在 listoffigures 命令前加上setcounterlofdepth2。 需要说明的是,由于 L ATEX 的变化,导致目前版本( 3/95) 的 subfigure 宏包在图形目录的子图输入项开始部分都加上 numberline1。将下面的代码加到导言区中就可以解决这一问题。 makeatletter renewcommandsubcaption2% begingroup letlabelgobble defpr

9、otectstringstringstring% xdefsubfigcaptionlist% subfigcaptionlist,% numberline currentlabel% noexpandignorespaces #2% endgroup nameusemake#1captionnameusethe#1#2 makeatother27.2 并列的浮动图形 在上一节中,通过在一个图形环境中使用多个小页环境从而得到一个由 多幅图形组成的浮动图形。若将 caption 命令放到每个小页环境 中,则每个小页环境就生成一浮动图形。例如: beginfigure beginminipaget

10、0.5linewidth centering includegraphicswidth=1ingraphic.eps captionSmall Box labelfig:side:a endminipage% beginminipaget0.5linewidth centering includegraphicswidth=1.5ingraphic.eps captionBig Box labelfig:side:b endminipage endfigure生成图 27.3 和 27.4。尽管上面的命令 只使用了一个 figure 环境,但由于每个小页中都包含一 个 caption 命令,所

11、以仍然得到两个浮动图形。 在图 27.3 和 27.4 中,并列的小页环境使用了 t 选项,使得两幅图形的基线对齐。这对于非旋转的图形 没有任何问题,而且使得两标题的顶部对齐。不过,如果图形的底部 不对齐的话(如其中一图形被旋转),就会发生问题。例如: beginfigure centering beginminipaget.33textwidth centering includegraphicswidth=2cmgraphic.eps captionBox with a Long Caption endminipage% beginminipaget.33textwidth centeri

12、ng includegraphicswidth=2cm,angle=-30graphic.eps captionRotated Box endminipage% endfigure生成图 27.5 和 27.6,我们可以看到这里 两幅图形的标题并不对齐。而若只使用小页的 b 选项,会使得标题 的最后一行对齐,并不能解决问题。 一种解决办法是在小页环境中把图形和标题分开放到两行中:第一行放置图形,第二行放置标题。例如: beginfigure centering beginminipageb.33textwidth centering includegraphicswidth=2cmgraphi

13、c.eps endminipage% beginminipageb.33textwidth centering includegraphicswidth=2cm,angle=-30graphic.eps endminipage-10pt beginminipaget.33textwidth captionBox with a Long Caption endminipage% beginminipaget.33textwidth captionRotated Box endminipage% endfigure生成的图 27.7 和 27.8 中,图形的基 线和标题的第一行分别对齐。 在这个例

14、子中,需要注意: 在最后一幅图后面用 来断行, 的参数项 -10pt 使得图形与标题之间的距离比当前行距 减少 10pt。这样做是让图形和标题更接近些,用户也可 自己选用合适的值。 包含图形的小页使用 b 选项,使得它们的参考点为 其最后一行的基线。 包含标题小页使用 t 选项,使得它们的参考点为 其第一行的基线。 任何一个 label 命令都必须和它相应的 caption 命令在同一个小页中。 Wang Lei 2000-04-15 latex 的 subfigure 排版并排放置的两张图Posted on 2007-10-23 by LaTeX 插图始终是件麻烦的事情, 这里介绍了如何 在

15、 LaTeX 文档中插入图片, 但有时还是不能满足某些特殊要求. 前面介绍了 使用 Latex 的 subfigure 竖排图形, 这是介绍使用 latex 的 subfigure 排版并排放置的两张图.注意要使用宏包usepackagegraphicx和usepackagesubfigureCODEbeginfigurebeginminipaget0.5linewidthcenteringincludegraphicswidth=2.2infig1.epscaptionfig1labelfig:side:aendminipage%beginminipaget0.5linewidthcente

16、ringincludegraphicswidth=2.2infig2.epscaptionfig2labelfig:side:bendminipageendfigure还有一种方法:在某些情况下,有时会希望将并列的图形组成一组,而其中的每一幅图 都保持其独立性。 paisubfigure 宏包的 subfigure 命令将这一 组做为一幅图形,其中的每一幅图做为子图形。例如:codebeginfigurecenteringsubfigureSmall Box with a Long Captionlabelfig:subfig:a % label for first subfigureincludegraphicswidth=1.0ingraphic.epshspace1insubfigureBig Boxlabelfig:subfig:b % label for second subfigureincludegraphicswidth=1.5ingraphic.epscaptionTwo Subfigureslabelfig:subfig % label for entire figureendfigure

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 企业管理 > 管理学资料

本站链接:文库   一言   我酷   合作


客服QQ:2549714901微博号:道客多多官方知乎号:道客多多

经营许可证编号: 粤ICP备2021046453号世界地图

道客多多©版权所有2020-2025营业执照举报