LaTeX forum ⇒ GeneralNot all segments are drawn

LaTeX specific issues not fitting into one of the other forums of this category.
bekromoularo
Posts: 2
Joined: Tue Aug 04, 2015 9:45 pm

Not all segments are drawn

Postby bekromoularo » Tue Aug 04, 2015 10:00 pm

Hello, I am a brand new user of Latex and here is my problem.
I am using a code that prints Latex code on a file. Specificaly that code is about to print some segments so i can present a computational geometry project.
The code that is printed by my programm is this:
  1. \documentclass{article}
  2. \usepackage{fullpage}
  3. \special{landscape}
  4. \usepackage{tikz}
  5. \begin{document}
  6.  
  7. \begin{tikzpicture}[scale=1.0]
  8.  
  9. \draw[step=1cm,help lines] (0,0) grid (170,60);
  10.  
  11. \draw (341/2,0) node{$x$};
  12. \draw [<->,very thick] (-1/10,0) -- (1701/10,0);
  13.  
  14. \draw (0,121/2) node{$y$};
  15. \draw [<->,very thick] (0,-1/10) -- (0,601/10);
  16.  
  17. \foreach \x/\xtext in {0,2,...,170}
  18. \draw (\x,-2/5) node{$\xtext$};
  19.  
  20. \foreach \y/\ytext in {0,2,...,60}
  21. \draw (-3/5,\y) node{$\ytext$};
  22.  
  23. \draw (90,10) -- (100,0) (40,30) -- (50,20) (120,40) -- (130,30) (150,50) -- (170,60) (50,20) -- (54,18) (130,30) -- (150,50) (100,0) -- (120,40) (20,30) -- (40,30) (10,10) -- (20,30) (0,40) -- (10,10) ;
  24.  
  25. \filldraw (100,0) circle (2pt) (150,50) circle (2pt) (54,18) circle (2pt) (20,30) circle (2pt) (90,10) circle (2pt) (120,40) circle (2pt) (10,10) circle (2pt) (40,30) circle (2pt) (50,20) circle (2pt) (170,60) circle (2pt) (130,30) circle (2pt) (0,40) circle (2pt) ;
  26.  
  27. \end{tikzpicture}
  28.  
  29. \end{document}


When I compile the Latex to pdf, I get no errors but I do not get what i want.
It only prints a partition of the grid. And i get 2 pages. The first page is empty.
When I compile it and try to open it via Yap I get invalid argument(miktex).
What's the problem here?
Thank you in advance

Tags:

User avatar
Johannes_B
Site Moderator
Posts: 4077
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Tue Aug 04, 2015 11:21 pm

Hi and welcome,

unfortunately, i am not the Tikzpert araound here. But i know one thing: The default unitlength of tikz i centimeters. That means you are setting up a grid that is 1.7 meters wide. That won't fit on a normal page, no matter of A4 or letter paper ;-)

You can work with scale or use \begin{tikzpicture}[x=1mm,y=1mm]. The latter has some drawbacks, as you may note.

You can also use the standalone class to get just the picture. When inputting it somewhere, it will be unreadable once more :-(

Somebody with more TikZ experience will come along soon, i think :-)
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

bekromoularo
Posts: 2
Joined: Tue Aug 04, 2015 9:45 pm

Postby bekromoularo » Wed Aug 05, 2015 9:16 am

Thank you for your quick answer. I managed to create a better pdf. But what is this invalid arguement error when i am using Yap?

User avatar
Johannes_B
Site Moderator
Posts: 4077
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Wed Aug 05, 2015 11:40 am

Invalid argument? yap?

Aren't you using pdflatex to get a pdf directly?

yap is sometimes used to view the dvi file. Don't. It is not a format for direct view and what you see may not be that was is going to be printed (on paper or pdf).
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.


Return to “General”

Who is online

Users browsing this forum: No registered users and 12 guests