\usepackage[hypcap]{caption}
\usepackage{amssymb}
\usepackage{mathtools}
\usepackage{times}
\usepackage{fancyhdr}
\usepackage[pdftex]{graphics}
\usepackage{graphicx}
\usepackage{latexsym}
\usepackage{amsmath,amsthm}
\usepackage[utf8x]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[brazilian]{babel}
\usepackage{ifthen}
\usepackage{xifthen}


\usepackage{listings}
\lstset{ 
  basicstyle=\footnotesize,        % the size of the fonts that are used for the code
  breakatwhitespace=false,         % sets if automatic breaks should only happen at whitespace
  %keywordstyle=\color{blue},       % keyword style
  language=Tex,                    % the language of the code
}
\usepackage{cancel}
\usepackage{enumerate}
\usepackage{geometry}
\geometry{
  a4paper,
  paperwidth=21cm,
  paperheight=35cm,
  headheight=2.5cm,
  total=17cm,
  left=3cm,
  right=3cm,
  top=3cm,
  headsep=0.5cm,
  hoffset=-1.5cm,
  bottom=3cm,
}
\usepackage{float}

\setlength{\parindent}{0cm}

\DeclareMathOperator{\Arctan}{Arctan}
\DeclareMathOperator{\Arcsin}{Arcsin}
\DeclareMathOperator{\Artanh}{Artanh}
\DeclareMathOperator{\Real}{Re}
\DeclareMathOperator{\Image}{Im}
\DeclareMathOperator{\Det}{Det}
\DeclareMathOperator{\Trace}{Tr}
\DeclareMathOperator{\Ger}{span}
\DeclareMathOperator{\Span}{span}
\DeclareMathOperator{\Dim}{dim}


\newtheorem{Axiom}{Axioma}
\newtheorem{Theorem}{Teorema}[section]
\newtheorem
    {Definition}
    [Theorem]
    {Definição}
\newtheorem
    {Proposition}
    [Theorem]
    {Proposição}
\newtheorem
    {Corollary}
    [Theorem]
    {Corolário}
\newtheorem
    {Lemma}
    [Theorem]
    {Lema}

\newtheorem
    {Comment}
    [Theorem]
    {Comment}


\newcommand{\Vector}[1]{\underline{\mathbf{#1}}}
\newcommand{\Matrix}[1]{\underline{\underline{{\mathbf{#1}}}}}

\newcommand{\Result}[1]{\underline{\underline{~~#1~~}}}
\newcommand{\Wronsky}[2]
{
   \left|\begin{array}{cc}
      #1(t)  & #2(t)\\
      #1'(t) & #2'(t)
   \end{array}\right|
}
\newcommand{\IntegralZero}[2]
{
   \int \frac{1}{#1(t)^2} e^{-#2(t) } dt
}
\newcommand{\Integral}[3]
{
   \int \frac{#1(t) #2(t) }{#3(t)} dt
}
\usepackage{pgfplots}
\pgfplotsset{compat=1.8}
\usepackage{tikz}
\usepackage{tkz-euclide}
\usetkzobj{all}
\usetikzlibrary
    {
      shapes.geometric,
      arrows,
      calc,
      intersections,
      arrows.meta,
      decorations.markings,
      positioning,
      math,
      angles,
      quotes,
      patterns,3d,
      backgrounds,
      fillbetween
    }

\makeatletter
\newcommand{\gettikzxy}[3]{%
  \tikz@scan@one@point\pgfutil@firstofone#1\relax
  \edef#2{\the\pgf@x}%
  \edef#3{\the\pgf@y}%
}
\makeatother



\tikzstyle{arrow} = [thick,-,>=stealth]
\tikzstyle{myarrow} = [thick,->,>=stealth]

\usepackage{scrextend}

\newcounter{Example}[section]
\newcommand{\Example}[2]{
   \stepcounter{Example}
   \label{item:\theExample}
   \small{\underline{\textit{Exemplo \thesection.\theExample:}} #1
     \begin{addmargin}[1em]{2em}% 1em left, 2em right
       #2
     \end{addmargin}
   }
}
\newcounter{Exercise}[section]
\newcommand{\MyExercise}[1]{
   \stepcounter{Exercise}
   \label{exercise:\thesection:\theExercise}
   \textbf{Exercício \thesection.\theExercise}.
   \begin{addmargin}[1em]{2em}
      \begin{small}\input{#1}\end{small}
   \end{addmargin}
}

\newcounter{ExamploNo}[section]
\newcommand{\MyExample}[1]{
   \stepcounter{ExamploNo}
   \label{example:\thesection:\theExamploNo}
   \small{\textbf{Exemplo \thesection.\theExamploNo}}.
   \begin{addmargin}[1em]{2em}
      \begin{small}\input{#1}\end{small}
   \end{addmargin}
}


\newcommand{\Picture}[3]
 {
   \begin{figure}[H]
   \label{#3}
   \begin{center}#1\end{center}
   \caption{#2.}
   \end{figure}
}


\usepackage{xargs}
\newcommandx{\InputIfExists}[2][2=-]
{
   \IfFileExists{#1}
   {
      \input{#1}
   }{
      #2
   }
}

