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.)
Asked
Active
Viewed 1,670 times
1 Answers
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}
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
opacityoption with care and provide it to\backgroundsetuponly, not to\filletc. – Feb 26 '16 at 23:05 -
Thank you again. I see that
opacitycontrols both\filldrawand\fill, can we control them separately? Because I'm modifying the opacity of\fillbut I want to control the opacity of\filldrawseparately. – Schwale Feb 26 '16 at 23:46 -
1@Ustanak: It might be possible, but
backgroundis effectively atikzpackage, i.e. it uses the same controls as\filldrawetc. Perhaps withlayers, but that needs some work to do. – Feb 26 '16 at 23:47 -
-
@Ustanak: Sorry, I forgot about this question -- I've added a solution about the several
opacityparameters -- use\begin{scope}[transparency group]...\end{scope}– Mar 28 '16 at 21:08

