你好。错误报告是“Package tikz 错误:抱歉,图像外部化失败:生成的图像为空。”你能帮我吗?

你好。错误报告是“Package tikz 错误:抱歉,图像外部化失败:生成的图像为空。”你能帮我吗?
\raggedbottom
\documentclass[12pt]{scrbook}
\usepackage[usenames,dvipsnames]{xcolor}
\usepackage{mathptmx}
\usepackage{asymptote}
\usepackage{float}
%\usepackage[applemac]{inputenc}
\usepackage{makeidx}
%\usepackage{mathpmx}
%\usepackage[usenames,dvipsnames]{xcolor}
%\usepackage[dvips]{xcolor}
%\usetikzlibrary{arrows}
%\usepgfplotslibrary{external}
%\tikzexternalize
\usepackage{tikz-cd}
%\usepackage{fancyhdr}
\usepackage{scrlayer-scrpage}
\usepackage{amsthm}
\usepackage{graphicx}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{amsfonts}
\usepackage{lmodern}
\usepackage{forest}
\usepackage[section]{placeins}
%\usepackage{xcolor}
% margens da pagina
%\usepackage{xcolor}
\usepackage[paperwidth=17cm,paperheight=24cm]{geometry}
\usepackage[english]{babel}
\geometry{verbose,tmargin=25mm,bmargin=15mm,lmargin=25mm,rmargin=15mm,headheight=5mm,headsep=10mm,footskip=5mm}
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{3}
\setlength{\parskip}{1mm}
\setlength{\parindent}{0pt}
% fim de configurar

%\usepackage[english]{babel}
\usepackage{amsmath}
%\usepackage{amsfonts}
\usepackage{bbm}
%\usepackage[unicode=true,
% bookmarks=true,bookmarksnumbered=false,bookmarksopen=false,
%%breaklinks=false,pdfborder={0 0 1},backref=false,colorlinks=false]
% {hyperref}
\usepackage{setspace}
\usepackage{pgf}
\usepackage{tikz}
\usepackage{pgfplots}
\usetikzlibrary{decorations.markings}
\usetikzlibrary{decorations.text}
\usetikzlibrary{arrows}
%\usepackage{addplot3d}[surf]
\usetikzlibrary{calc}
\tikzset{every picture/.style=thick}
\tikzset{>=latex}
%\pgfplotsset{width=7cm,compat=1.12}
\pgfplotsset{width=7cm,compat=1.12}

\usepackage{graphicx}
\usepackage{epstopdf} % to turn my eps files into pdf
\usepackage{pgfplots}
\usepackage{tikz}
\usepgfplotslibrary{external}
\tikzexternalize{main}
\usepackage{pst-plot}
%\usepackage{auto-pst-pdf}
\tikzexternaldisable
\tikzset{external/export=false}
\usetikzlibrary{external}
\tikzexternalize[prefix=tikz]
%\usepgfplotslibrary{colormaps}
% 3D
\usepackage{tikz-3dplot}
\usetikzlibrary{3d,shadings,patterns}
\usetikzlibrary{intersections}
\usepackage[utf8]{inputenc}
%\usepackage{pgf,tikz}
\usepackage{mathrsfs}
%\usepackage[english]{babel}
% or whatever

%\usepackage[latin1]{inputenc}
% or whatever
%\usepackage{tikz-3dplot}
\usepackage{pstricks-add}
\usepackage{pst-plot}
%\usepackage{pstricks}
\usepackage{pst-solides3d}
%\usepackage{pstrics}
\usepgfplotslibrary{colormaps}
%\usepackage[usenames,dvipsnames]{xcolor}

%Codigo  do diagrama de  tikz
\newcommand{\chainx}{0}
\newcommand{\chainy}{0}
\def\chainleft{(-1)}
\def\chainright{1}
\def\chainup{1}
\def\chaindown{(-1)}
\makeatletter
\newcommand{\movechainxy}[4]{%
\g@addto@macro\chainx{ + #3 * #2 * cos(#1)}
\g@addto@macro\chainy{ + #4 * #2 * sin(#1)}
}
\makeatother
\newcommand{\setchainxy}[2]{%
\renewcommand{\chainx}{#1}
\renewcommand{\chainy}{#2}
}
\newcommand{\chainlegs}[7]{%
\draw[#3, very thick] ({\chainx}, {\chainy}) -- ({\chainx - 2 * cos(#1)}, {\chainy - #2 * sin(#1)});
\draw[#4, very thick] ({\chainx}, {\chainy}) -- ({\chainx + 2 * cos(#1)}, {\chainy - #2 * sin(#1)});
\draw[fill, #6] ({\chainx}, {\chainy}) circle [radius=2pt];
\node[#5, #6] at ({\chainx}, {\chainy}) {#7};
}



%codigo  do  diagramade tikz
%\usepackage{times}
%\usepackage[T1]{fontenc}
% Or whatever. Note that the encoding and the font should match. If T1
% does not look nice, try deleting the line with the fontenc.
%\newcommand{\R}{\mathbb{R}}
%\newcommand{\N}{\mathbb{N}}
%\onehalfspacing
%\doublespacing
\setstretch{1.9}
%\hypersetup{pdftitle={Cálculo I},
%pdfauthor={Luís António de Almeida Vieira},
%colorlinks=true,linkcolor= blue}

%--------------------

%\DeclareMathOperator{\sin}{sen}
%\DeclareMathOperator{\tan}{tg}
%\DeclareMathOperator{\cot}{cotg}
%\DeclareMathOperator{\cos}{cos}
% \DeclareMathOperator{\sec}{sec}
%\DeclareMathOperator{\csc}{cosec}
%\DeclareMathOperator{\sinh}{senh}
%\DeclareMathOperator{\tanh}{tgh}
%\DeclareMathOperator{\coth}{cotgh}
%\DeclareMathOperator{\cosh}{cosh}
\DeclareMathOperator{\sech}{sech}
\DeclareMathOperator{\csch}{cosech}
%\DeclareMathOperator{\arctan}{\arctg}
%\DeclareMathOperator{\arcsin}{\arcsen}
\DeclareMathOperator{\arcsec}{arcsec}
\DeclareMathOperator{\arccot}{arccot}
\DeclareMathOperator{\arccsc}{arccosec}
\DeclareMathOperator{\arccosh}{arccosh}
\DeclareMathOperator{\arcsinh}{arcsinh}
\DeclareMathOperator{\arctanh}{arctgh}
\DeclareMathOperator{\arcsech}{arcsech}
\DeclareMathOperator{\arccsch}{arccosesh}
\DeclareMathOperator{\arccoth}{arccotgh}
%\renewcommand{\sin}{sen}
%\renewcommand{\tan}{tg}
%\renewcommand{\cot}{cotg}
%\renewcommand{\csc}{cosec}
\newcommand{\preface}{Pref\'acio}
% \renewcommand{\arcsin}{arcsen}
%\renewcommand{\arctan}{arctg}
\renewcommand{\arccot}{arccotg}
\renewcommand{\arccos}{arccos}
\renewcommand{\arccsc}{arccosec}
%\renewcommand{\sin}{\sen}
\renewcommand{\tanh}{tgh}
\renewcommand{\coth}{cotgh}
\renewcommand{\csch}{cosech}
%\renewcommand{\arcsinh}{arcsenh}
\renewcommand{\arctanh}{arctgh}
\renewcommand{\arccoth}{arccotgh}
\renewcommand{\arcsinh}{arcsenh}
\renewcommand{\arccos}{arccosh}
\renewcommand{\arcsin}{arcsen}
\renewcommand{\arccsch}{arccosech}
\newcommand{\R}{\mathbb{R}}
\newcommand{\N}{\mathbb{N}}
%\newtheorem{dedication}{Dedicat\'oria}
\newtheorem{definition}{Definition}[section]
\newtheorem{answer}{Answer}[section]
\newtheorem{theorem}{Theorem}[section]
%\renewcommand{\dedication}{Dedicat\'oria}
%\renewcommand{\preface}{Pref\'acio}
%\renewcommand{\acknowledgment}{Agradecimentos}
%\newtheorem{dedication}{Dedica\c c\~ao}
%\newtheorem{preface}{\center{Pref\'acio}}
%\renewcommand{preface}{\centering{Pref\'acio}}
%\newtheorem{preamble}{Pref\'acio}
%\newtheorem{acknowledgment}{Agradecimento}
\newtheorem{remark}{Observation}[section]
\newtheorem{example}{Example}[section]
%\newtheorem{problem}{}[section]
\newtheorem{problem}{Exercise}[section]
%\newtheorem{problem}{}
%\newtheorem{lemma}{Lema}[section]
%\newtheorem{solution}{Resolu\c c\~ao}[section]
\newtheorem{solution}{Resolution}[section]
\newtheorem{proposition1}{Proposi\c{c}\~ao}[section]
\newtheorem{corollary}{Corollary}[section]
%\newtheorem{exercise}{Exerc\'{\i}cio}
%\newtheorem{problem}{Exerc\'{\i}cio}[section]
%\newtheorem{solution}{Solu\c c\~ao}[section]
%\newtheorem{problem1}{Exerc\'{\i}cio}[section]

%------------
\theoremstyle{plain}
%\theoremstyle{plain}
%\newcounter{exercise}[chapter]
%\renewcommand\theexercise{\thechapter.\arabic{exercise}}
%\newtheorem{xexercise}[exercise]{Exerc\'{\i}cio}
%\newtheorem*{xsol}{Solu\c c\~ao do  Exercício}
%\hyphenation{comple-xi-fying}
%\newenvironment{prob}[1]
%{\begin{xprob}\label{#1}\def\thissoln{\hyperref[sol-#1]{Solution}}}
%{\par\thissoln\end{xprob}}
\newenvironment{exercise}[1]
{\begin{xexercise}\label{#1}\def\thissoln{\hyperref[sol-#1]{}}}
{\par \thissoln\end{xexercise}}
\newenvironment{sol}[1]
{\begin{xsol}{ \ref{#1}}\label{sol-#1}}
{\end{xsol}}


%------------
%{proof}{Prova}[section]
%\newtheorem{definition}{Defini\c{c}\~ao}[section]
%\newenvironment{demo}{\endsloppypar\noindent\bgroup\small
%            {\bf{Demonstra\c c{\~a}o:}\\ \indent}
%            }{\samepage\null\hfill \mbox{$\diamond$}\endsloppypar\egroup}
%\newcommand{\titulo}[1]{\mbox{} \\ \noindent \textit{\textbf{\large #1}}\\}
% see the list of further useful packages
% in the Reference Guide

\makeindex             % used for the subject

%-------------------
%\mbox{}
\title{Analysis in $\R^n$}

\subtitle{Theory and  Exercises}
\date{}
\author{Rui Jorge de Almeida  Soares Gonçalves\\
Department of  Civil Engineering,\\
University  of Porto,\\
Portugal.}
%\author{Lu\'{\i}s Ant\'onio de  Almeida Vieira \footnote{\hrule mailto:[email protected]}
%\footnote{Section of  Mathematics, Department  of  Cívil  Engineering, University of Porto, Portugal}}

\pagestyle{empty}
\tikzset{
  treenode/.style = {align=center, inner sep=0pt, text centered,
    font=\sffamily},
  arn_n/.style = {treenode, circle, white, font=\sffamily\bfseries, draw=black,
    fill=black, text width=1.5em},% arbre rouge noir, noeud noir
  arn_r/.style = {treenode, circle, red, draw=red,
    text width=1.5em, very thick},% arbre rouge noir, noeud rouge
  arn_x/.style = {treenode, rectangle, draw=black,
    minimum width=0.5em, minimum height=0.5em}% arbre rouge noir, nil
}
\tikzset{near start abs/.style={xshift=1cm}}
\tikzset{
  % style to apply some styles to each segment of a path
  on each segment/.style={
    decorate,
    decoration={
      show path construction,
      moveto code={},
      lineto code={
        \path [#1]
        (\tikzinputsegmentfirst) -- (\tikzinputsegmentlast);
      },
      curveto code={
        \path [#1] (\tikzinputsegmentfirst)
        .. controls
        (\tikzinputsegmentsupporta) and (\tikzinputsegmentsupportb)
        ..
        (\tikzinputsegmentlast);
      },
      closepath code={
        \path [#1]
        (\tikzinputsegmentfirst) -- (\tikzinputsegmentlast);
      },
    },
  },
  % style to add an arrow in the middle of a path
  mid arrow/.style={postaction={decorate,decoration={
        markings,
        mark=at position .5 with {\arrow[#1]{stealth}}
      }}},
}
\begin{document}
\tikzset{middlearrow/.style={
        decoration={markings,
            mark= at position 0.5 with {\arrow{#1}} ,
        },
        postaction={decorate}
    }
}
%\hrule
%\usepackage{fancyhdr}
%\pagestyle{myheadings}

%\end{flushright}

%\vfill{}
%\newpage
%\thispagestyle{empty}
%\mbox{}

%\newpage
%\thispagestyle{empty}
%\mbox{}
\maketitle
%\pgfplotsset{compat=newest}
%\pagestyle{fancy}
\pagestyle{scrplain}
%\fancyhf{}xx
%\rhead{Calculus in $\R^n$}
%\lhead{Analysis in $\R^n$}

%\fancypagestyle{plain}{}
\tableofcontents
%\addtocontents{appendix}
%\thispagestyle{plain}
\mbox{}
%\include{funcoes_de_n_variaveis_eng}
%\include{Function_of_several_variables}

%\include{maximominimo_eng}
%\include{maximominimo}
%\include{integracaoduplafinal2020}
%\include{integracaoduplafinal2020_eng}
%\include{solucao}
%\include{integracao_tripla_eng}
%\include{integracao_em_curvas_eng}
%\include{integracao_em_superficies_eng}
%\include{capitulo3333curvesinternational}
%\include{capitulo4444int}
%\include{chapterprimitivasimediatas}
%\include{chaptersubstituicao}
%\include{chapterintegracaopartes}\overline{}
%%\include{chaptersubstituicaopartes}
%\include{chaptertrigonometria}
%\include{chaptercomplexos}\overleftarrow{}
%\include{exercicios}
%\include{solutions}


%\chapter{Bibliografia}
%\rhead{Índice Bibliográfico}
%\lhead{Índice Bibliográfico}
\begin{thebibliography}{12}
\bibitem{Agudo} Agudo, D., \textit{Differential and Integral Calculus in $\mathbb{R}^{n}$}, Scolar Editions, Lisbon, 1973.
\bibitem{Azenha} Azenha, A. and  Jer\'onimo, M., \textit{Eleme
nts of Differential and Integral Calculus in
 $\mathbb{R}$ and $\mathbb{R}^{n}$}, McGraw-Hill,  1995.
\bibitem {Breda} Breda, A. and Costa, J. \textit{Calculus with functions of several variables},
McGraw-Hill, 1996.
\bibitem{Edwards} Edwards, C. H. and Penney, D.E., \textit{Calculus with Analytic Geometry}. 5th
ed., Prentice-Hall,  1997.
\bibitem{ferreira} Ferreira, C. J. , \textit{Introduction to Mathematical Analysis}, Calouste Gulbenkian Fundation, Lisbon, 1987.
\bibitem{ Madureira}  Madureira, L., \textit{Problems  of Differential Equations and Laplace Transform }, 3.ª edition,  FEUP editions, 2010.
\bibitem{kreyzig} Kreyszig, E. , \textit{Advanced Engineering Mathematics}, John Wiley\&Sons, Inc, 1988.
\bibitem{marsden} Marsden, J. and Weinstein, A. \textit{Calculus, vol.I,II and III}, Springer-Verlag, 1985.
\bibitem{marsden} Marsden, J. E. and Tromba, A. J. , \textit{Vector Calculus}, W. H. Freeman and Company, 1999.

\bibitem{McCallum} McCallum, Hughes-Hallett and  Gleason et al., \textit{Calculus - multivariable}.
6th ed., International Edition, Wiley,  2013.
\bibitem{Oliveira} Oliveira, C, E. N., \textit{C\'alculo Diferencial e Integral, Vol.II-C\'alculo de Integrais Indefinidos}, Asa, Porto, 1973.
\bibitem{Oliveira1} Oliveira, C, E. N., \textit{C\'alculo Diferencial e Integral, Vol.III-C\'alculo de integrais indefinidos de fun\c c\~oes racionais, irracionais e transcendentes}, Asa, Porto, 1975.
\bibitem{Ostrowski} Ostrowski, A., \textit{Lessons   on Differential and Integral Calculus}. Vol. III,  Fondation Calouste Gulbenkian, 1981.
\bibitem{Rade} Rade, L. ; Westergren, B. \textit{Mathematics Handbook for Science and Engineering},
5th ed.,  Springer Verlag, 2004.
\bibitem{Piskounov} Piskounov, N., \textit{Differential and Integral Calculus, Vol 1 and 2}, Lopes  da Silva Editions, 1993.
\bibitem{Swokowsky} Swokowsky, E., \textit{Calculus with Analitic Geometry}. Vol. 2, 2ª ed.,
 Makron Books, 1994.
\bibitem{vieira} Vieira, L.A.A. , \textit{Techniques  of Integration},  Lambert Academic Publishing, 2017.
\end{thebibliography}
\end{document}

相关内容