I'm making a list of problems and at the end of the statement of each question I'm making vertical and horizontal lines using tikzpicture. I'm setting the number of rows and columns manually. The number of columns is fixed, but the number of lines, I have to manually adjust each question, because the size of the statement is different. At the end of each question I use \newpage. I was wondering if there is a way to do this automatically. My code is
\documentclass[11pt,twoside,a4paper]{article}
\usepackage[left=1cm,right=1cm,top=1cm,bottom=1.8cm]{geometry}% Margens
\usepackage{indentfirst} % Coloca parágrafo no início texto
\usepackage[portuguese]{babel} % Linguagem português
\usepackage[pdftex]{hyperref} % Para criar anexar links
%\usepackage{lmodern} % Usa a fonte Latin Modern
\usepackage{multicol} % Texto em duas colunas
\setlength{\parindent}{0cm}
\newcommand{\fixspacing}{\vspace{0pt plus 1filll}\mbox{}}
\usepackage{xcolor}
\usepackage{tikz}
\tikzstyle{dashdotted}=[dash pattern=on 9pt off 2pt on \the\pgflinewidth off 2pt]
\usetikzlibrary{positioning}
%\setlength{\columnsep}{0.7cm} % Separação entre as colunas
%\usepackage{chemformula} % Para escrever fórmulas químicas
%\usepackage[version=4]{mhchem} % |
%\usetikzlibrary{fit} % |Formatação das fórmulas químicas
%\usepackage{mol2chemfig} % |
%\usepackage{caption} % Colocar caption em minipage
%\usepackage[font=footnotesize,labelfont=bf]{caption} %Coloca a "Figura" em negrito nas legendas
%\usepackage{microtype} % para melhorias de justificação
%\usepackage[brazilian,hyperpageref]{backref} % Paginas com as citações na bibliografia
%\usepackage[alf]{abntex2cite} % Citações padrão ABNT
%\usepackage{lipsum} % para geração de dummy text
\usepackage{subfigure} % Adicionar subfiguras
%\usepackage{fontawesome} % Fonte e simbolos
\usepackage{xcolor} % Mudar cor das palavras
\usepackage{graphicx} % Inclusão de gráficos
%\hypersetup{colorlinks = true} % Colorir Links
%\usepackage{nomencl} % Lista de simbolos
\usepackage[utf8]{inputenc} % Codificacao do documento (conversão automática dos acentos)
%\usepackage{showframe} % Mostra margens
\usepackage{amsmath} % Ambiente Matemático
\usepackage{array} % Para colocar tabelas
\usepackage{float} % fixa a figura no lugar
\usepackage[a]{esvect} % vetor pra maiuscula
\usepackage{enumitem}
\setlist[enumerate]{wide=0pt, align=left}
\usepackage{calc}% http://ctan.org/pkg/calc
\begin{document}
\begin{figure}
\begin{tikzpicture}[
myrectangle/.style={rectangle, draw, minimum width=160, minimum height=40, thick, rounded corners=5, black}
]
\node[myrectangle] (a) at (0,0) {
\hspace{0.50cm}
\begin{minipage}{0\textwidth}
\includegraphics[scale=.4]{./figuras/CEFETMG_vetorizada.pdf}
\end{minipage}
\hspace{0.9cm}
\begin{minipage}{0.90\textwidth}
{\centering CENTRO FEDERAL DE EDUCAÇÃO TECNOLÓGICA DE MINAS GERAIS
\vspace{0.2cm}\\
CAMPUS CURVELO\\}
%1ª lista de exercícios do 3° bimestre – 1ª ano\\
%\centering Prof.
\end{minipage}};
\end{tikzpicture}
\end{figure}
\vspace{0.8cm}
\centering 1ª lista de exercícios do 4° bimestre - 1° ano - Prof.
\vspace{0.4cm}
\centering \normalsize \textbf{Potência e rendimento}
\vspace{0.4cm}
\footnotesize
\begin{enumerate}
\item Qual é o rendimento de um motor que recebe a potência de 300 W, durante 1 min, e realiza um trabalho de 4.320 J?
\begin{tikzpicture}[x=1cm, y=1cm, semitransparent]
\draw[step=5mm, line width=0.2mm, black!60!white,dotted] (0,0) grid (19,22);
\end{tikzpicture}
%\begin{tikzpicture}
% \draw[gray,dotted,help lines,xstep=.6cm, ystep=0.6cm,line width=0.1pt] (0,0) grid (1,1);
%\end{tikzpicture}
\newpage
\item Uma máquina tem potência total de 500 HP e rendimento de 60\%. Determine:
\begin{enumerate}
\item a potência útil que ela desenvolve;
\item o trabalho útil que sua força pode realizar em 10 s. Dado: 1 HP = 746 W.
\end{enumerate}
\begin{tikzpicture}[x=1cm, y=1cm, semitransparent]
\draw[step=5mm, line width=0.2mm, black!60!white,dotted] (0,0) grid (19,25);
\end{tikzpicture}
\newpage
\end{enumerate}
\end{document}
\begin{minipage}{0\textwidth}
why 0pt wide? The image is clearly wider than this.\centering
so it applies to the rest of the document the second one is doing nothing