Advertisement
Guest User

Untitled

a guest
Mar 31st, 2015
267
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1. documentclass[twoside]{book}
  2.  
  3. usepackage{ tikz, pgfplots}
  4.  
  5. linespread{1.25}
  6.  
  7. usepackage{lipsum}
  8.  
  9. pagestyle{empty}
  10. usepackage{cancel}
  11.  
  12. begin{document}
  13.  
  14. section{LaTeX Spacing Issues}
  15.  
  16. lipsum[1]
  17.  
  18. %begin{example}
  19. textbf{Main Example:}
  20. several texts and equations here. It seems that if there is not enough space for the graph, then LaTeX automatically adjust the space between lines/graphs.
  21.  
  22. [y = x]
  23. Another equation,
  24. [y = x^2]
  25.  
  26. [
  27. begin{tikzpicture}[x=1cm,y=0.07cm]
  28. defxmin{0}
  29. defxmax{10}
  30. defymin{0}
  31. defymax{120}
  32.  
  33. % grid
  34. draw[style=help lines, ystep=10, xstep=1] (xmin,ymin) grid (xmax,ymax);
  35.  
  36. % axes
  37. draw[->] (xmin,ymin) -- coordinate (x axis mid) (xmax+.5,ymin) node[below] {$x$};
  38. draw[->] (xmin,ymin) -- coordinate (y axis mid) (xmin,ymax+5) node[left] {$y$};
  39.  
  40. % xticks and yticks
  41. foreach x in { 1, 2, ..., 10}
  42. node at (x, ymin) [below] {x};
  43. foreach y in {20, 40, ..., 120}
  44. node at (xmin,y) [left] {y};t
  45. draw[scale=1,domain=0:10,smooth,variable=x,blue, thick] plot ({x},{12*x});
  46.  
  47. foreach Point in {(1,12), (2,24), (3,36), (4,48), (5,60), (6,72), (7, 84)}{
  48. node at Point {textbullet};
  49. node[below=.5cm] at (x axis mid) {Number of visitors};
  50. node[left=.8cm,rotate=90] at (y axis mid) {Money taken };
  51. }
  52. end{tikzpicture}
  53. ]
  54. %end{example}
  55.  
  56. subsection*{New section}
  57. lipsum[1]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement