1

Continuing the question File ended while scanning use of \next, while using \begin{comment} on macro definition another example would be when there is a table inside the redefined command redefined by:

\documentclass[10pt,a5paper,twoside]{memoir}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

\usepackage[brazil]{babel}
\usepackage[showframe,pass]{geometry}

\newif\ifdebug
\debugtrue
% \debugfalse

\ifdebug
\makeatletter

\@ifundefined{resizebox}
{
    \newcommand{\resizebox}[3][]{ resizebox \detokenize{#1} \detokenize{#2} \detokenize{#2} }
}{}

\makeatother
\else\fi

\begin{document}

\sloppy
\resizebox{\textwidth}{!}
{
    \begin{tabular}{p{2.6cm}|p{6.0cm}|p{2.25cm}|p{3.40cm}}

       \textbf{Investigação} & \textbf{Insumos} & \textbf{Sistema} & \textbf{Produtos}  \\
        \hline
       Meta-nível            & Filosofia        & Epistemologia    & Paradigma  \\
        \hline
       Nível                 & Paradigmas       & Ciencia          & Teorias    \\
        \hline
       inferior              & Modelos          & Pratica          & problemas  \\

    \end{tabular}
}

\end{document}

The table seems to be rendered anyways, but the resizebox command parameter was printed on the top:

enter image description here

How to stop the table from being rendered/draw, i.e., comment it out while nested on resizebox command redefined?

Would be the only option to redefine the table environment, to for it to be treated as plain-text or hide/comment out the table contents?

3

enter image description here

use of resizebox is tricky. better is determined table width with use of tabular or tabularx:

\documentclass[10pt,a5paper,twoside]{memoir}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[portuges]{babel}% i haven brazil label

\usepackage{showframe}

\begin{document}

\begin{center}
\small
\begin{tabularx}{\linewidth}{@{}
                                >{\hsize=0.22\hsize}X
                                >{\hsize=0.34\hsize}X
                                >{\hsize=0.22\hsize}X
                                >{\hsize=0.22\hsize}X
                             @{} }
    \toprule
\textbf{Investigação}   & \textbf{Insumos}  & \textbf{Sistema}  & \textbf{Produtos} \\
    \midrule
Meta-nível              & Filosofia         & Epistemologia     & Paradigma         \\
Nível                   & Paradigmas        & Ciencia           & Teorias           \\
inferior                & Modelos           & Pratica           & problemas         \\
    \bottomrule

note: it is not clear what second column had to be wider then others. see, if reusl, when all have the same width is acceptable. in this case the begining of tabularx is simpler:

\begin{tabularx}{\linewidth}{@{} XX XX @{} }

and table looks like this:

enter image description here

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.