General ⇒ That little space between two frameboxes
That little space between two frameboxes
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.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
- Stefan Kottwitz
- Site Admin
- Posts: 10335
- Joined: Mon Mar 10, 2008 9:44 pm
That little space between two frameboxes
you could use \vspace with negative space parameter, like
Code: Select all
\framebox[2cm]{text1}
\vspace{-3\fboxrule}
\framebox[2cm]{text2}
Stefan
Re: That little space between two frameboxes
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: 10335
- Joined: Mon Mar 10, 2008 9:44 pm
That little space between two frameboxes
it works for me. Try this example:
Code: Select all
\documentclass[a4paper,10pt]{article}
\begin{document}
\framebox[2cm]{Text1}
\vspace{-3\fboxrule}
\framebox[2cm]{Text2}
\end{document}
Stefan
Re: That little space between two frameboxes
Edited: I sent this post without reading the preceding one by Stefan_K. Anyway, a MWE would help.
That little space between two frameboxes
Try this:
Code: Select all
\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
\documentclass[a4paper,10pt]{article}
\begin{document}
\noindent \framebox[2cm]{Text1}
\vspace{-3\fboxrule}\hfill\mbox{} \\
\framebox[2cm]{Text2}
\end{document}
That little space between two frameboxes
It's just that
Code: Select all
\par
Code: Select all
\hfill\mbox{} \\
That little space between two frameboxes
Code: Select all
\documentclass[a4paper,10pt]{article}
\begin{document}
\noindent \framebox[2cm]{Text1} \\[-3\fboxrule]
\framebox[2cm]{Text2}
\end{document}