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.)

  • I've adjusted the answer some time ago, please have look if this is what you desired! – user31729 Sep 4 '16 at 16:44
  • 1
    @ChristianHupfer I thought I'd done this before. Thanks for the reminder. – Alejandro Apr 3 '17 at 1:11
3

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? – Alejandro 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. – user31729 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. – Alejandro 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. – user31729 Feb 26 '16 at 23:47
  • Okay, let me know if you can pull it off! – Alejandro Feb 26 '16 at 23:50

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.