现在时间是:
当前位置:首 页 >> Latex & Ctex>> 教学区>> 文章列表

双栏环境中图像、表格显示单栏

作者:   发布时间:2014-10-11 17:27:22   浏览次数:1167

原文地址:http://blog.sina.com.cn/s/blog_4a582a1f0100cyiw.html  

在LATEX中如何实现双栏排版中键入跨栏图形和表格

(2009-04-22 09:32:58)

近日用LATEX写一篇论文,需要在双栏版式中加入跨栏的图形。经多方查找资料,终于发现:原来在begin{figure}中加入*即可,即用begin{figure*}!

现将原文摘下,以备自己或网友查找。

原文:http://cooooldog.ycool.com/post.1777886.html

帅小呆 @ 2007-10-08 10:11


最近碰到的麻烦就是这个, 一直期望有一种完善而且好的方法.

但, 如果连IEEEtran都让步, 我觉得, 自己不让步的机会微乎其微.

下面是一段评论:

from: http://www.electronics.oulu.fi/latex/examples/example_3/index.html

Here we will focus on how to add figures, tables, and equations into your document. Here are the complete source file and results in PDF format:

Figures

To insert a figure in a LaTeX document, you write lines like this:

begin{figure} centering includegraphics[width=3.0in]{imagefile1} caption{Caption for figure} label{fig_sample} end{figure}

The whole block is enclosed between begin{figure} and end{figure}. The command includegraphics does the actual insertion of the image. Here we insert a file named imagefile1.eps (or imagefile1.pdf when using PdfLaTeX). LaTeX assumes a .eps file extension (and PdfLaTeX assumes .pdf). You don't need to write it. You can also specify the width of the image. Give it as a parameter (enclosed in brackets) to the includegraphics command. Acceptable measurement units are for example in, mm, and cm. Also the height of the figure is scaled proportionally so the image doesn't get distorted.

The caption command gives a caption for the figure. We have also added the label which is useful when you want to refer to the equation in your paragraph text (see References). Additionally, we have used a centering command to center the figure in the column.

If you don't yet know how to create EPS images for LaTeX documents, read the Creating figurestutorial.

Subfigures

If you want to divide a figure into many smaller parts, use the subfigure command. First, you have to add this in the beginning of your .tex file:

usepackage{graphicx,subfigure}

You probably already have the graphicx package loaded so add only the word subfigure here.

Let's add three small figures in place of one normal figure. Use the subfigure command:

begin{figure} centering subfigure[First caption] { includegraphics[width=1.0in]{imagefile2} label{fig_firstsub} }   subfigure[Second caption] { includegraphics[width=1.0in]{imagefile2} label{fig_secondsub} } subfigure[Third caption] { includegraphics[width=1.0in]{imagefile2} label{fig_thirdsub} } caption{Common figure caption.} label{fig_subfigures} end{figure}

The result is:

Write as many subfigure commands as you have figures. subfigure takes an argument (enclosed between [ and ]) which specifies the caption for that subfigure. Then put the includegraphics and label commands between { and } of the subfigure. Here we use an image file named imagefile2.eps. We have also specified a width for each image using the optional width parameter of the includegraphics command.

Note the command after the first subfigure. This command creates a line break. In this case, it separates the three subfigures into two rows. Without the all the three subfigures may end up in just one row. You can try the also in other places and see its effect.

In the end, we put one more caption and label. These are for the whole three-part figure element.

Tables

A table in LaTeX may look a bit scary bunch of code at first. But you can copy and paste the basic lines that are needed. Then inserting your own text into the table is a piece of cake. Here we go:

begin{table} renewcommand{arraystretch}{1.3} caption{Simple table} label{table_example} centering begin{tabular}{c|c} hline Heading One & Heading Two  hline hline Three & Four  hline Five & Six  hline end{tabular} end{table}

The result will look like this:

Hence it's a table with two columns and two rows. Here is how you organize the text in a table: Horizontal lines are separated by in the end of line. That is, begins a new row. Then write hline to insert a horizontal line (one or more). Write an & where you want a vertical line.

The number of columns is specified like this: Here we used a line like begin{tabular}{c|c}. The | represents a vertical line and c makes the text of a column centered. Thus, c|c creates two columns with centered text. Text can also be left and right aligned if you use l or r instead of c. More columns can be added by using many | symbols. For example, this produces four columns: l|c|c|c . Now the leftmost column is left-aligned and the others are centered.

You may wonder about the strange line renewcommand{arraystretch}{1.3}. This is needed for adjusting the white space around text in the table cells. The value 1.3 produces quite a pleasing look.

Double column figures and tables

If you are writing a two column document and you would like to insert a wide figure or table that spans the whole page width, use the "starred" versions of the figure and table constructs. Like this: begin{figure*}...end{figure*} or begin{table*}...end{table*}. Write the contents in the usual way. You can use also subfigures inside figure*.

Note that double column figures and tables have some limitations. They can't be placed at the bottom of pages. Additionally, they will not appear on the same page where they are defined. So you have to define them prior to the page on which they should appear.

Equations

Short mathematical expressions can be inserted within paragraph text by putting the math between $ and $. For example:

... angle frequency $omega = 2pi f$ ...

This is called an inline equation. The result is: .

In equations the normal text symbols are written as such, for example 2 and f. Greek symbols are named for example alpha, beta and so on. You don't need to remember these because in WinEdt (and TeXnicCenter) you can use the symbol toolbar which has buttons for all the Greek letters and other math symbols.

Numbered equations are separate from paragraph text and they are automatically numbered. The contents of the equation are written using the same ideas as inline equations but now we write begin{equation} and end{equation} instead of $s.

begin{equation} label{capacitor_impedance} X_{C} = frac{ 1 }{ omega C } end{equation}

The result is:

Here we learn another structure which is often used in equations: the frac command inserts a fraction whose numerator and denominator are enclosed in braces.








上一篇:没有了    下一篇:没有了

Copyright ©2019    计算数学达人 All Right Reserved.

技术支持:自助建站 | 领地网站建设 |短信接口 |燕窝 版权所有 © 2005-2019 lingw.net.粤ICP备16125321号 -5