[Tex/LaTex] fbox without additional v-space

boxesframedspacing

it's a little bit related to Non-invasive replacement for \fbox? , but not really. think:

\documentclass[12pt]{article}
\begin{document}
\footnotesize
\begin{tabular}{lc}
  a & 1\\
  a & 1\\
  \fbox{\fbox{b}} & 1\\
  c & 1\\
  c & 1\\
\end{tabular}
\end{document}

I do like that fbox leaves a little space on the inside (so that b is not touched by the lines), but then fbox "screws up" the vertical spacing in my paragraphs and tables. "screw up" is the wrong phrase, because adding vertical space to its line makes a lot of sense when one does not want text from one line to bleed into the other for some overlap.

but I use this fbox primarily to remind myself to fix something later on. so, I really want \fbox{\fbox{b}} (and fcolorbox) to take the same vertical space as b, even if its result protrudes into the line above and the line below. not always, but sometimes.

easy or hard? (if hard, please just say so and ignore question. this is an itch, not a problem.)

Best Answer

Considering that you want it only as a remainder and you'll delete the \fboxes later.... it is really ugly, but you can \smash the \fbox.

MWE:

\documentclass[12pt]{article}
\begin{document}
\footnotesize
\begin{tabular}{lc}
  a & 1\\
  a & 1\\
  \smash{\fbox{\fbox{b}}} & 1\\
  c & 1\\
  c & 1\\
\end{tabular}
\end{document} 

Output

enter image description here

You can, at least, redefine \foxsep to have it less ugly

\documentclass[12pt]{article}
\begin{document}
\renewcommand{\fboxsep}{1pt}
\footnotesize
\begin{tabular}{lc}
  a & 1\\
  a & 1\\
  \smash{\fbox{\fbox{b}}} & 1\\
  c & 1\\
  c & 1\\
\end{tabular}
\end{document} 

Output

enter image description here