3

So, I'm new to LaTeX, I want to draw some shapes with Tikz. It gives me the error as said in the title.

\documentclass[12pt,oneside,a4paper]{article}
\begin{document}
\begin{center} 
\huge  \textbf{An Interesting Idea for Dimensions}
\normalsize
\end{center}
\begin{flushleft}
In this article, I'll be explaining my idea of the "dimensional        transformation" of the universe from zero-dimensional space to three-dimensional  space. The article also includes an idea for parallel universes. 
\end{flushleft}
\textbf{1. Compressing the Matter.} 

\begin{tikzpicture}
\draw ; (0,0) -- (0,4)
\end{tikzpicture}
\end{document}

Help please :)

Edit:

The error is this :

LOG FILE : This is pdfTeX, Version 3.14159265-2.6-1.40.18 (MiKTeX 2.9.6300 64-bit) (preloaded format=pdflatex 2017.6.1) 1 JUN 2017 21:06 entering extended mode **./untitled.tex (untitled.tex LaTeX2e <2017-04-15> Babel <3.9r> and hyphenation patterns for 75 language(s) loaded. ("C:\Program Files\MiKTeX 2.9\tex\latex\base\article.cls" Document Class: article 2014/09/29 v1.4h Standard LaTeX document class ("C:\Program Files\MiKTeX 2.9\tex\latex\base\size12.clo" File: size12.clo 2014/09/29 v1.4h Standard LaTeX file (size option) ) \c@part=\count79 \c@section=\count80 \c@subsection=\count81 \c@subsubsection=\count82 \c@paragraph=\count83 \c@subparagraph=\count84 \c@figure=\count85 \c@table=\count86 \abovecaptionskip=\skip41 \belowcaptionskip=\skip42 \bibindent=\dimen102 ) (untitled.aux) \openout1 = untitled.aux'. LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 2. LaTeX Font Info: ... okay on input line 2. LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 2. LaTeX Font Info: ... okay on input line 2. LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 2. LaTeX Font Info: ... okay on input line 2. LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 2. LaTeX Font Info: ... okay on input line 2. LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 2. LaTeX Font Info: ... okay on input line 2. LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 2. LaTeX Font Info: ... okay on input line 2. ! LaTeX Error: Environment tikzpicture undefined. See the LaTeX manual or LaTeX Companion for explanation. Type H <return> for immediate help. ... l.12 \begin{tikzpicture} Your command was ignored. Type I <command> <return> to replace it with another command, or <return> to continue without it. ! Undefined control sequence. l.13 \draw ; (0,0) -- (0,4) The control sequence at the end of the top line of your error message was never \def'ed. If you have misspelled it (e.g.,\hobx'), type I' and the correct spelling (e.g.,I\hbox'). Otherwise just continue, and I'll forget about whatever was undefined. ! LaTeX Error: \begin{document} ended by \end{tikzpicture}. See the LaTeX manual or LaTeX Companion for explanation. Type H for immediate help. ... l.14 \end{tikzpicture} Your command was ignored. Type I to replace it with another command, or to continue without it. [1 {C:/Users/atmac/AppData/Local/MiKTeX/2.9/pdftex/config/pdftex.map}] (untitled.aux) ) Here is how much of TeX's memory you used: 211 strings out of 493328 2211 string characters out of 3139125 54405 words of memory out of 3000000 3828 multiletter control sequences out of 15000+200000 4851 words of font info for 18 fonts, out of 3000000 for 9000 1141 hyphenation exceptions out of 8191 22i,4n,19p,228b,127s stack positions out of 5000i,500n,10000p,200000b,50000s Output written on untitled.pdf (1 page, 26892 bytes). PDF statistics: 14 PDF objects out of 1000 (max. 8388607) 0 named destinations out of 1000 (max. 500000) 1 words of extra memory for PDF output out of 10000 (max. 10000000)

  • 3
    you should include \usepackage{tikz} for starters, between \documentclass and \begin{document} – Moriambar Jun 1 '17 at 18:11
7

LaTeX is sort of package oriented, meaning that you include packages with definitions of new commands and environments (and some other things). The environment tikzpicture is defined in the package tikz so you need to write \usepackage{tikz} before \begin{document}.

There are some other things also in your code. I think you should let LaTeX worry about fonts and stuff for your title and sections, at least as a start. Use the title format defined in the class you are using. And normally LaTeX will align both the left and right margins of the text. If you only want aligned left margin try to use \raggedright. Then you only need to write this once.

It looks like you need a good introduction to LaTeX. There are several out there, just Google and you will find. I personally like The Not So Short Introduction to LaTeX but there are more suggestions at What are good learning resources for a LaTeX beginner?

As a start I would change your article as follows:

\documentclass[12pt,oneside,a4paper]{article}
\usepackage{tikz}
\title{An Interesting Idea for Dimensions}
\author{Dim Ension}
\begin{document}
\maketitle
\section{Introduction}
In this article, I'll be explaining my idea of the "dimensional transformation" of the universe from zero-dimensional space to three-dimensional  space. The article also includes an idea for parallel universes. 
\subsection{Compressing the Matter}
\begin{tikzpicture}
  \draw (0,0) -- (0,4);
  \draw (2,2) circle (2);
\end{tikzpicture}
\end{document}

enter image description here

  • Thank you very much, I'm really new to LaTeX because I'm currently a high school student and I've just heard that "LaTeX" exists. t – Onat Atmaca Jun 2 '17 at 10:51
  • 1
    +1... although you missed the quotes... should be ``dimensional transformation'' ;-) – Rmano Jun 2 '17 at 14:11

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.