On the question How to create a dummy generic environment replacement? I learned how to replace an generic envinronment with a dummy one. Until now I had success replacing then as replacing \currenttime
from datetime
package with \def\currenttime{Current Time}
.
But when I tried this strategy with \includegraphics
:
\documentclass[10pt,a5paper,twoside]{memoir}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[brazil]{babel}
\usepackage[showframe,pass]{geometry}
\newif\ifdebug
\debugtrue
% \debugfalse
\ifdebug
% \def\includegraphics{includegraphics}
\newcommand{\includegraphics}{includegraphics}
\else\fi
\begin{document}
\includegraphics[width=\linewidth]{pictures/ex01}
\end{document}
It does not worked:
! Missing number, treated as zero.
<to be read again>
]
l.86 \includegraphics[width=\linewidth]
{pictures/ex01}
A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)
! Illegal unit of measure (pt inserted).
<to be read again>
]
l.86 \includegraphics[width=\linewidth]
{pictures/ex01}
Dimensions can be in units of em, ex, in, pt, pc,
cm, mm, dd, cc, nd, nc, bp, or sp; but yours is a new one!
I'll assume that you meant to say pt, for printer's points.
To recover gracefully from this error, it's best to
delete the erroneous units; e.g., type `2' to delete
two letters. (See Chapter 27 of The TeXbook.)
Can I wrap the command contents as \includegraphics[width=\linewidth]{pictures/ex01}
on verbatim environment as done for environments?
\@ifundefined{longtable}
{
\newenvironment{longtable}[0]
{longtable environment \par\verbatim\tiny}
{\endverbatim\endgraf\normalfont replacement for debug mode}
}{}
Update
Trying to do:
\newcommand{\includegraphics}[2]{\par\verbatim\tiny includegraphics #1 #2 \endverbatim\endgraf\normalfont}
Throws a new error:
File: t1cmtt.fd 2014/09/29 v2.5h Standard LaTeX font definitions
)
Runaway argument?
! Paragraph ended before \next was complete.
<to be read again>
\par
l.87
I suspect you've forgotten a `}', causing me to apply this
control sequence to too much text. How can we recover?
My plan is to forget the whole thing and hope for the best.
But it is printing something on the PDF:
Related:
draft
ordemo
option tographicx
?\renewcommand\includegraphics[2][]{....}