Featured Book

LaTeX Beginners Guide

Who is online

In total there are 7 users online :: 0 registered, 0 hidden and 7 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: No registered users and 7 guests

Partner Sites

TeXwelt - Fragen und Antworten goLaTeX
TeXblog
TeXnicCenter
TeXample

Figures Side by Side extended into Margin

Add tags Information and discussion about graphics, figures & tables in LaTeX documents.

Figures Side by Side extended into Margin

Postby abclatex on Fri Dec 7th, 2012

Hi guys,

I have some problems of figures side by side.

  1. How to place figures like the "image1"? If someone could tell me how to manage them like "image2" (one figure occupies the body and has the same width as that of the body, while another occupies the margin and has the same width to that of the margin.), it could be perfect.

  2. How to place the figure caption directly under the figure? You can say the caption 2 of image 1 or 3 is at the wrong place.

Image 1
image 1.JPG
image 1.JPG (24.09 KiB) Viewed 608 times


Image 2 (the ideal mode)
image 2.JPG
image 2.JPG (23.57 KiB) Viewed 608 times


Image 3 (corresponding to the code)
image 3.JPG
image 3.JPG (30.9 KiB) Viewed 608 times


Code:
Code: Select all  •  Open in writeLaTeX
\documentclass[10pt,a4paper]{book}

% page layout
\usepackage[%
    left=2cm,
    right=7cm,
    top=2cm,
    bottom=2cm,
    textheight=25cm,
    textwidth=11cm,
    marginparsep=1cm,
    marginparwidth=5cm
    ]{geometry}

% Language settings
\usepackage[german,french]{babel}

% font and other typographic settings:
\usepackage{fontspec}
\setmainfont[Ligatures=TeX]{Calibri-Light}
\usepackage{ragged2e}
\usepackage{ctex}
\usepackage{array,color
}

% figures and the like:
\usepackage{graphicx}
\graphicspath{{fig/}}
\usepackage{caption}
\captionsetup[figure]{name={Figure.}}
\captionsetup{font={scriptsize,singlespacing},justification=RaggedRight,skip=2pt}
\usepackage{ifoddpage
}
%or: \usepackage[strict]{changepage}
\usepackage{blindtext}

\begin{document}
\begin{figure
}[t]
  %\setcapwidth{0.6\textwidth}
  \checkoddpage
  \edef\side{\ifoddpage l\else r\fi}%
  \makebox[\textwidth][\side]{%
    \begin{minipage}[t]{0.59\textwidth}
      \includegraphics[width=14cm]{1.1.jpg}
      \caption{Caption 1}
    \end{minipage
}%
    \hspace{1cm}%
    \begin{minipage}[t]{0.59\textwidth}
      \raggedleft
      \includegraphics[width=3cm]{1.2.jpg}
      \caption{Caption 2}
      \label{fig:free-lunch}
    \end{minipage
}%
  }%
\end{figure}

Today, four necktie knots are in widespread use. They are the four-in-hand knot, the half-Windsor knot, the Windsor knot and the Pratt knot. The first three are classic necktie knots that have been used for a long time. The Pratt knot is a more recent necktie knot that was introduced to the public in 1989.

Below shows a comparison table of the four necktie knots, together with the bow tie. It helps you find the answer to the first question that may come up in your mind -- Which necktie knots do I need? Click the links on the left to see the instructions on tying a certain knot.

\end{document
}


Thanks a lot!
abclatex
 
Posts: 17
Joined: Wed Nov 28th, 2012

Re: Figures Side by Side extended into Margin

Postby cgnieder on Fri Dec 7th, 2012

Is this a one-time occasion where you need a text figure and a margin figure side by side or will you figures always come in pairs? Should the figures be able to float like standard figures or should they be fixed?

Regards
Clemens
------------------------------
New German Q&A site about TeX: http://texwelt.de/wissen
System: TeXlive 2013, OpenSUSE 12.3
User avatar
cgnieder
Site Moderator
 
Posts: 1670
Joined: Sat Apr 16th, 2011
Location: Germany

Re: Figures Side by Side extended into Margin

Postby abclatex on Fri Dec 7th, 2012

cgnieder wrote:Is this a one-time occasion where you need a text figure and a margin figure side by side or will you figures always come in pairs? Should the figures be able to float like standard figures or should they be fixed?

Regards


Thanks for your reply, Cgnieder.

It' not one-time stuff. I need to place two or three figures side by side many times but not in every case. It's better to adopt float figures, I guess, since the paper has not done yet.

If I move the page layout codes, the overlapping would disppear. However I have to keep these layout codes.
Code: Select all  •  Open in writeLaTeX
\usepackage[%
    left=2cm,
    right=7cm,
    top=2cm,
    bottom=2cm,
    textheight=25cm,
    textwidth=11cm,
    marginparsep=1cm,
    marginparwidth=5cm
    ]{geometry}
abclatex
 
Posts: 17
Joined: Wed Nov 28th, 2012

Re: Figures Side by Side extended into Margin

Postby abclatex on Wed Dec 12th, 2012

Still unsolved...
abclatex
 
Posts: 17
Joined: Wed Nov 28th, 2012


Return to Graphics, Figures & Tables

Who is online

Users browsing this forum: No registered users and 7 guests