我想为我的课堂笔记做一个封面!我可以画板。我不知道如何把条带(包含讲义的标题)放在板上:
\documentclass{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[x=1cm]
\foreach \x in {0,...,7} \foreach \y in {0,...,11}
{
\pgfmathparse{mod(\x+\y,2) ? "brown" : "white"}
\edef\colour{\pgfmathresult}
\path[fill=\colour] (\x,\y) rectangle ++ (1,1);
}
\draw (0,0)--(0,12)--(8,12)--(8,0)--cycle;
\end{tikzpicture}
\end{document}
答案1
条纹可以通过简单\node
填充来实现,填充颜色为所需颜色,预定义宽度和高度,并可以选择overlay
覆盖网格;类似这样的操作(请根据需要随意进行调整):
\documentclass{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[x=1cm]
\foreach \x in {0,...,7}
\foreach \y in {0,...,11}
{
\pgfmathparse{mod(\x+\y,2) ? "brown" : "white"}
\edef\colour{\pgfmathresult}
\path[fill=\colour] (\x,\y) rectangle ++ (1,1);
}
\draw (0,0)--(0,12)--(8,12)--(8,0)--cycle;
\node[
overlay,
outer sep=0pt,
text width=8cm,
minimum height=2cm,
fill=yellow!85!black,
anchor=north west,
minimum height=2cm,
font=\LARGE\sffamily
]
at (0,9)
{Some text goes here; it is the title of the notes};
\end{tikzpicture}
\end{document}