General ⇒ That little space between two frameboxes
That little space between two frameboxes
I didn't realize that space was so holy. I can't get rid of it.
My situation:
I have a framebox, a newline, and another framebox of a different width. I want to fudge that lower framebox up so that the top border of the bottom framebox is touching the bottom border of the top framebox, effectively forming a double-width border where they're in contact.
This seems like something too trivial to turn the entire thing into a tabular, and I figure, as usual, there's something obscure that I'm missing.
Extensive combinations of vspace, addvspace, \\, and raisebox have been tried. While those all work just fine to lower the bottom box, there is always that minimal amount of spacing between their borders when I try to move the bottom box up.
I'm frustrated enough at this point that I'm about to screencap, make that adjustment in mspaint, and then load it as a picture.
Please don't let me have to resort to this.
Thanks.
My situation:
I have a framebox, a newline, and another framebox of a different width. I want to fudge that lower framebox up so that the top border of the bottom framebox is touching the bottom border of the top framebox, effectively forming a double-width border where they're in contact.
This seems like something too trivial to turn the entire thing into a tabular, and I figure, as usual, there's something obscure that I'm missing.
Extensive combinations of vspace, addvspace, \\, and raisebox have been tried. While those all work just fine to lower the bottom box, there is always that minimal amount of spacing between their borders when I try to move the bottom box up.
I'm frustrated enough at this point that I'm about to screencap, make that adjustment in mspaint, and then load it as a picture.
Please don't let me have to resort to this.
Thanks.
NEW: TikZ book now 40% off at Amazon.com for a short time.

- Stefan Kottwitz
- Site Admin
- Posts: 10345
- Joined: Mon Mar 10, 2008 9:44 pm
That little space between two frameboxes
Hi cvp,
you could use \vspace with negative space parameter, like
or similar just with appropriate space.
Stefan
you could use \vspace with negative space parameter, like
Code: Select all
Code, edit and compile here:
\framebox[2cm]{text1}\vspace{-3\fboxrule}\framebox[2cm]{text2}
Stefan
LaTeX.org admin
Re: That little space between two frameboxes
Stefan,
All of the previously mentioned commands (vspace, addvspace, raisebox) were tried with negative values, and none of them would allow the box to go any higher than 1mm below the previous box.
All of the previously mentioned commands (vspace, addvspace, raisebox) were tried with negative values, and none of them would allow the box to go any higher than 1mm below the previous box.
- Stefan Kottwitz
- Site Admin
- Posts: 10345
- Joined: Mon Mar 10, 2008 9:44 pm
That little space between two frameboxes
Hi cvp,
it works for me. Try this example:
Raising the absolute value for \vspace raises the box. Do you get something different?
Stefan
it works for me. Try this example:
Code: Select all
Code, edit and compile here:
\documentclass[a4paper,10pt]{article}\begin{document}\framebox[2cm]{Text1}\vspace{-3\fboxrule}\framebox[2cm]{Text2}\end{document}
Stefan
LaTeX.org admin
Re: That little space between two frameboxes
Why don't you post a minimal working example showing both boxes? It would be useful to see precisely what are you trying to do.
Edited: I sent this post without reading the preceding one by Stefan_K. Anyway, a MWE would help.
Edited: I sent this post without reading the preceding one by Stefan_K. Anyway, a MWE would help.
The CTAN lion is an artwork by Duane Bibby. Courtesy of www.ctan.org.
That little space between two frameboxes
Huh. Fascinating. That paragraph break is what lets it happen, apparently.
Try this:
You'll notice that no argument for \vspace will allow it to go higher than a certain amount if you simply use \\ (or \newline or \linebreak to get the next line.
You must have a new paragraph, it seems, in order to shrink that space at all. (I just tried \par, and that allows the space adjustment as I intended.)
Well, my code's going to look ugly as all hell, but at least this will do the trick. Hopefully no one will judge me for the contents of this cls file.
Try this:
Code: Select all
Code, edit and compile here:
\documentclass[a4paper,10pt]{article}\begin{document}\noindent \framebox[2cm]{Text1}\\%\vspace{-3\fboxrule}%\framebox[2cm]{Text2}\end{document}
You must have a new paragraph, it seems, in order to shrink that space at all. (I just tried \par, and that allows the space adjustment as I intended.)
Well, my code's going to look ugly as all hell, but at least this will do the trick. Hopefully no one will judge me for the contents of this cls file.
That little space between two frameboxes
Yes, it is, but it is not really necessary.cvp wrote:Huh. Fascinating. That paragraph break is what lets it happen, apparently.
No, you mustn't. Try this:cvp wrote: You must have a new paragraph, it seems, in order to shrink that space at all. (I just tried \par, and that allows the space adjustment as I intended.)
Code: Select all
Code, edit and compile here:
\documentclass[a4paper,10pt]{article}\begin{document}\noindent \framebox[2cm]{Text1}\vspace{-3\fboxrule}\hfill\mbox{} \\\framebox[2cm]{Text2}\end{document}
The CTAN lion is an artwork by Duane Bibby. Courtesy of www.ctan.org.
That little space between two frameboxes
Sure, fine, it doesn't have to be a new paragraph.
It's just that
is easier to type and more understandable than
It's just that
Code: Select all
\par
Code: Select all
\hfill\mbox{} \\
That little space between two frameboxes
The simplest way:
Code: Select all
Code, edit and compile here:
\documentclass[a4paper,10pt]{article}\begin{document}\noindent \framebox[2cm]{Text1} \\[-3\fboxrule]\framebox[2cm]{Text2}\end{document}
The CTAN lion is an artwork by Duane Bibby. Courtesy of www.ctan.org.