Featured Book

LaTeX Beginners Guide

Who is online

In total there are 15 users online :: 1 registered, 0 hidden and 14 guests (based on users active over the past 5 minutes)
Most users ever online was 1327 on Tue Nov 05, 2013 7:11 pm

Users browsing this forum: Bing [Bot] and 14 guests

Partner Sites

TeXwelt - Fragen und Antworten goLaTeX
TeXblog
TeXnicCenter
TeXample

subfigure

Add tags LaTeX specific issues not fitting into one of the other forums of this category.

subfigure

Postby Sam on Fri Nov 30th, 2007

hello, Sad

I need to subfigure the following

%\begin{figure}[h!]
% \centering
% \includegraphics [width=0.7\textwidth]{delay_20amp_synch_fr4_submap.eps}
% \caption{Typical subspace map for the synchronous actuators motion(Heave)}
% \label{fig:delay_20amp_synch_fr4_submap.eps}
%\end{figure}
%\begin{figure}[h!]
% \centering
% \includegraphics [width=0.7\textwidth]{delay_fr4_cycle.eps}
% \caption{Time domain response of the two actuators being sinusoidally controlled.}
% \label{fig:delay_fr4_cycle.eps}
%\end{figure}

I tried the folowing but did not work

\begin{figure}[h]
\hfill
\begin{minipage}[t]{.45\textwidth}
\begin{center}
\epsfig{file=delay_20amp_synch_fr4_submap.eps, scale=0.25}
\caption{figure 1}
\label{fig-tc}
\end{center}
\end{minipage}
\hfill
\begin{minipage}[t]{.45\textwidth}
\begin{center}
\epsfig{file=delay_fr4_cycle.eps, scale=0.25}
\caption{figure 2}
\label{fig-tc}
\end{center}
\end{minipage}
\hfill
\end{figure}

Any help will be much apprecitaed Cool
Sam
 
Posts: 62
Joined: Fri Nov 30th, 2007

Re: subfigure

Postby localghost on Fri Nov 30th, 2007

You should use the subfig package, which lets you typeset those subfigures in a very comfortable way. Refer to its documentation for more information.
Code: Select all  •  Open in writeLaTeX
\documentclass[12pt,DIV15]{scrartcl}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage[english]{babel}
\usepackage[font=small,labelfont=bf]{caption}
\usepackage[font=footnotesize]{subfig}
\usepackage{graphicx}

\begin{document}
  \section{Short introduction to the \texttt{subfig} package}\label{sec:subfig}
    Figure~\ref{fig:figure} shows how to typeset a figure with two subfigures using the \texttt{subfig} package.

    \begin{figure}[!ht]
      \centering
      \subfloat[Subfigure One\label{subfig-1:figure}]{
        \includegraphics[scale=0.25]{delay_20amp_synch_fr4_submap}
      }
      \subfloat[Subfigure Two\label{subfig-2:figure}]{
        \includegraphics[scale=0.25]{delay_fr4_cycle}
      }
      \caption{A figure with two subfigures}\label{fig:figure}
    \end{figure}

    As you can see, you can easily typeset the Figure~\ref{fig:figure} with the two subfigures \subref*{subfig-1:figure} and \subref*{subfig-2:figure}.
\end{document
}

Don't use the epsfig package! It is obsolete and superseded by the graphicx package. You can omit the endings in the file names. The compiler will find the right files on its own. Avoid the "_" in the file names and paths (even if it works). It is reserverd for subscripts in mathematical mode. The caption package lets you customize the captions of figures and tables.


Best regards an welcome on Board
Thorsten
Last edited by localghost on Fri Nov 30th, 2007, edited 2 times in total.
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 13.1 (Linux 3.11.10), TeX Live 2013 (vanilla), TeXworks 0.5 (r1351)
² Posting stopped indefinitely due to offenses
User avatar
localghost
Site Moderator
 
Posts: 9219
Joined: Fri Feb 2nd, 2007
Location: Braunschweig, Germany

Re: subfigure

Postby Sam on Fri Nov 30th, 2007

Thnaks a lot!

I tried your code but still does not work Confused
Sam
 
Posts: 62
Joined: Fri Nov 30th, 2007

Re: subfigure

Postby localghost on Fri Nov 30th, 2007

Sorry for that. My fault. I missed an "s" in the first line and had a wrong label in the second subfigure. I corrected the code. So, please try again. If it still doesn't work, please give a detailed description of the error by posting the message given by the compiler from the log file.
Last edited by localghost on Fri Nov 30th, 2007, edited 1 time in total.
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 13.1 (Linux 3.11.10), TeX Live 2013 (vanilla), TeXworks 0.5 (r1351)
² Posting stopped indefinitely due to offenses
User avatar
localghost
Site Moderator
 
Posts: 9219
Joined: Fri Feb 2nd, 2007
Location: Braunschweig, Germany

Re: subfigure

Postby Sam on Fri Nov 30th, 2007

GReat Thanks you are very helpful Smile

it did work but HOW can I control the space between the two figures?

also HOW can I Make them exactly lined up?

thx
Last edited by Sam on Fri Nov 30th, 2007, edited 1 time in total.
Sam
 
Posts: 62
Joined: Fri Nov 30th, 2007

Re: subfigure

Postby localghost on Fri Nov 30th, 2007

Just put the right command directly between them.
Code: Select all  •  Open in writeLaTeX
\begin{figure}[!ht]
  \centering
  \subfloat[Subfigure One\label{subfig-1:figure}]{
    \includegraphics[scale=0.25]{delay_20amp_synch_fr4_submap}
  }
  \hspace{5mm}
  \subfloat[Subfigure Two\label{subfig-2:figure}]{
    \includegraphics[scale=0.25]{delay_fr4_cycle}
  }
  \caption{A figure with two subfigures}\label{fig:figure}
\end{figure
}

Sam wrote:also HOW can I Make them exactly lined up?

What do mean with that? They should be vertically aligned to the bottom.
Last edited by localghost on Fri Nov 30th, 2007, edited 1 time in total.
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 13.1 (Linux 3.11.10), TeX Live 2013 (vanilla), TeXworks 0.5 (r1351)
² Posting stopped indefinitely due to offenses
User avatar
localghost
Site Moderator
 
Posts: 9219
Joined: Fri Feb 2nd, 2007
Location: Braunschweig, Germany

Re: subfigure

Postby Sam on Fri Nov 30th, 2007

Thanks but

\hspace{0mm} is for the horizontal distance between the fig right?

It did not make a change...I want the figures to be very close to each other and lined up!

Thx Smile
Sam
 
Posts: 62
Joined: Fri Nov 30th, 2007

Re: subfigure

Postby localghost on Fri Nov 30th, 2007

Just set a negative horizontal space.
Code: Select all  •  Open in writeLaTeX
\hspace{-1mm}

What do you mean with "lined up"? Vertical alignment to the top of both? They should be aligned to their bottoms.
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 13.1 (Linux 3.11.10), TeX Live 2013 (vanilla), TeXworks 0.5 (r1351)
² Posting stopped indefinitely due to offenses
User avatar
localghost
Site Moderator
 
Posts: 9219
Joined: Fri Feb 2nd, 2007
Location: Braunschweig, Germany

Re: subfigure

Postby Sam on Fri Nov 30th, 2007

localghost wrote:Just set a negative horizontal space.
Code: Select all  •  Open in writeLaTeX
\hspace{-1mm}

What do you mean with "lined up"? Vertical alignment to the top of both? They should be aligned to their bottoms.



Thnaks!

I meant lined up both horizontally Smile
Sam
 
Posts: 62
Joined: Fri Nov 30th, 2007

Re: subfigure

Postby Sam on Fri Nov 30th, 2007

Sad they don't line up horizontally!!

How can I sort this out plz Embarassed
Sam
 
Posts: 62
Joined: Fri Nov 30th, 2007

Next

Return to General

Who is online

Users browsing this forum: Bing [Bot] and 14 guests