显示标签为“Latex”的博文。显示所有博文
显示标签为“Latex”的博文。显示所有博文

10/12/2006

Latex: How to place a float and subfloat item on more than one page

When preparing our paper(which is intended to submit to an IEEE
journal) rencent days, we faced a problem about how to place a figure
which has many subfigures, saying more than eight subfigures into two
sequential pages without break it into two smaller figures, that is to
keep continuous subfigure labels, (a), (b), ..., (p)... Or you want to
put one single float or subfloat item in multiple sections.

I would like the share the solutions which is provided by the
maintainer of the "subfigure" package Dr. Steven Douglas COCHRAN from
Carnegie Mellon University. It's very kind of him, and we thanks a lot
for such a detailed answer.


The answer is quoted as follows:


Yes, this can be done in several ways. First, with the 'subfigure'
package, you can either include the additional package 'captcont' which
provides this service at both the float (figure, table, etc.) level and
the subfloat (subfigure, subtable, etc) level. The other way is to
tweak the figure/subfigure and/or table/subtable counters to achieve the
same effect. The newer 'subfig' package (which replaces the older and
deprecated 'subfigure' package) has an easier method, which requires
only adding the line "\ContinuedFloat" to the surrounding float environment.

However, below are shown the two methods using the 'subfigure' package,
first with the 'captcont' package and then again without it. (More
examples are shown in the documentation of the 'captcont' package, which
is available from CTAN, or from my website http://www.cs.cmu.edu/~sdc
<http://www.cs.cmu.edu/%7Esdc>.

> \documentclass{article}
>
> \usepackage{subfigure}
> \setcounter{lofdepth}{2}
> \usepackage{captcont}
> \def\figbox#1{%
> \fbox{\hbox to 2in{%
> \vbox to 1.5in{%
> \vfil
> \hbox to 2in{%
> \hfil
> #1
> \hfil}%
> \vfil}}}}
> \begin{document}
> \listoffigures
> \newpage
>
> \section{Example One: Using the {\tt captcont} Package.}
>
> The first figure~\ref{fig:oneI} has four subfigure in its
> first section and four in the continued section. Note the
> use of the ``$\backslash$captcont'' command in the first
> section of the figure and the ``$\backslash$caption*''
> command in the second.
>
> \begin{figure}
> \subfigure[This is subfigure one.]{%
> \label{fig:oneA}%
> \figbox{One}}
> \qquad
> \subfigure[This is subfigure two.]{%
> \label{fig:oneB}%
> \figbox{Two}}\\
> %
> \subfigure[This is subfigure three.]{%
> \label{fig:oneC}%
> \figbox{Three}}
> \qquad
> \subfigure[This is subfigure four.]{%
> \label{fig:oneD}%
> \figbox{Four}}\\
> \captcont{This is the First Figure.}
> \label{fig:oneI}
> \end{figure}
>
> \begin{figure}
> \subfigure[This is subfigure five.]{%
> \label{fig:oneE}%
> \figbox{Five}}
> \qquad
> \subfigure[This is subfigure six.]{%
> \label{fig:oneF}%
> \figbox{Six}}\\
> %
> \subfigure[This is subfigure seven.]{%
> \label{fig:oneG}%
> \figbox{Seven}}
> \qquad
> \subfigure[This is subfigure eight.]{%
> \label{fig:oneH}%
> \figbox{Eight}}\\
> \caption*{This is the First Figure (cont).}
> \label{fig:oneII}
> \end{figure}
>
> \section{Example Two: Without the {\tt captcont} Package.}
>
> The second figure~\ref{fig:twoI} also has four subfigure in
> its first section and four in the continued section. Note,
> however, that at the begining of the second section of the
> second figure, the {\tt figure} and the {\tt subfigure}
> counters are adjusted. Also, when not using the 'captcont'
> command, the second section caption shows up in the
> list-of-figures. This can be {\it fixed} by not using
> the ``$\backslash$caption'' command and faking the caption
> under the second section of the second figure using
> something like:
>
> $\backslash$centerline\{\{Figure\space$\backslash$fig\{twoI\}:
> This is the Second Figure (cont).\}\}
>
>
> \begin{figure}
> \subfigure[This is subfigure one.]{%
> \label{fig:twoA}%
> \figbox{One}}
> \qquad
> \subfigure[This is subfigure two.]{%
> \label{fig:twoB}%
> \figbox{Two}}\\
> %
> \subfigure[This is subfigure three.]{%
> \label{fig:twoC}%
> \figbox{Three}}
> \qquad
> \subfigure[This is subfigure four.]{%
> \label{fig:twoD}%
> \figbox{Four}}\\
> \caption{This is the Second Figure.}
> \label{fig:twoI}
> \end{figure}
>
> \begin{figure}
> \addtocounter{figure}{-1}
> \setcounter{subfigure}{4}
> \subfigure[This is subfigure five.]{%
> \label{fig:twoE}%
> \figbox{Five}}
> \qquad
> \subfigure[This is subfigure six.]{%
> \label{fig:twoF}%
> \figbox{Six}}\\
> %
> \subfigure[This is subfigure seven.]{%
> \label{fig:twoG}%
> \figbox{Seven}}
> \qquad
> \subfigure[This is subfigure eight.]{%
> \label{fig:twoH}%
> \figbox{Eight}}\\
> \center
> \caption{This is the Second Figure (cont).}
> \label{fig:twoII}
> \end{figure}
>
>\end{document}

9/08/2006

How to solve the margin problem using LaTeX

If you have ever compile a paper using LaTeX, especially for IEEE and ACM. You must have found the the margin to the bottom of the A4 paper is larger than those published papers found in ieeexplore or ACM portal. You may use the following commands to prevent it.

\oddsidemargin -0.25in
\evensidemargin -0.25in
\textwidth 6.75in
\topmargin -0.75in
\textheight =10.0in
This piece of code was tested on ACM and IEEE latex package for Proceedings and Journal.

Thanks to Satish Prabu for such a huge help :-)

haha~~ ACM's brain-damaged and ugly proceedings package

由于要投稿的缘故,第一次认真的看了ACM latex template for proceedings. 排出来的版面真可以用Ugly来形容,而且有一个超级要命的规定:文章开头只能署名三个作者,其他的作者必须以Additional Author的身份,放在文章的Reference前面。这是为什么呢?简直让人不可思议。后来才发现其实是可以再加一个作者的,不过那就out of A4 paper range啦!这还不说,ACM必须要作者提供完整的TeX源代码,而且必须使用Unedited的ACM原始的cls文件…… 恶心……

所以就在琢磨有没有更好的方法来解决这个问题 ,无意间Google到一个好东东,看了文件头上的注释,笑死我了:
% -----------------------------*- LaTeX -*------------------------------
%
% fixacm.sty -- Fix ACM's brain-damaged and ugly proceedings package
%
% Jeff Erickson (jeffe@cs.uiuc.edu)
% Last modified 03 Apr 2006
% Latest version at http://www.cs.uiuc.edu/~jeffe/pubs/tex/fixacm.sty
%
% This is free; caveat emptor! Comments welcome.
%
% ----------------------------------------------------------------------
%
% ACM, in its infinite wisdom, has decided TO CLAIM THAT it wants
% TeX source for its papers, and requires authors to use an
% uneditable document class file. The results of using this class file
% are ugly. Embarassingly ugly. In short, ACM designed an ugly
% Microsoft Word template and then hacked some LaTeX -- badly --
% to produce approximately the same results. The style is poorly
% designed, and the design is poorly implemented -- the
% implementation is both buggy and inelegant. Seeing code this
% awful does not inspire much faith in the premiere society for
% computing professionals.
%
% This package tries to counter most of ACM's horrible decisions,
% without being so different that they actually notice.
哈哈哈哈!果然是UIUC的大牛啊:-D 所以大家以后投ACM都要use这个package哦:-) 下载的地址:http://compgeom.cs.uiuc.edu/~jeffe/pubs/tex/fixacm.sty