I want to set the parameter \xx to define the tabular below.
However, I do not know how to expand the term (1-\xx) so the code below does not compile. I would appreciate your help.
\documentclass[12pt,letterpaper]{article}
\def\xx{0.3}
\begin{document}
\begin{tabular}{p{\xx\linewidth}p{(1-\xx)\linewidth}}
a&b\\
c&d
\end{tabular}
\end{document}
\begin{tabular}{p{\xx\linewidth}p{\the\dimexpr(1-\xx)\linewidth\relax}}produces the error message Illegal unit of measure (pt inserted). – Chilote Jan 03 '22 at 03:12tabularxpackage is great. Include it, and then specify the total tabular width and use an X column to fill the table to width like so:\begin{tabularx}{\linewidth}{ p{\xx\linewidth} X }– likethevegetable Jan 03 '22 at 03:18\xx. If I want to change the values of all the tables in the document, I do not need to make the changes manually on every column of every table. I will be able to just assign values to a few parameters. That is what I need. That can be done withtabularortabularx, it does not really matter to me which one I use. The important point is how to expand expressions like(1-\xx)inside the options oftabularortabularx. – Chilote Jan 03 '22 at 03:43