The question, How to embed a minted environment inside a tabular environment?, addresses a similar issue, but I am using:
- the
tabularx
package, and - the inline
\mint
command
Is there a workaround available for this?
\documentclass[10pt]{article}
\usepackage[scaled]{beramono}
\usepackage[T1]{fontenc}
\usepackage{tabularx}
\usepackage{booktabs}
\usepackage{minted}
\begin{document}
\begin{tabularx}{\linewidth}{@{}lrX}
Type & Meaning & Size \\
\cmidrule(r){1-1} \cmidrule(lr){2-2} \cmidrule(lr){3-3}
\mint{c++}|float| & single precision floating point & 6 significant digits \\
& & Typically represented in 32 bits \\
\mint{c++}|double| & double precision floating point & 10 significant digits \\
& & Typically represented in 64 bits \\
\mint{c++}|long double| & extended precision floating point & 10 significant digits \\
& & Typically represented in 96 or 128 bits \\
\bottomrule
\end{tabularx}
\end{document}
tabularx
reads the table's contents as an argument, which limits the possibilities of including verbatim material. The package makes some adjustment in order to allow a restricted form of\verb
, but doesn't cover other verbatim-like macros.