15

It turns out that I've been using several deprecated commands, such as \tikzstyle and right of. Is there any way to have TikZ or pdfLaTeX warn in those cases, such as nag does?

3

Borrowing an example that uses \tikzstyle by percusse at tikzstyle default node text with fill color I show below how you can redefine the deprecated command to place a warning in the log or alternately, in the console and log. In this MWE, I have the redefinition in the file itself. But if you're like me, you have your own style file of oft-used macros that \usepackage{mycommands} in just about everything.

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc}
%%%%%%%%%%%%%%%%%
%%% PUT THIS IN YOUR OWN STYLE FILE
\let\svtikzstyle\tikzstyle
% LOG FILE ONLY:
%\def\tikzstyle{\wlog{WARNING: tikzstyle is used}\svtikzstyle}
% CONSOLE AND LOG FILE:
\def\tikzstyle{\typeout{WARNING: tikzstyle is used}\svtikzstyle}
%%%%%%%%%%%%%%%%%
% borrowed example from answer by percusse
\tikzstyle{stuff_nofill}=[rectangle,draw,font={A}]
\tikzstyle{stuff_fill}=[rectangle,draw,fill=black!20,minimum
size=1.4em,label={center:A}]
\begin{document}
\begin{tikzpicture}
 \node at (0,1) [stuff_nofill] {};
 \node at (0,0) [stuff_fill] {};
\end{tikzpicture}
\end{document}

enter image description here

  • Hey I was young and I needed money ! :P – percusse May 3 '13 at 11:41
  • 1
    @percusse I can anonymize the example, if it will help you sleep at night ;^S p.s. Anyhow, look at me. I'm still using 1980's vintage jove editor. – Steven B. Segletes May 3 '13 at 11:44

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.