2

I am trying to create a template like in this image. enter image description here

And for this i have this code:

    \documentclass{article}
\usepackage[landscape]{geometry}

\newcommand\Block[2]{%
\setlength\fboxsep{0pt}\setlength\fboxrule{0.1pt}% delete
\fbox{% delete
\begin{minipage}[c][.2\textheight][t]{0.5\textwidth}
#1\par #2
\end{minipage}%
  }% delete
}

\newcommand\nBlock[2]{%
    \setlength\fboxsep{0pt}\setlength\fboxrule{0.1pt}% delete
    \fbox{% delete
        \begin{minipage}[c][.2\textheight][t]{0.5\textwidth}
            #1\par #2
        \end{minipage}%
    }% delete
}

\newcommand\nnBlock[2]{%
    \setlength\fboxsep{0pt}\setlength\fboxrule{0.1pt}% delete
    \fbox{% delete
        \begin{minipage}[c][.2\textheight][t]{0.5\textwidth}
            #1\par #2
        \end{minipage}%
    }% delete
}

\begin{document}
\noindent
\Block{text}{caption}%
\Block{text}{caption}%
\par\nointerlineskip\noindent
\nBlock{text}{caption}%
\nBlock{text}{caption}%
\par\nointerlineskip\noindent
\nnBlock{text}{caption}%
\nnBlock{text}{caption}%
\end{document}

And right now my result is: enter image description here

How can i do to give for each row and for each box a specific length. I don't want this boxes to be equal like now. Thanks a lot.

2

I guess that something like the following should suit your needs; the first argument to \Block is the fraction of the text height, the second is the fraction of the text width; then title and text.

\documentclass{article}
\usepackage[landscape]{geometry}

\newenvironment{blocks}
  {%
   \setlength\fboxsep{0pt}%
   \setlength\fboxrule{0.1pt}%
   \setlength{\parindent}{0pt}%
   \newcommand{\newblocks}{\par\nointerlineskip}%
  }
  {\par}
\newcommand{\Block}[4]{%
  \fbox{%
    \begin{minipage}[c][\dimexpr#1\textheight-2\fboxrule][t]{\dimexpr#2\textwidth-2\fboxrule}
    #3\par #4
    \end{minipage}%
  }%
  \ignorespaces
}

\begin{document}

\begin{blocks}
\Block{0.2}{0.3}{text}{caption}
\Block{0.2}{0.7}{text}{caption}
\newblocks
\Block{0.3}{0.5}{text}{caption}
\Block{0.3}{0.5}{text}{caption}
\newblocks
\Block{0.2}{0.4}{text}{caption}
\Block{0.2}{0.6}{text}{caption}
\end{blocks}

\end{document}

enter image description here

  • Thank you. That's what i want but now i have some problems when i add a table in a block. I hope i can solve it. Thanks :) – Adrian Mar 15 '18 at 11:14

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.