I encountered a problem related to TikZ when I changed from article document class to mnthesis document class, which is custom made. The mnthesis document class does not recognize tikz. Please see the code below. First is the test1.tex code with the article document class, then the mnthesis.cls code. Thanks.

\documentclass[11pt, oneside]{article}

\usepackage{pgfplots}  %pgfplots.sourceforge.net\pgfplots.pdf




    \caption{Flowchart of Zambian Modeled Economy}
\tikzstyle{demand} = [draw, rectangle, fill=blue!50, text width=29em, text centered, minimum height=10mm, node distance=4em]
\tikzstyle{market} = [draw, diamond, fill=blue!50, text width=2em, text centered, minimum height=12mm, node distance=4em]
\tikzstyle{stage} = [draw, rectangle, fill=blue!50, text width=5em, text centered, minimum height=8mm, node distance=4em]
\tikzstyle{sector}=[draw, circle, fill=red!50,minimum height=20mm, text width=4em, text centered]
\tikzstyle{line} = [draw, -stealth, thick]



%Consumer Demand
\node [demand] (consdemand) {Consumer Demand\\$y_{m}$$\leq$$q_{m}$ \hspace{12mm}     $y_{s}$=$q_{s}$ \hspace{16mm}    $y_{r}$=$q_{r}$  \hspace{12mm}  $y_{d}$=$q_{d}$};

\node [market, below of=consdemand, yshift=-25, xshift=-40mm] (manfmkt) {Manf Market};
\node [stage, below of=manfmkt, yshift=-18mm] (MLK) {Labor and Capital};
\node [sector, below of=MLK, yshift=-104mm] (manuf) {Manu-facturing};
\node [stage, left of=manfmkt, xshift=-13mm,yshift=0mm] (imex2) {Imports, Exports};
\node [stage, left of=manuf, yshift=-15mm, xshift=-24mm] (factorinc) {HH Factor Income};

%Modern Food Channel
\node [market, below of=consdemand, yshift=-9mm, xshift=-14mm] (modfoodmkt) {Modern Food Mkt};
\node [stage, below of=modfoodmkt, yshift=-2mm] (modfoodret) {Modern Food Ret};
\node [stage, below of=modfoodret, yshift=-2mm] (MFLK) {Labor and Capital};
\node [market, below of=MFLK, yshift=-2mm] (WSfoodmkt) {WSale Output};
\node [stage, below of=WSfoodmkt, yshift=-2mm] (processors) {Processors};
\node [market, below of=processors, yshift=-2mm] (comfarmoutput) {Com Farm Output($Y_{c}$)};
\node [stage, below of=comfarmoutput, yshift=-2mm] (commfarms) {Labor and Capital};
\node [market, below of=commfarms, yshift=-2mm] (modlandmkt) {Modern Land Mkt};
\node [stage, below of=modlandmkt, yshift=-2mm] (commland) {Commercial Land ($H_{c}$)};
\node [sector, below of=commland, yshift=-6mm] (modfood) {Modern Food Channel};
\node [stage, left of=comfarmoutput, xshift=-39mm,yshift=0mm] (imex1) {Imports, Exports};

%Services Channel
\node [market, below of=consdemand, yshift=-9mm, xshift=13mm] (servicesmkt) {Services Market};
\node [stage, below of=servicesmkt, yshift=-18mm] (SLK) {Labor and Capital};
\node [sector, below of=SLK, yshift=-103mm] (serv) {Services};

%Traditional Food Channel
\node [market, below of=consdemand, yshift=-9mm, xshift=40mm] (tradfoodmkt) {Trad Food Mkt};
\node [stage, below of=tradfoodmkt, yshift=-2mm] (tradfoodret) {Traditional Food Ret};
\node [stage, below of=tradfoodret, yshift=-2mm] (TLK) {Labor and Capital};
\node [market, below of=TLK, yshift=-34mm] (tradfarmoutput) {Trad Farm Output($Y_{h}$)};
\node [stage, below of=tradfarmoutput, yshift=-2mm] (SHfarms) {Labor and Capital};
\node [market, below of=SHfarms, yshift=-2mm] (tradlandmkt) {Trad Land Mkt};
\node [stage, below of=tradlandmkt, yshift=-2mm] (smallholderland) {Smallholder Land ($H_{h}$)};
\node [sector, below of=smallholderland, yshift=-6mm] (tradfood) {Traditional Food Channel};

% Path Lines
\path [line][<->] (comfarmoutput) -- (imex1);
\path [line] [<->] (imex1) -- (imex2);
\path [line] [<->] (imex2) -- (manfmkt);
\path[line] (manfmkt) -- (consdemand);
\path[line] (modfoodmkt) -- (consdemand);
\path[line] (servicesmkt) -- (consdemand);
\path[line] (tradfoodmkt) -- (consdemand);
\path[line] (MLK) -- (manfmkt);
\path[line] (SLK) -- (servicesmkt);
\path[line] (MFLK) -- (modfoodret);
\path[line] (TLK) -- (tradfoodret);
\path[line] (tradfarmoutput) -- (TLK);
\path[line][->>,very thick] (manuf) |- (factorinc);
\path[line][->>,very thick] (modfood) |- (factorinc);
\path[line][->>,very thick] (serv) |- (factorinc);
\path[line][->>,very thick] (tradfood) |- (factorinc);
\path[line][->>,very thick] (factorinc) |- (consdemand);
%\draw[->] (manuf) -- (manuf -| consdemand);


mnthesis.cls code:

% mnthesis.cls: mnthesis document class (Latex)
% Les Clowney ----- modified by K. Thorne for UofMinn
%  5/12/89   make version for University of Minnesota
%  11/23/89  modifications for 11-pt version for UofM
%  2/14/90   correct entries to table of contents
%  3/25/94   add in signature and abstract signature pages. -Jeff Nelson
%  5/4/2005  Modify to latex2e class format from old style format - BPS
%  5/24/2007 Fix the title and abstract page formatting. - BPS
% 11/17/2009 Fixed ordering of acknowledgments and abstract as required - PP
% 11/17/2009 'References' added to Table of Contents as required - PP
% 11/17/2009 Note: Table of content and list of Figures are ok in 'draft' format, not in 'final' (which is default) - PP
% 5/21/2010 Added Dedication - EB
% 5/24/2010 Added section to correctly give M.S. thesis or Ph.D. dissertation - EB
% 11/23/2010 Fixed the issue with restarting the numbering of pages if both Acknowledgement and Dedication pages are present
%            If Dedication page alone is present please uncomment line 406   - Sriram Doraiswamy
% 11/23/2010 Fixed the problem where additional pages of Acknowledgement were not correctly numbered - Sriram Doraiswamy
% 11/25/2010 Name of the advisor and Master of Arts or Science appears properly - Sriram Doraiswamy


% Summary of New Commands (many are not used outside of the style file)
%The following are primarily for the titlepage et al....
%\draft         (this invokes the macro \draftrue)
%\copyrightpage     (make a copyright page)
%\figurespage       (make a page for list of figures)
%\tablespage        (make a page for list of tables)
%\title{thesis title}   (this is defined by the report style)
%\author{author's name} (this is defined by the report style)
%\phd           (if invoked then \phdtrue is set.)
%\degree{degree type}   (Default "Master of Science")
%\words{words in abstract}
%\abstract{the body of the abstract}
%\acknowledgements{the body of the acknowledgments}
%\dedication{the body of the dedication}
%\director{the principal advisor's name}
%\submissionyear{year of submission to the Graduate School}
%\submissionmonth{month of submission to the Graduate School}
%(The default dates used will be those at which the document was prepared)
%\begin-end{vita}  (begin single spacing after this point for the vita)
%       ******* Booleans *******
%\ifpagestyletopright   (invoke \pagestyle{topright})
%\ifdraft       (Will do some things differently if draft. Set by \draft)
%\ifcopyright       (Add a copyright notice? (Set by \copyrightpage)
%\ifabstract        (set if command \abstract invoked)
%\ifpreface     (set if command \preface invoked)
%\ifextra       (set if command \extra invoked)
%\ifacknowledgements    (set by \acknowledgements)
%\ifabstract        (set by \abstract)
%\ifafterpreface (afterpreface sections pagenumber must be at topright
%               corner. If user has chosen a header then it must be overridden.)
%               (Produce a List of figures? The default is to do so.)
%               (Produce a List of tables?)
%\begin/end{descriptionlist} (Basically a modified  \description.)
%\fullpagefigure Creates a figure where the page is a vbox whose
%                height is \textheight.

% Redefine the way that LaTeX starts up so that its simpler to use.

% We need 1" (~72pt) margins except on binding edge, where it is 1 1/2".
% They are a bit larger to handle lines with overfull boxes.

% My Definitions

%\setlength{\oddsidemargin}{1.937cm}  % default -> 2.0 cm odd side
%\setlength{\oddsidemargin}{0.55in} % final version to grad school
\setlength{\evensidemargin}{0.1in} % default -> 3.4 cm even side
%\setlength{\evensidemargin}{0.1in} % default -> 3.4 cm even side





% Documentstyle Modifications
\brokenpenalty=10000 % Do not break pages at hyphens.

% use baselinestretch of 2.0 for 10 pt
% use baselinestretch of 1.6 for 11 pt

\@addtoreset{equation}{chapter} % Set things up so that the equation,
% thefigure, and thetable counters are reset by incrementing
% thechapter. (The others are correct in the report style.)

% use Table of Contents rather than default of Contents
%\def\tableofcontents {
%  \@restonecolfalse
%  \if@twocolumn
%    \@restonecoltrue\onecolumn
%  \fi
%  \chapter*{Table of Contents\@mkboth{TABLE OF CONTENTS}{TABLE OF CONTENTS}}
%  \@starttoc{toc}
%  \if@restonecol
%    \twocolumn
%  \fi

% single space bibliography, quotations and verse.
\renewenvironment{thebibliography}[1] {
  \list{\@biblabel{\@arabic\c@enumiv}} {
  \@clubpenalty \clubpenalty
} {
  \def\@noitemerr {
    \@latex@warning{Empty `thebibliography` environment}

% This pageheadings will place numbers at top righthand corners
\def\ps@topright {

%  ***** Verbatim listing macro ****
%  Code from the TeXbook for inputting a file and listing it verbatim in
%  \tt mode. Will not properly handle tabs.  This code hasn't been
%  rigorously tested so it should be used cautiously.  Note that the
%  left quote. "`", is redefined when the macro is finally used or `
%  isn't properly handled.
\def\uncatcodespecials{\def\do##1{\catcode`##1=12 }\dospecials}
\def\setupverbatim {
  \tt \def\par{\leavevmode\endgraf}\catcode`\`=\active
  \obeylines \uncatcodespecials \obeyspaces
} {
  \obeyspaces\global\let =\

% This is in limbo right now...make heading and subheading as in Scribe.
  {-3.25ex plus -1ex minus -.2ex}{1.5ex plus .2ex}

% Single Space Figures, Tables, and Footnotes
% Redefine the macro used for floats (including figures and tables) so
% that single spacing is used.  (Note \def\figure{\@float{figure}set
% single spacing} doesn't work because figure has an optional argument)
\def\@xfloat#1[#2] {
    \@bsphack\@floatpenalty -\@Mii
  \else\@next\@currbox\@freelist {
    \@tempcnta\csname ftype@#1\endcsname
    \@tfor \@tempa :=#2\do {
      \if\@tempa h\advance\@tempcnta \@ne\fi
      \if\@tempa t\advance\@tempcnta \tw@\fi
      \if\@tempa b\advance\@tempcnta 4\relax\fi
      \if\@tempa p\advance\@tempcnta 8\relax\fi
  } \@fltovf\fi

% leave captions indented, I hope
% \hsize\columnwidth

% Single space footnotes.
    \splitmaxdepth \dp\strutbox \floatingpenalty \@MM
    \hsize\columnwidth \@parboxrestore
    \edef\@currentlabel{\csname p@footnote\endcsname\@thefnmark}
    \@makefntext {

% User commands
  \phdtrue\def\@degree{Doctor Of Philosophy}
  \phdfalse\def\@degree{Master Of Science}


% defaults
\def\@degree{Doctor of Philosophy}
\def\@campus{University of Minnesota}
  January\or February\or March\or April\or May\or June\or
  July\or August\or September\or October\or November\or December\fi

% conditionals and defaults
\newif\ifdraft          \draftfalse
\newif\ifafterpreface       \afterprefacefalse
\newif\ifcopyright      \copyrightfalse
\newif\iffigures        \figuresfalse
\newif\iftables         \tablesfalse
\newif\ifabstract       \abstractfalse
\newif\ifpreface        \prefacefalse
\newif\ifextra          \extrafalse
\newif\ifacknowledgements   \acknowledgementsfalse
\newif\ifdedication     \dedicationfalse
\newif\ifabbreviationspage  \abbreviationspagefalse
\newif\ifphd            \phdfalse
\newif\ifpagestyletopright  \pagestyletoprighttrue

\newcommand\titlep {
  \vbox to \textheight {
    \null\nobreak\vskip 10bp {
    \vskip 4ex plus 2ex minus 2ex {
      \ifdraft {
        DRAFT VERSION CREATED ON \uppercase\expandafter{\today}\\
        A \ifphd{DISSERTATION}\else{THESIS}\fi\ \\
        BY \\
% probably want to add space.
% \vskip 36bp minus 36bp
        \vskip 2ex plus 2ex minus 2ex
        \vskip 2ex plus 2ex minus 2ex
%       \ifphd{Doctor of Philosophy}\else{Master of Science}\fi\ \\
        \ifphd{Doctor of Philosophy}\else \@degree          \fi\ \\
        \vskip 1ex plus 1ex minus 1ex
        \vskip 1ex plus 1ex minus 1ex
        \@month, \@year\\
      \fi %close ifdraft
}% end titlep

\newcommand\copyrightp {
  \bf\large\copyright\ \@author\ \ \@year\ \\

\def\descriptionlist#1 {
  \list{} {

\def\unnumberedsection#1 {

% The signature, title, copywrite, and abstract pages
\newcommand\beforepreface {
%  \ifabstract {
  \ifacknowledgements {  
    \c@page1 % set page counter so that next is 1

% Title page

% Copywrite page




%    \addcontentsline{toc}{chapter}{Acknowledgements}
%    \null\vskip -20bp
%    \begin{center} {
%    }
%    \large\bf\
%    Acknowledgements
%    \end{center}
%    \vskip 8bp



% \pagenumbering{roman}     


%    \addcontentsline{toc}{chapter}{Dedication}
%    \null\vskip -20bp
%    \begin{center} {
%    }
%    \large\bf\
%    Dedication
%    \end{center}
%    \vskip 8bp


% An abstract to be bound into the thesis
%    \pagestyle{plain}
%    \pagenumbering{roman}
%    \addcontentsline{toc}{chapter}{Abstract}
%    \null\vskip -20bp
%    \begin{center} {
%      \large\bf\expandafter{\@title} \large
%      \vskip 8bp
%      by \@author \\
%      %Under the supervision of \@director
%      \vskip 8bp
%    }
%    \large\bf\
%    Abstract
%    \end{center}
%    \vskip 8bp
%    \@abstract
%  } \fi
%  \typeout{Abstract}
%  %\eject

\newcommand\afterpreface {
% Insert all of the text between the title (and copyright) pages and the main
% body of the thesis.
%  \pagenumbering{roman}
%  \ifpreface {
%    \unnumberedsection{Preface}
%    \@preface
%  } \fi
%  \ifacknowledgements
%    \unnumberedsection{Acknowledgements}
%    \@acknowledgements
%  \fi
%  \ifdedication 
%    \unnumberedsection{Dedication}
%    \@dedication
%   \fi

%    \pagenumbering{roman}
    \ifabstract {
    \null\vskip -20bp
    \begin{center} {
    \vskip 8bp



  \ifabbreviationspage {
    \unnumberedsection{List of Abbreviations}
  } \fi
  \ifextra {
%   \chapter*{}
  } \fi
  \c@page0 % set page counter so that next is 1

\def\vita {


% Fullpage floats:
\def\fullpagefigure {
  \vbox to \textheight

\def\fullpagetable {
  \vbox to \textheight

% Redefine appendix to print Appendix []. ... page # in table of contents.
  \hbox{Appendix #1. }

\renewcommand\appendix {
% Redefine @chapter  so that appnumberline (ratherline) is used.
  \def\@chapter[##1]##2 {
    \ifnum \c@secnumdepth >\m@ne
      {\protect \appnumberline{\thechapter}##1}
% Don't add extra space to lists of figures and tables after chapters.

\renewcommand\listoffigures {
  \chapter* {
    List of Figures
  \addcontentsline{toc}{chapter}{List of Figures}

\renewcommand\listoftables {
  \chapter* {
    List of Tables
  \addcontentsline{toc}{chapter}{List of Tables}

      \@clubpenalty \clubpenalty
       {\@latex@warning{Empty `thebibliography' environment}}%
  • 1
    The class redefines \@xfloat in a faulty way. – egreg Jul 16 '14 at 21:03

The mnthesis.cls redefines \@xfloat according to some quite old version of it in the kernel (probably the LaTeX 2.09 version). Thus it becomes incompatible with TikZ and with all other packages that use color.

Here is a kludge for making it work: according to the notes in the class, the redefinition is meant to use single spacing in floats.

% save a copy of the kernel's \@xfloat

% load the mnthesis class

% fix floats to use single spacing

This should go at the start, in place of the simple \documentclass line.

Note that hyperref should be loaded last: put it after \usepackage{tikz} in your preamble.

|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.