Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Is the TikZ package incompatible with other LaTeX packages? The preamble of my code is as follows. When I load the TikZ package, I cannot compile my file. Any help would be much appreicated!

\documentclass[english,12pt]{article}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{babel}
  \usepackage[sc,osf]{mathpazo} 
\usepackage[dvipsnames]{xcolor}

%% Set Paper Margin
\usepackage[letterpaper]{geometry}
\geometry{verbose,tmargin=1in,bmargin=1in,lmargin=1in,rmargin=1in}

%% Page Style/Numbering 
\usepackage{fancyhdr} % for making fancy header/footer
\usepackage{lastpage} % for page numbering style
  \pagestyle{fancy}
  %%"Page # of ##" -- Comment out to get default page numbering
  \cfoot{Page \thepage\ of \pageref*{LastPage}} % text in center footer
  %% Header
  \lhead{} % text in left header
  \rhead{} % text in right header
  \chead{} % text in center header
  \renewcommand{\headrulewidth}{0pt} % border line in header
  %% Set Line Spacing
  \usepackage{setspace}
  \onehalfspacing % Default line space is set to 1.5

%% Math Packages
\usepackage{amsthm}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{mathtools}
\usepackage{esint} % use new integral symbols
\usepackage{nicefrac}
  %% New Math Commands
  \DeclareMathOperator*{\argmax}{argmax}
  \DeclareMathOperator*{\argmin}{argmin}
  %% Defining theorem environments
  \theoremstyle{definition}
  \newtheorem{definition}{Definition}
  \providecommand*{\definitionautorefname}{Definition}
  \newtheorem{assumption}{Assumption}
  \providecommand*{\assumptionautorefname}{Assumption}

%% Other Packages
\usepackage{graphicx}
\usepackage{tikz}
\usepackage[hypcap]{caption}
\usepackage[labelformat=simple]{subcaption}
  % autoref as "Fig 1(a)" instead of "Fig 1a"
  \renewcommand\thesubfigure{(\alph{subfigure})} 

%% BibTex
\usepackage[authoryear]{natbib}
  % Defines citations with possessives "Author's (year)"
  \def\citeapos#1{\citeauthor{#1}'s (\citeyear{#1})}

%% Hyperlinks and PDF Properties
\usepackage[pagebackref]{hyperref}
\hypersetup{pdftitle={Cheap Talk: A Review},%
pdfauthor={Kevin Chen},pdfstartview=FitH,%
bookmarks=true,bookmarksnumbered=true,bookmarksopen=true,bookmarksopenlevel=2,%
breaklinks=true,,unicode=true,%
colorlinks=true,citecolor=,linkcolor=}
  \renewcommand*{\backref}[1]{[p. #1]} % add [p. ] to backref
share|improve this question
2  
Have you tried uncommenting the other packages to find out where the clash comes from? –  Jake Aug 31 '12 at 10:10
1  
I tried to build a minimal-working-example with your preamble and it compiles. Could you say precisely which is the error you get? –  Claudio Fiandrino Aug 31 '12 at 10:11
add comment

closed as too localized by percusse, Andrew Stacey, Paul Gaborit, Marco Daniel, Claudio Fiandrino Sep 18 '12 at 18:51

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer

mathtools loads and modifies amsmath, subcaption loads caption and TikZ loads xcolor and graphicx by default.

Also this file results with no errors.

\documentclass[english,12pt]{article}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{babel}
\usepackage[sc,osf]{mathpazo} 
\usepackage[dvipsnames]{xcolor}

%% Set Paper Margin
\usepackage[letterpaper]{geometry}
\geometry{verbose,tmargin=1in,bmargin=1in,lmargin=1in,rmargin=1in}

%% Page Style/Numbering 
\usepackage{fancyhdr} % for making fancy header/footer
\usepackage{lastpage} % for page numbering style
  \pagestyle{fancy}
  %%"Page # of ##" -- Comment out to get default page numbering
  \cfoot{Page \thepage\ of \pageref*{LastPage}} % text in center footer
  %% Header
  \lhead{} % text in left header
  \rhead{} % text in right header
  \chead{} % text in center header
  \renewcommand{\headrulewidth}{0pt} % border line in header
  %% Set Line Spacing
  \usepackage{setspace}
  \onehalfspacing % Default line space is set to 1.5

%% Math Packages
\usepackage{amsthm,amsmath,amssymb,mathtools,esint,nicefrac}
  %% New Math Commands
  \DeclareMathOperator*{\argmax}{argmax}
  \DeclareMathOperator*{\argmin}{argmin}
  %% Defining theorem environments
  \theoremstyle{definition}
  \newtheorem{definition}{Definition}
  \providecommand*{\definitionautorefname}{Definition}
  \newtheorem{assumption}{Assumption}
  \providecommand*{\assumptionautorefname}{Assumption}

%% Other Packages

\usepackage{graphicx,tikz}
\usepackage{tikz}
\usepackage[hypcap]{caption}
\usepackage[labelformat=simple]{subcaption}
  % autoref as "Fig 1(a)" instead of "Fig 1a"
  \renewcommand\thesubfigure{(\alph{subfigure})} 

%% BibTex
\usepackage[authoryear]{natbib}
  % Defines citations with possessives "Author's (year)"
  \def\citeapos#1{\citeauthor{#1}'s (\citeyear{#1})}

%% Hyperlinks and PDF Properties
\usepackage[pagebackref]{hyperref}
\hypersetup{pdftitle={Cheap Talk: A Review},%
pdfauthor={Kevin Chen},pdfstartview=FitH,%
bookmarksopenlevel=2,%
breaklinks=true,unicode=true,%
colorlinks=true,citecolor=,linkcolor=}
  \renewcommand*{\backref}[1]{[p. #1]} % add [p. ] to backref


\begin{document}
\begin{tikzpicture}
    \shade (0,0) rectangle(3,3);
    \draw[ultra thick,red] (0,0) -- (3,1);
\end{tikzpicture}

\end{document}
share|improve this answer
add comment

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