0

Based on this, I'd like to grid a single page using the grid style provided in the link. (Note that I don't want to grid the whole pages, just the one I want to.)

Schwale
  • 2,049

1 Answers1

5

This uses the background package to draw basically the same grid as in the linked question.

In order to switch on or off use opacity=1 or opacity=0 and backgroundsetup (in conjunction with a \clearpage)

\documentclass[10pt]{article}

\usepackage[a4paper]{geometry}
\usepackage[table]{xcolor}
\usepackage{tikz}

\usepackage{blindtext}
\usepackage[contents={},opacity=0]{background}

\definecolor{titlegrammar}{RGB}{255,128,0}



\begin{document}
\blindtext[10]
\clearpage
\backgroundsetup{position={0,0},opacity=0.3,placement=bottom,angle=0,scale=1,contents={\begin{tikzpicture}
    \fill[titlegrammar] (0cm,0cm) rectangle (\paperwidth,\paperheight);
  \filldraw[help lines,step=5mm,line width=1pt,white]      (0cm,0cm) grid (\paperwidth,\paperheight);
    \end{tikzpicture}}
}
\BgThispage
\blindtext[2]
\clearpage
\backgroundsetup{opacity=0}
\blindtext[10]

\end{document}

enter image description here

enter image description here

Update

Controlling the different opacity= values for \fill and \filldraw they can be wrapped in scope environment and using the [transparency group] option. This allows specifying separate values.

\documentclass[10pt]{article}

\usepackage[a4paper]{geometry}
\usepackage[table]{xcolor}
\usepackage{tikz}

\usepackage{blindtext}
\usepackage[contents={},opacity=0]{background}

\definecolor{titlegrammar}{RGB}{255,128,0}



\begin{document}
\blindtext[10]
\clearpage
\backgroundsetup{position={0,0},opacity=0.1,placement=bottom,angle=0,scale=1,contents={%
    \begin{tikzpicture}[opacity=0.3]
      \fill[titlegrammar] (0cm,0cm) rectangle (\paperwidth,\paperheight);
      \begin{scope}[transparency group]
      \filldraw[opacity=0.6,help lines,step=5mm,line width=1pt,white]      (0cm,0cm) grid (\paperwidth,\paperheight);
      \end{scope}
    \end{tikzpicture}}
}
\BgThispage
\blindtext[2]
\clearpage
\backgroundsetup{opacity=0}
\blindtext[10]

\end{document}
  • Thank you. Just a thing: in the link provided, you can see that the lines are actually white and the squares are orange. I'd like to flip the colors of your result. Can you do it? – Schwale Feb 26 '16 at 23:00
  • @Ustanak: See the update -- I forgot that you preferred the reversal ;-) Handle the opacity option with care and provide it to \backgroundsetup only, not to \fill etc. –  Feb 26 '16 at 23:05
  • Thank you again. I see that opacity controls both \filldraw and \fill, can we control them separately? Because I'm modifying the opacity of \fill but I want to control the opacity of \filldraw separately. – Schwale Feb 26 '16 at 23:46
  • 1
    @Ustanak: It might be possible, but background is effectively a tikz package, i.e. it uses the same controls as \filldraw etc. Perhaps with layers, but that needs some work to do. –  Feb 26 '16 at 23:47
  • Okay, let me know if you can pull it off! – Schwale Feb 26 '16 at 23:50
  • @Ustanak: Sorry, I forgot about this question -- I've added a solution about the several opacity parameters -- use \begin{scope}[transparency group]...\end{scope} –  Mar 28 '16 at 21:08