# Remove vertical space between two includegraphics, without random negative vspaces

everyone. I've lost hours on this dumb problem: if I write something like this

\includegraphics{img}\\* \includegraphics{img} 


a noticeable vertical space appears between the two images when I'm using documentclass "report" or "article". However, with the "minimal" class, this space disappears, so I thought there was some weird length defining this. I tried setting lots of lengths to zero, but with no luck so far.

There exist lots of questions of this type already, but most of theme deal with using figures, centering commands and such. I'm actually using a center environment in my real document, but removing it did not solve the problem. Furthermore, I think resorting to a negative vspace to solve such problems is a bit dirty: if its length were set incorrectly, the images might overlap, and I would not want to lose a single pixel, especially because it would be very surprising if there were no other way to solve this.

Here's an almost minimal working example, with lots of random setlengths that did not solve the problem:

\documentclass{article}  \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc}  \usepackage[demo]{graphicx}  \setlength{\parindent}{0pt} \setlength{\parskip}{0pt} \setlength{\textfloatsep}{0pt} \setlength{\dbltextfloatsep}{0pt} \setlength{\fboxsep}{0pt} \setlength{\baselineskip}{0pt} \setlength{\tabcolsep}{0pt}  \begin{document}  \includegraphics{img}\\* \includegraphics{img}  \end{document} 


Changing the class to "minimal" turns the vertical space into an almost unnoticeable paler line, which is a bit better, but of course I cannot use "minimal" for my real documents…

This might actually have something to do with the depth of the box created by includegraphics (I already noticed that rotations, with angle = 90orsomething, sometimes do weird things with the depth; even the documentation says so), but this command does not appear to have a "depth =" key.

Actually, the ultimate goal is to append four images:

AB CD 


with absolutely no space between them, and keeping them on the same page. I thought it would be a piece of pie, but it seems I'm even more a noob than I thought.

You're my last hope of not resorting to Bash and stuff (I like Bash, but it would be better to handle this with LaTeX alone); I might end up using:

\$ convert $$IMG_1 IMG_2 +append$$ $$IMG_3 IMG_4 +append$$ -append OUTPUT 


(At least this issue allowed me to learn cool stuff about convert…)

Thanks.

Replay

Category: spacing Time: 2016-07-29 Views: 1