Graphics, Figures & Tables ⇒ Newbie: Horizontal Space between figures and text!!
Newbie: Horizontal Space between figures and text!!
hi all,
this is my first post and i am a complete newbie regarding LaTeX.
i also posted this to the texhax mailing list but haven't heard anything back...
i am using pdflatex via the texmaker editor to create a pdf document with figures and text. the final output seems to have a large "horizontal" distance between the text and figures. how do i change this?
the figures are inserted using wrapfig.sty
please see the image uploaded at this link to get an idea of what i am talking about thanks!
--shiven
p.s. i will post the MWE as soon as i can... meanwhile, any help wiil be much appreciated!
this is my first post and i am a complete newbie regarding LaTeX.
i also posted this to the texhax mailing list but haven't heard anything back...
i am using pdflatex via the texmaker editor to create a pdf document with figures and text. the final output seems to have a large "horizontal" distance between the text and figures. how do i change this?
the figures are inserted using wrapfig.sty
please see the image uploaded at this link to get an idea of what i am talking about thanks!
--shiven
p.s. i will post the MWE as soon as i can... meanwhile, any help wiil be much appreciated!
Last edited by shiven on Tue Sep 15, 2009 6:17 pm, edited 1 time in total.
NEW: TikZ book now 40% off at Amazon.com for a short time.

- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Newbie: Horizontal Space between figures and text!!
A MWE is essential in this because there can be more than one probable cause.shiven wrote:[...] p.s. i will post the MWE as soon as i can... meanwhile, any help wiil be much appreciated! [...]
- The length \columnsep has been modified
- The reserved space is more than the (centered) figure needs
Best regards and welcome to the board
Thorsten
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Newbie: Horizontal Space between figures and text!!
hi localghost,
thanks for taking the time to answer my query!
so, here is the .tex code:
(WARNING, this may be too long!)
in case someone wants to regenerate the page (with pdflatex), i am attaching a zipped version of the .tex file, all four images and the final PDF with this message.
many thanks!
--shiven
thanks for taking the time to answer my query!
so, here is the .tex code:
(WARNING, this may be too long!)
Code: Select all
\documentclass[11pt,letterpaper,english]{article}
\renewcommand{\familydefault}{\sfdefault}
\usepackage[OT1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[letterpaper]{geometry}
\geometry{verbose,tmargin=0.5in,bmargin=0.5in,lmargin=0.5in,rmargin=0.5in,headheight=0.15in,headsep=0.15in,footskip=0.15in}
\usepackage{fancyhdr}
\pagestyle{fancy}
\usepackage{textcomp}
\usepackage{enumitem}
\usepackage{amstext}
\usepackage{babel}
\usepackage{sectsty}
\allsectionsfont{\sffamily\normalsize}
\usepackage[compact]{titlesec}
\titlespacing{\section}{0pt}{*0}{*0}
\titlespacing{\subsection}{0pt}{*0}{*0}
\titlespacing{\subsubsection}{0pt}{*0}{*0}
\titleformat{\section}{\bf}{\thesection.}{4pt}{}{}
\titleformat{\subsection}{\bf}{\thesubsection.}{4pt}{}{}
\titleformat{\subsubsection}{\bf}{\thesubsubsection.}{4pt}{}{}
\usepackage{graphicx}
\usepackage{ccaption}
\usepackage[bf,nooneline]{subfigure}
\usepackage{wrapfig}
\fussy
\begin{document}
\fancyhf{}
\renewcommand{\headrulewidth}{0pt} % Get rid of horizontal line in the header
\renewcommand{\footrulewidth}{0.25pt} % Create a thin horizontal line in the footer
\renewcommand{\abovecaptionskip}{0pt}
\renewcommand{\belowcaptionskip}{0pt}
\renewcommand{\thesection}{\arabic{section}}
\captionnamefont{\bfseries}
\captionstyle{\raggedright}
\captiontitlefont{\small\sffamily}
\renewcommand{\figurename}{Figure}
\setcounter{section}{1} % TOPMOST Section
\section{SPECIFIC AIMS} % TOPMOST Section
\noindent \begin{center}\textbf{ELUCIDATING} \par\end{center}
Many blah blah blah, blah blah blah, following two specific aims:
\renewcommand{\thesection}{Aim \arabic{section}}
\setcounter{section}{0} % Aims Section
\section{Structural}
\noindent blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah.
\section{Elucidate}
\subsection{Elucidating alpha:}
\noindent blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah
\subsection{Elucidating beta:}
\noindent blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah
\newpage{}
\renewcommand{\thesection}{\arabic{section}}
\section{BACKGROUND} % TOPMOST Section
\begin{wrapfigure}{r}[-0.25in]{0.4\textwidth}
\hrule
\caption{}
\subfigure[\scriptsize{blah blah blah}]{\label{fig:1a}\includegraphics[width=0.4\textwidth]{Fig1a.png}}
\hrule
\subfigure[\scriptsize{blah blah blah}]{\label{fig:1b}\includegraphics[width=0.4\textwidth]{Fig1b.png}}
\hrule
\subfigure[\scriptsize{blah blah blah}]{\label{fig:1c}\includegraphics[width=0.4\textwidth]{Fig1c.png}}
\hrule
\subfigure[\scriptsize{blah blah blah}]{\label{fig:1d}\includegraphics[width=0.4\textwidth]{Fig1d.png}}
\hrule
\end{wrapfigure}
\subsection{Background:}
\noindent blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah\\
blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah\\
blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah\\
\end{document}
many thanks!
--shiven
- Attachments
-
- MWE.zip
- MWE files
- (29.07 KiB) Downloaded 191 times
Newbie: Horizontal Space between figures and text!!
OK solved!
all i had to was add the line:
right before the:
to get the separation i needed.
thanks for the pointers!
--shiven
all i had to was add the line:
Code: Select all
\renewcommand{\columnsep}{-15pt}
Code: Select all
\begin{wrapfigure}{r}[-0.25in]{0.4\textwidth}
thanks for the pointers!
--shiven
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Newbie: Horizontal Space between figures and text!!
I'm quite sure that this can't work since \columnsep is a length. The syntax has to be different.shiven wrote:[...] all i had to was add the line:
[...]Code: Select all
\renewcommand{\columnsep}{-15pt}
Code: Select all
\addtolength{\columnsep}{-15pt}
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Newbie: Horizontal Space between figures and text!!
hi Thorsten,
maybe there is some issue at my end. but it appears that using your command in place of mine results in the same large distance as before... whereas if i use what i mentioned in my last post, things look fine.
please see page 2 in the attached PDF files:
MWE_0.pdf <- created using my \renewcommand syntax
MWE_1.pdf <- created using your \addtolength syntax
thanks!
--shiven
p.s. i had added [SOLVED] to my initial post title, but it seems to have been removed... is that against forum rules? just curious.
maybe there is some issue at my end. but it appears that using your command in place of mine results in the same large distance as before... whereas if i use what i mentioned in my last post, things look fine.
please see page 2 in the attached PDF files:
MWE_0.pdf <- created using my \renewcommand syntax
MWE_1.pdf <- created using your \addtolength syntax
thanks!
--shiven
p.s. i had added [SOLVED] to my initial post title, but it seems to have been removed... is that against forum rules? just curious.
Newbie: Horizontal Space between figures and text!!
another update.
i may be wrong when i said that "using your command in place of mine results in the same large distance as before" in the previous post...
the \addtolength syntax does reduce the space... though not as much as the \renewcommand syntax
please the attached MWE_2.pdf which is the same PDF as i uploaded in the .zip file in my second reply above.
i may be wrong when i said that "using your command in place of mine results in the same large distance as before" in the previous post...
the \addtolength syntax does reduce the space... though not as much as the \renewcommand syntax
please the attached MWE_2.pdf which is the same PDF as i uploaded in the .zip file in my second reply above.
- Attachments
-
- MWE_2.pdf
- same as original PDF
- (28.84 KiB) Downloaded 241 times
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Newbie: Horizontal Space between figures and text!!
Both versions work although I don't understand why yours does. The difference between your solution and mine is that you assign a complete new value to that length whereas I only subtract a little bit. The default value of \columnsep is 35pt. Thus the result of your solution is more significant than mine. See code below.shiven wrote:[...] maybe there is some issue at my end. but it appears that using your command in place of mine results in the same large distance as before... whereas if i use what i mentioned in my last post, things look fine. [...]
Code: Select all
\documentclass[11pt,a4paper,english]{article}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage{babel}
\usepackage{lmodern}
\usepackage{wrapfig}
\usepackage{blindtext}
\begin{document}
\begin{wrapfigure}{r}{7cm}
\rule{7cm}{5cm}
\end{wrapfigure}
\blindtext
\medskip
\addtolength{\columnsep}{-15pt}
\begin{wrapfigure}{r}{7cm}
\rule{7cm}{5cm}
\end{wrapfigure}
\blindtext
\end{document}
Code: Select all
\setlength{\columnsep}{-15pt}
I edited your initial post and marked the topic as solved by choosing the green checkmark. All other solved topics can be recognized from that. And yes, solved topics shall be marked like this (Section 3, last paragraph).shiven wrote:[...] p.s. i had added [SOLVED] to my initial post title, but it seems to have been removed... is that against forum rules? just curious. [...]
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Newbie: Horizontal Space between figures and text!!
Thorsten,
you are absolutely right! i have no idea why my command works... however the problem is immediately apparent from the following code:
the above code will thow an error!
however if you exchange the position of \renewcommand and \addtolength as such, it works fine!
so i guess the moral of the story is:
1. use \addtolength for changing \columnsep
2. multiple \addtolength commands will work as expected
3. avoid using \renewcommand indiscriminately
thanks for the schooling!
--shiven
you are absolutely right! i have no idea why my command works... however the problem is immediately apparent from the following code:
Code: Select all
\documentclass[11pt,a4paper,english]{article}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage{babel}
\usepackage{lmodern}
\usepackage{wrapfig}
\usepackage{blindtext}
\begin{document}
\medskip
\renewcommand{\columnsep}{-5pt}
\begin{wrapfigure}{r}{7cm}
\rule{7cm}{5cm}
\end{wrapfigure}
\blindtext
\medskip
\addtolength{\columnsep}{-5pt}
\begin{wrapfigure}{r}{7cm}
\rule{7cm}{5cm}
\end{wrapfigure}
\blindtext
\end{document}
however if you exchange the position of \renewcommand and \addtolength as such, it works fine!
Code: Select all
\documentclass[11pt,a4paper,english]{article}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage{babel}
\usepackage{lmodern}
\usepackage{wrapfig}
\usepackage{blindtext}
\begin{document}
\medskip
\addtolength{\columnsep}{-5pt}
\begin{wrapfigure}{r}{7cm}
\rule{7cm}{5cm}
\end{wrapfigure}
\blindtext
\medskip
\renewcommand{\columnsep}{-5pt}
\begin{wrapfigure}{r}{7cm}
\rule{7cm}{5cm}
\end{wrapfigure}
\blindtext
\end{document}
1. use \addtolength for changing \columnsep
2. multiple \addtolength commands will work as expected
3. avoid using \renewcommand indiscriminately
thanks for the schooling!
--shiven
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Newbie: Horizontal Space between figures and text!!
This only works as long as you don't try to access \columnsep as a length again because now there is a clash between the length and the command with the same name.shiven wrote:[...] however if you exchange the position of \renewcommand and \addtolength as such, it works fine! [...]
This perception is absolutely correct. However, this is a very interesting issue since the compiler should check whether something is already defined. I wonder why it doesn't do that in this case.shiven wrote:[...] so i guess the moral of the story is:
1. use \addtolength for changing \columnsep
2. multiple \addtolength commands will work as expected
3. avoid using \renewcommand indiscriminately
[...]
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10