2

I have several images that span the entire length of the two-column sig-alternate format I am using. I would like to avoid images on the same page from overlapping. How can I achieve this? I am using \includegraphics command. The graphics are in an appendix page on a page by themselves with no other text or anything else. How do I avoid this overlapping behavior? I would really appreciate a concrete code example as I am really new to LateX and am very unfamiliar with all the nuances that go into spacing and content arrangement on a page.

Thanks in advance!

Well the code I am using is :

\documentclass{sig-alternate}
\usepackage{graphicx}
\usepackage{array}
\usepackage{caption}
\usepackage{csvsimple}
\usepackage[utf8]{inputenc}

\begin{document}

\includegraphics[scale=0.4]{5_day_slidingwindow_binHR}
\includegraphics[scale=0.4]{10_day_slidingwindow_binHR}
\includegraphics[scale=0.4]{15_day_slidingwindow_binHR}
\includegraphics[scale=0.4]{20_day_slidingwindow_binHR}
\includegraphics[scale=0.4]{25_day_slidingwindow_binHR}
\includegraphics[scale=0.4]{30_day_slidingwindow_binHR}
\hspace*{0.2cm}\includegraphics[scale=0.3]{ArticleLifetimeHist}

\end{document}
  • Welcome to TeX.sx! Please add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. With so few clues it is impossible to guess what's wrong in your code. – Fran May 6 '15 at 21:57
  • @Fran thanks for the input. I have included the relevant part of the code. The actual image files I have left out. The images on a single page are overlapping. Please let me know if you need anything else. – anonuser0428 May 6 '15 at 22:35
  • do you mean that the images in the left column are wider than the column and overlap the right column? that is possible, especially as you have added 7 images on the same line (and so rely on tex's line breaker ) latex should never overlap images in the same column. – David Carlisle May 6 '15 at 23:05
2

Without the original images and some output, I guess that just one or more images on the left are bigger that the width of the column because the option [scale=0.4], so that they are covered by the image of the right column.

Try with [width=\linewidth]. In this MWE, the images A is wrongly scaled to the 70% and therefore is covered with the image "1x1". The images "B" and "C" fit well to the column width, so images are not covered by the images on the right:

MWE

\documentclass{sig-alternate}
\usepackage{graphicx}
\begin{document}
\noindent\includegraphics[width=1.2\linewidth]{example-image-a}
\includegraphics[width=\linewidth]{example-image-b}
\includegraphics[width=\linewidth]{example-image-c}
\includegraphics[width=\linewidth]{example-image-1x1}
\includegraphics[width=\linewidth]{example-image-golden-upright}
\end{document}

Edit:

If only a figure must span the entire width of the page, as stated in the comments, one you must keep in mind that the page will be filled with text and raw images in sequential order, with exception of the floats, following the two-column layout, so your options are:

(a) Use wider image-s of [width=\textwidth] in the left column, then a \clearpage (= nothing on the right column).

(b) If the image will be placed in pages without two-column text, switch to a \onecolumn (this mean a new page), place the images with [width=\textwidth] or [width=\columnwidth] or [width=\linewidth] (there are not differences in this case) and use \twocolumn to return to default text pages with two columns (this command mean also a new page).

c) Use the figure* environment. This float take the space of both columns without overlapping text or another images, but note that floats are intended to provide automatic positioning according to several LaTeX rules: This mean that the image may jump one or more pages. In the case of figure* floats, they will never show up on the page where they are encountered.

An example showing all these options:

enter image description here

\documentclass{sig-alternate}
\usepackage{graphicx}
\begin{document}
\onecolumn %switch to one colum mode 

% image width = \columwidth that now = \textwidth
\noindent\includegraphics[width=\columnwidth]{example-image-a}

\twocolumn % return to two-column mode 

% image intrude the right column
\noindent\includegraphics[width=\textwidth]{example-image-a}

\clearpage % right column empty

% image not intrude the right column
\noindent\includegraphics[width=\linewidth]{example-image-a}

\includegraphics[width=\textwidth]{example-image-b}

% image width = \columwidth that now is NOT \textwidth
\includegraphics[width=\columnwidth]{example-image-c}

% a figure float that take two columns but in the next page
\begin{figure*}
\includegraphics[width=\linewidth]{example-image-a}
\caption{This is the figure A}
\end{figure*}

\clearpage 

% a figure float that take one column
\begin{figure}
\includegraphics[width=\linewidth]{example-image-b}
\caption{This is the figure A}
\end{figure}

\end{document}
| improve this answer | |
  • thanks for your answer, the \linewidth was really helpful. But I would like each figure to span the entire width of the page and would like to have one figure per line. How would I achieve that? I know that \paperwidth is used to achieve stretching the figure to the entire page size but how do I achieve the latter requirement of one figure per line? – anonuser0428 May 7 '15 at 1:37
  • @anonuser0428 Keep in mind that the text (including images) will be places in two columns, so your options are: (a) image-s of [width=\textwidth] in the left, then \clearpage (= none on the right) (a) better: switch to \onecolumn mode (c) Uhmmm.... Do you know what are "floats" in LaTeX? If not, learn first about it, and concretely, about the figure* environment. This is a basic knowledge of LaTeX that you really must know before attempting to place figures in a document. – Fran May 7 '15 at 4:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.