Graphics, Figures & TablesStart position of grid

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
bstex
Posts: 69
Joined: Mon Oct 23, 2017 10:22 am

Start position of grid

Post by bstex »

Hi.
I'm trying to create a 18 x 9 path of grid, because I want to create a periodic table by putting a chemical element on every position of grid.

How can I make the grid to start from the lower left corner of the page?

(It's in the draw phase now. Later I'll make it a path.)

Thank you.

Code: Select all

\documentclass[a4paper,openright,landscape]{book}

\usepackage{tikz}
\usetikzlibrary{shapes,calc,positioning}

\begin{document}

\begin{tikzpicture}

\draw[help lines] (0,0) grid [xstep=1.25cm, ystep=1.5cm] (18,9);

\end{tikzpicture}

\end{document}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
Ijon Tichy
Posts: 640
Joined: Mon Dec 24, 2018 10:12 am

Start position of grid

Post by Ijon Tichy »

If you want to put the grid outside the text area, you first of all have to use options remember picture and overlay for the picture. Then you can use the current page coordinate system. See the tikz manual for more information

Code: Select all

\documentclass[a4paper,landscape]{book}

\usepackage{tikz}
\usetikzlibrary{shapes,calc,positioning}

\begin{document}
\pagestyle{empty}
\begin{tikzpicture}[overlay,remember picture]
\draw[help lines] (current page.south west) grid [xstep=1.25cm, ystep=1.5cm] (22,17);
\end{tikzpicture}

\end{document}
Sorry, but I can no longer participate here as the administrator is trampling on my wishes on one of his other platforms. :cry:
Post Reply