您的位置:首页 > 编程语言 > PHP开发

Latex's subfigure

2010-08-16 12:25 603 查看
Tried so hard to merge several figures into one, as required by a reviewer. This should be a easy task if all the figures I wanted to merge together are pictures. I could just follow the easy one shown in wiki:

%-----------------------------------

/usepackage{subfig}

/begin{figure}

  /centering

  /subfloat[A gull]{/label{fig:gull}/includegraphics[width=0.3/textwidth]{gull.eps}}

  /subfloat[A tiger]{/label{fig:tiger}/includegraphics[width=0.3/textwidth]{tiger.eps}}

  /subfloat[A mouse]{/label{fig:mouse}/includegraphics[width=0.3/textwidth]{mouse.eps}}

  /caption{Pictures of animals}

  /label{fig:animals}

/end{figure}

%-----------------------------------

However, it is not the case.

First, the paper's latex template seems to have a conflict with the package "subfig". If I add it, then there will be tens of errors.  So I have to use the obsolete package "subfigure".

Second, I have to merge two proof trees and a .eps picture together. I first planned to use package "subfig" and use command "/subfloat" to hold not only the picture but also the proof tree, which is text. I failed, as the proof tree made the TeXnicCenter run forever. Then I started to think to use some box to enclose the proof tree. I tried "/minipage" and it stopped endless loop!

Another thing I want to talk is, I have ever used "/hbox" to enclose a picture to make it move horizontally left or right side a bit through "/hspace". Then if I directly put this "/hbox" enclosed picture into "/minipage", then the subfigure's caption cannot center and its position always change as I resized the picture. It took me so long time to figure out what to do -- I just removed the "/hbox" and put the picture directly into "/minipage", in which I used "/hspace" directly also to addjust the horizontal postion of the picture.

One example is as this, where "prooftree" is predefined already:

%-----------------------------------

/usepackag{subfigure}

/begin{figure}

  /subfigure[]{

        /begin{minipage}{1/linewidth}

            /begin{prooftree}

            /AxiomC{$D /rightarrow B$}

            /AxiomC{$A /rightarrow D$}

            /AxiomC{$A$}

            /BinaryInfC{$D$}

            /BinaryInfC{$B$}

            /end{prooftree}

            /label{fig:proofsB_s2}

        /end{minipage}

    }

    /subfigure[]{

          /begin{minipage}{1/linewidth}

              /vspace{-2.1in}

              /hspace{-0.75in}

                /includegraphics [width=1.4/textwidth]{output_s2.eps}

                /vspace{-2.3in}           

            /label{fig:output_s2}

            /end{minipage}

  }

  /caption{Scenario two: /subref{fig:proofsB_s2} Another natural deduction proofs of B and /subref{fig:output_s2} The output of the model composition}

  /label{fig:s2}

/end{figure}

%-----------------------------------

Note that, I have also used "/subref" in the caption part of the figure. Also, I did not use any centering command. It seems to be centered well already.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息