Text FormattingCombine fake height and fake width

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
ghostanime2001
Posts: 402
Joined: Fri May 20, 2011 9:41 am

Combine fake height and fake width

Post by ghostanime2001 »

How do you combine height, depth, and width of one expression for the height, depth and width of another expression ? In other words, one expression has ALL the exact dimensions of another expression ?

So far, \makebox*{B}{A} sets the width

and \newcommand{\fakeheight}[2]{\mbox{\smash{#1}\vphantom{#2}}} sets the height

MWE:

Code: Select all

\documentclass[fleqn]{article} 
\usepackage{makebox}
\usepackage{booktabs}
\usepackage[version=3]{mhchem}
\usepackage{nccboxes}
\usepackage{tikz}
\usetikzlibrary{matrix,calc}
\setlength{\parindent}{0pt}
\setlength{\parskip}{0pt}
\setlength{\mathindent}{0pt}
\newcommand{\fk}[2]{\mbox{\smash{#1}\vphantom{#2}}}
\begin{document}
\fbox{CAPS}\fbox{a}\fbox{ooooooooo} \\ \\
need the height of \fbox{CAPS} and the width of \fbox{ooooooooo} for \fbox{a}
\end{document}

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