I have created a simple graph thanks to a tutorial. The graph itself works and compiles if I just use the packages the tutorial said and it compiles perfectly, but when I add the graph to my latex file it doesn't compile. I know it has to do with the packages... Can anyone help me adding/modifying the correct packages?
I know it works. The other code also works separately. What I need is the figure to work in the second file. As I say the other file also works.
Maybe I don't write the code as it is intended. Note that I have removed and created a simple file so that you can help me. It's not the final nor the code itself. Just the core of what I want to do. Both files work by themselves, and what I am asking for is for help to merge both in a compilable file. –
This is the graph file
\documentclass{article}
\usepackage{pgf}
\usepackage{tikz}
\usetikzlibrary{arrows,automata}
\usepackage[latin1]{inputenc}
\begin{document}
\begin{tikzpicture}[->,>=stealth',shorten >=2pt,auto,node distance=2.8cm,
semithick]
\tikzstyle{every state}=[fill=gray,draw=none,text=white]
\node[state] (A) {$1$};
\node[state] (B) [above right of=A] {$2$};
\node[state] (C) [right of=B ] {$3$};
\path
(A) edge node {} (B)
edge node {} (C)
(B) edge node {} (C)
(C) edge node {} (A);
\end{tikzpicture}
\end{document}
The problem comes when I want to add my graph to a Latex file I am creating that needs other packages:
\documentclass{article}
\usepackage{lmodern}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[spanish,activeacute]{babel}
\usepackage{amsmath, amssymb}
\usepackage{graphicx}
\graphicspath{ {F:\Espacio de trabajo/} }
\title{Problema}
\author{MNLR}
\begin{document}
\maketitle
\chapter{\textit{\begin{flushleft}\normalsize{ Things I have to do... }\end{flushleft}}}
\chapter{\begin{flushleft}\normalsize{ blah blah }\end{flushleft}}
\chapter{\begin{flushleft}\normalsize{
\begin{itemize}
\item It's times like this ...
\item \textbf{that make me say }
\end{itemize}
}\end{flushleft}}
\end{document}
I do know everything is working. I just need to combine both in one file. This is, to put the graph in the other code.
Thanks.
articleclass defines no\chapter. Usereportorbookfor that. Second, you're not supposed to write formatting commands as an argument to \chapter. That's against the spirit of LaTeX, and here,flushleftanditemizewon't work. What you can do is redefining chapters formatting in your preamble with a dedicated package such astitlesec. You should take a look at its documentation. – Bernard Oct 18 '14 at 22:27iniciois not defined, If i remove it then the code runs perfectly. – skpblack Oct 18 '14 at 22:29\chaptertakes the heading as argument, not the entire chapter, so it should be something like\chapter{Introduction}alsoF:\Espacio de trabajo/} }is not goung to work the\needs to be/or tex will see it as a tex command, and spaces in filenames are tricky, I'd use a folder without spaces initially. – David Carlisle Oct 18 '14 at 22:50inputencin the first file. – cfr Oct 19 '14 at 00:29