Graphics, Figures & TablesNewbie: Horizontal Space between figures and text!!

Information and discussion about graphics, figures & tables in LaTeX documents.
phi
Posts: 577
Joined: Tue Oct 21, 2008 8:10 pm

Newbie: Horizontal Space between figures and text!!

Post by phi »

shiven wrote: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!
[...]
Macros (as created by \newcommand and \renewcommand) are very different from length registers, so you will run into trouble when you apply commands designed for macros to length registers. Unfortunately \renewcommand doesn't check whether its argument is a macro or not. The second code works only by accident. In general, never use \renewcommand to change length registers.
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
To be specific, don't use \renewcommand to change length registers, use \setlength instead.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Post Reply