6

I would like to know how I can divide a page into four boxes with the same length and width. I attached a screenshot below. I am trying to make a page with four boxes and enter text in each box. The text would be short math problems. I have followed the advice here and I've got the right page layout but now I am having an issue when I enter text in each box. How would I keep the text at the top of each box near the line? Also is there a way to add a horizontal line at the bottom of each box? I usually do this stuff using word and notability but it takes too long to make a page. I've used latex to write exams. Not really an expert but trying to learn more.enter image description here

6
  • 1
    Welcome to TeX.SE. How much of a margin are you looking for outside of your boxes? (And could you edit your title to be more descriptive of your problem?)
    – Teepeemm
    Commented Nov 6, 2022 at 18:51
  • 1
    Just guessing, but you might look at pdfpages. Of course you would have to create the source pdf externally. Commented Nov 6, 2022 at 22:24
  • In a comment below, you indicate you want to put text into these boxes. What kind of text? How much?
    – Teepeemm
    Commented Nov 6, 2022 at 22:35
  • I am trying to put math questions in each box. I am trying to make a math workbook.
    – djohn.math
    Commented Nov 7, 2022 at 5:12
  • The request is only vaguely described, which makes the target-oriented help more difficult: Please describe precisely how the text should be placed and aligned in the boxes. Please describe precisely how the desired horizontal line should appear, how thick and long it should be, etc. Commented Nov 7, 2022 at 10:56

6 Answers 6

7

Here is a possibility using the package tikzpagenodes, which provides the (current page text area) node, so it will adjust to different document classes, margin settings, etc. You must compile twice.

enter image description here

\documentclass{article}

\usepackage[margin=1in]{geometry}
\usepackage{tikzpagenodes}
\usetikzlibrary{calc}

\tikzset{quarterpage/.style={draw, text width=.47*\textwidth, minimum height=.5*\textheight, 
    minimum width=.5*\textwidth, text depth=.47*\textheight, label={[yshift=8mm]below:\rule{.35\textwidth}{.7pt}}}}

\newcommand{\posA}{($.5*(current page text area.north west)+.5*(current page text area)$)}
\newcommand{\posB}{($.5*(current page text area.north east)+.5*(current page text area)$)}
\newcommand{\posC}{($.5*(current page text area.south west)+.5*(current page text area)$)}
\newcommand{\posD}{($.5*(current page text area.south east)+.5*(current page text area)$)}

\begin{document}

\begin{tikzpicture}[remember picture, overlay]
\node[quarterpage]at\posA{Here is problem 1. Please show your work in the space provided and write your answer at the bottom.};
\node[quarterpage]at\posB{Here is problem 2. Please show your work in the space provided and write your answer at the bottom.};
\node[quarterpage]at\posC{Here is problem 3. Please show your work in the space provided and write your answer at the bottom.};
\node[quarterpage]at\posD{Here is problem 4. Please show your work in the space provided and write your answer at the bottom.};
\end{tikzpicture}

\end{document}
3

Is this what you are looking for?

\documentclass[12pt]{article}
\usepackage[a4paper, total={180mm,257mm},left=15mm,top=20mm]{geometry}
\usepackage{tikz}
\usetikzlibrary{calc}
\begin{document}
    \thispagestyle{empty}
    \tikz[overlay,remember picture]
    \draw[line width=2pt]($ (current page.north west)+(1cm,-1.2cm)$ ) rectangle ($ (current page.south east)+(-1cm,1.2cm)$);
    \tikz[overlay,remember picture]\draw[line width=1pt]($  (current page.north)+(0,-1.2cm)$ ) rectangle ($ (current page.south)+(0,1.2cm)$);
    \tikz[overlay,remember picture]\draw[line width=1pt]($  (current page.west)+(1cm,0)$ ) rectangle ($ (current page.east)+(-1cm,0)$);
    Here you can write your text...
\end{document}

output page

1
  • Thanks! But how would I add text to each box without the text crossing the lines?
    – djohn.math
    Commented Nov 6, 2022 at 20:20
3

It's not the best way but you can do that using minipage:

\documentclass[12pt]{article}
\usepackage[a4paper, total={180mm,257mm},left=15mm,top=20mm]{geometry}
\usepackage{tikz}
\usetikzlibrary{calc}
\usepackage{blindtext}
\begin{document}
    \thispagestyle{empty}
    \tikz[overlay,remember picture]
    \draw[line width=2pt]($ (current page.north west)+(1cm,-1.2cm)$ ) rectangle ($ (current page.south east)+(-1cm,1.2cm)$);
    \tikz[overlay,remember picture]\draw[line width=1pt]($  (current page.north)+(0,-1.2cm)$ ) rectangle ($ (current page.south)+(0,1.2cm)$);
    \tikz[overlay,remember picture]\draw[line width=1pt]($  (current page.west)+(1cm,0)$ ) rectangle ($ (current page.east)+(-1cm,0)$);
    
    \begin{minipage}[0.4\textheight]{0.4\textwidth}
        \blindtext
    \end{minipage}\hspace{0.12\linewidth}
    \begin{minipage}[0.4\textheight]{0.4\textwidth}
        \blindtext
    \end{minipage}

    \vspace{0.15\textwidth}
    
    \begin{minipage}[0.4\textheight]{0.4\textwidth}
        \blindtext
    \end{minipage}\hspace{0.12\linewidth}
    \begin{minipage}[0.4\textheight]{0.4\textwidth}
        \blindtext
    \end{minipage}

\end{document}
1
  • I entered text but I want the text at the top of each box. I tried using \vspace{} but that doesn't work so well.
    – djohn.math
    Commented Nov 7, 2022 at 5:16
3

You can play with boxes and rules if you like.

If you need to change page-layout, do it within a local scope, ensuring that \newpage or the like is done while the desired settings are in effect.

Some parameters related to page layout like \@colht, \@colroom, \columnwidth, \linewidth, \hsize, \vsize need to be re-initialized "by hand" when page-layout-parameters are changed in the middle of the document.

% Make TeX very picky about boxes and report every bad box - don't do
% this in a real document, this is just for testing-purposes with this
% example:

\hfuzz=0pt \vfuzz=0pt \hbadness=0 \vbadness=0

\documentclass[a4paper, twoside]{article}

\csname @ifundefined\endcsname{pagewidth}{}{\pagewidth=\paperwidth}%
\csname @ifundefined\endcsname{pdfpagewidth}{}{\pdfpagewidth=\paperwidth}%
\csname @ifundefined\endcsname{pageheight}{}{\pageheight=\paperheight}%
\csname @ifundefined\endcsname{pdfpageheight}{}{\pdfpageheight=\paperheight}%

\begin{document}

\noindent A \dotfill B
\vfill
\noindent C \dotfill D

% Do \clearpage or \newpage or \cleardoublepage or whatever
% before modifying the layout of subsequent pages.

\newpage

\begingroup % <- local scope for modifying page layout for subsequent pages.

% Adjust page layout for subsequent pages:
% Don't use LaTeX's \setlength and the like but use plain TeX sytax in order to avoid global asssignments

\newbox\scratchbox
\def\mytopmargin{1cm}%
\def\mybottommargin{1cm}%
\def\myevenleftmargin{1cm}% with the twoside-option the left margin on even numbered pages is the same as right margin on odd numbered pages.
\def\myevenrightmargin{1cm}% with the twoside-option the right margin on even numbered pages is the same as left margin on odd numbered pages.
\oddsidemargin=\dimexpr-1in+\myevenrightmargin\relax
\evensidemargin=\dimexpr-1in+\myevenleftmargin\relax
\textwidth=\dimexpr\paperwidth-\myevenrightmargin-\myevenleftmargin\relax
\marginparwidth=0pt
\marginparsep=0pt
\topmargin=\dimexpr-1in+\mytopmargin\relax
\textheight=\dimexpr\paperheight-\mytopmargin-\mybottommargin\relax
\headheight=0pt
\headsep=0pt
\setbox\scratchbox=\hbox{0123456789}%
\footskip=\dimexpr.5\dimexpr\mybottommargin\relax+.5\ht\scratchbox-.5\dp\scratchbox\relax
\csname @colht\endcsname=\textheight
\csname @colroom\endcsname=\textheight
\vsize=\textheight
\columnwidth=\textwidth
\hsize=\textwidth
\linewidth=\textwidth
\pagestyle{plain}%
%\pagestyle{empty}%

% A \hrule/\vrule usually has thickness 0.4pt, there are three of them, that makes 1.2pt.

% Let's have TeX go into horizontal mode:
\noindent
\vrule
\vbox {\hsize=.5\dimexpr\hsize-1.2pt\relax 
               \hrule
               \vbox to .5\dimexpr\vsize -1.2pt\relax{%
                 \vfill
                 \hfill bla 1\hfill\null
                 \vfill
               }%
               \hrule
               \vbox to .5\dimexpr\vsize -1.2pt\relax{%
                 \vfill
                 \hfill bla 3\hfill\null
                 \vfill
               }%
               \hrule
              }%
\vrule
\vbox {\hsize=.5\dimexpr\hsize-1.2pt\relax 
               \hrule
               \vbox to .5\dimexpr\vsize -1.2pt\relax{%
                 \vfill
                 \hfill bla 2\hfill\null
                 \vfill
               }%
               \hrule
               \vbox to .5\dimexpr\vsize -1.2pt\relax{%
                 \vfill
                 \hfill bla 4\hfill\null
                 \vfill
               }%
               \hrule
              }%
\vrule

\newpage

% After \newpage TeX is in vertical mode:

\hrule height 0pt depth 0pt
\kern-\topskip
\hrule
\hbox{\vrule
      \vbox to.5\dimexpr\vsize-1.2pt\relax{\hsize=.5\dimexpr\hsize-1.2pt\relax 
                                           \vfill \hfill bla 1\hfill \null \vfill }%
      \vrule
      \vbox to.5\dimexpr\vsize-1.2pt\relax{\hsize=.5\dimexpr\hsize-1.2pt\relax
                                           \vfill \hfill bla 2\hfill \null \vfill }%
      \vrule}%
\hrule
\hbox{\vrule
      \vbox to.5\dimexpr\vsize-1.2pt\relax{\hsize=.5\dimexpr\hsize-1.2pt\relax
                                           \vfill \hfill bla 3\hfill \null \vfill }%
      \vrule
      \vbox to.5\dimexpr\vsize-1.2pt\relax{\hsize=.5\dimexpr\hsize-1.2pt\relax
                                           \vfill \hfill bla 4\hfill \null \vfill }%
      \vrule}%
\hrule

\newpage

\endgroup % <- After typesettig the pages of special layout close the
          %    local scope where page layout was modified.

%  Re-Initialize some  layout-parameters manually:
\csname @colht\endcsname=\textheight
\csname @colroom\endcsname=\textheight
\vsize=\textheight
\columnwidth=\textwidth
\hsize=\textwidth
\linewidth=\textwidth

\noindent A \dotfill B
\vfill
\noindent C \dotfill D

\end{document}

 

Instead of text-phrases bla 1 etc you can, e.g., use a \parbox.



Based on the above you can create a macro \fourboxes with a key=value-interface where you can provide values for margins of the page and values for margins of text-areas within the boxes; you can do fancy things by testing via \if@twoside..\else..\fi and/or \ifodd\value{page}..\else..\fi; with the example below I decided to use l3keys of expl3; you can use the macro \fourboxesdefaults for setting defaults for the key=value-interface of \fourboxes. If you do this, then with \fourboxes you need to specify only those key=vale-pairs that shall deviate from the defaults; currently the Pagestyle-key should hold only one of the values "plain"/"empty":

%--------------------------------------------------------------------------------
\ExplSyntaxOn
% -----------------------------------------------------------
% Initialize scratch-macros for page-margins and box-margins:
% -----------------------------------------------------------
\cs_new_eq:NN \__MyModulePageTopMargin:n \q_no_value
\cs_new_eq:NN \__MyModulePageBottomMargin:n \q_no_value
\cs_new_eq:NN \__MyModulePageOddLeftMargin:n \q_no_value
\cs_new_eq:NN \__MyModulePageOddRightMargin:n \q_no_value
\cs_new_eq:NN \__MyModuleBoxTopMargin:n \q_no_value
\cs_new_eq:NN \__MyModuleBoxBottomMargin:n \q_no_value
\cs_new_eq:NN \__MyModuleBoxOddLeftMargin:n \q_no_value
\cs_new_eq:NN \__MyModuleBoxOddRightMargin:n \q_no_value
\cs_new_eq:NN \__MyModulePagestyle:n \q_no_value
% -----------------------
% Error-message-handling:
% -----------------------
\prop_gput:Nnn \g_msg_module_type_prop { MyModule } {}
\prop_gput:Nnn \g_msg_module_name_prop { MyModule } {Macro-Defined-In-Preamble:}
\msg_new:nnnn {MyModule} 
              {Required Value Not Specified}
              {Macro~#1:~Value~for~'#3'~for~not~specified~although~required~\msg_line_context:.~
               The~call~to~macro~#1~is~ignored.}
              {Value~for~'#3'~neither~specified~via~#1's~optional~argument~nor~via~#2.}
\cs_new:Nn \MyModule_Required_Value_Not_Specified_error:nnn
  { \exp_args:Nne \use:nn  {
      \msg_error:nnnnn {MyModule} {Required Value Not Specified}
    }{{\iow_char:N \\\cs_to_str:N #1}{\iow_char:N \\\cs_to_str:N #2}}{#3}
  }
% ------------------------------------------------------------------------------
% Check whether all scratch-macros for page-margins/box-margins are initialized:
% ------------------------------------------------------------------------------
\cs_new:Nn \MyModule_Repl_ii_byUseNone:nN {#1 \use_none:n}
\cs_new:Npn \MyModule_KeyInitialized:NnnN #1 #2
  { \quark_if_no_value:NTF #1 
                           {\MyModule_Required_Value_Not_Specified_error:nnn {\fourboxes}{\fourboxesdefaults}{#2}\MyModule_Repl_ii_byUseNone:nN}
                           {\use:n}
  }
\cs_new:Npn \MyModule_DoIfAllValuesInitialized:n
  {
     \MyModule_KeyInitialized:NnnN \__MyModulePageTopMargin:n {PageTopMargin}
     { \MyModule_KeyInitialized:NnnN \__MyModulePageBottomMargin:n {PageBottomMargin}
       { \MyModule_KeyInitialized:NnnN \__MyModulePageOddLeftMargin:n {PageOddLeftMargin}
         { \MyModule_KeyInitialized:NnnN \__MyModulePageOddRightMargin:n {PageOddRightMargin}
           { \MyModule_KeyInitialized:NnnN \__MyModuleBoxTopMargin:n {BoxTopMargin}
             { \MyModule_KeyInitialized:NnnN \__MyModuleBoxBottomMargin:n {BoxBottomMargin}
               { \MyModule_KeyInitialized:NnnN \__MyModuleBoxOddLeftMargin:n {BoxOddLeftMargin}
                 { \MyModule_KeyInitialized:NnnN \__MyModuleBoxOddRightMargin:n {BoxOddRightMargin}
                   { \MyModule_KeyInitialized:NnnN \__MyModulePagestyle:n {Pagestyle}{}} }}}}}}}
     \use:n
  }
% ------------------------------------------------------------------------------
% Define keys of keyval-interface:
% ------------------------------------------------------------------------------
\keys_define:nn {MyModule} {
   PageTopMargin.cs_set:Np = \__MyModulePageTopMargin:n ,
   PageBottomMargin.cs_set:Np = \__MyModulePageBottomMargin:n ,
   PageOddLeftMargin.cs_set:Np = \__MyModulePageOddLeftMargin:n ,
   PageOddRightMargin.cs_set:Np = \__MyModulePageOddRightMargin:n ,
   BoxTopMargin.cs_set:Np = \__MyModuleBoxTopMargin:n ,
   BoxBottomMargin.cs_set:Np = \__MyModuleBoxBottomMargin:n ,
   BoxOddLeftMargin.cs_set:Np = \__MyModuleBoxOddLeftMargin:n ,
   BoxOddRightMargin.cs_set:Np = \__MyModuleBoxOddRightMargin:n ,
   Pagestyle.cs_set:Np = \__MyModulePagestyle:n ,
   PageTopMargin.value_required:n = true,
   PageBottomMargin.value_required:n = true,
   PageOddLeftMargin.value_required:n = true,
   PageOddRightMargin.value_required:n = true,
   BoxTopMargin.value_required:n = true,
   BoxBottomMargin.value_required:n = true,
   BoxOddLeftMargin.value_required:n = true,
   BoxOddRightMargin.value_required:n = true,
   Pagestyle.value_required:n = true,
}
%------------------------------------------------------
% scratch box holding digits of page-numbers in footer:
%------------------------------------------------------
\newbox\footerdigitbox
\AtBeginDocument{{\normalfont\global\setbox\footerdigitbox=\hbox{0123456789}}}%<-select the font in use with page numbers in footer!!!
%---------------------
% User-level commands:
%---------------------
\cs_new:Npn \fourboxesdefaults #1 {\keys_set:nn {MyModule} {#1}}
%
% A \hrule/\vrule usually has thickness 0.4pt, there are three of them, that makes 1.2pt.
\cs_new:Nn \__onevbox:n
  { \vbox to.5\dimexpr\vsize-1.2pt\relax{
      \hsize=.5\dimexpr\hsize-1.2pt\relax
      \hrule~height~0pt~depth~0pt~
      \vskip\__MyModuleBoxTopMargin:n
      \noindent\hskip\__MyModuleBoxOddLeftMargin:n
      \parbox[c]%
             [\dimexpr.5\dimexpr\vsize -1.2pt\relax-\__MyModuleBoxTopMargin:n-\__MyModuleBoxBottomMargin:n\relax]%
             [t]%
             {\dimexpr\hsize-\__MyModuleBoxOddLeftMargin:n-\__MyModuleBoxOddRightMargin:n\relax}%
             {#1}%
      \hskip\__MyModuleBoxOddRightMargin:n
      \null
      \vskip\__MyModuleBoxBottomMargin:n
    }
  }
\NewDocumentCommand{\fourboxes}{O{}mmmm}{
   % In case there is s.th. before, do \clearpage or \newpage or \cleardoublepage or whatever
   % before modifying modifying the layout of subsequent pages.
   \newpage
   \begingroup
   % Adjust page layout for subsequent pages:
   % Don't use LaTeX's \setlength and the like but use plain TeX sytax in order to avoid global asssignments
   \keys_set:nn {MyModule} {#1}%
   \MyModule_DoIfAllValuesInitialized:n{%
     \oddsidemargin=\dimexpr-1in+\__MyModulePageOddLeftMargin:n\relax
     \evensidemargin=\dimexpr-1in+\__MyModulePageOddRightMargin:n\relax
     \textwidth=\dimexpr\paperwidth-\__MyModulePageOddLeftMargin:n-\__MyModulePageOddRightMargin:n\relax
     \marginparwidth=0pt~
     \marginparsep=0pt~
     \topmargin=\dimexpr-1in+\__MyModulePageTopMargin:n\relax
     \textheight=\dimexpr\paperheight-\__MyModulePageTopMargin:n-\__MyModulePageBottomMargin:n\relax
     \headheight=0pt~
     \headsep=0pt~
     \footskip=\dimexpr.5\dimexpr\__MyModulePageBottomMargin:n\relax+.5\ht\footerdigitbox-.5\dp\footerdigitbox\relax
     \csname @colht\endcsname=\textheight
     \csname @colroom\endcsname=\textheight
     \vsize=\textheight
     \columnwidth=\textwidth
     \hsize=\textwidth
     \linewidth=\textwidth
     \quark_if_no_value:NF \__MyModulePagestyle:n
                           { \expandafter\pagestyle\expandafter{\__MyModulePagestyle:n} }%
     \hrule~height~0pt~depth~0pt~
     \kern-\topskip
     % After \newpage TeX is in vertical mode:
     \hrule
     \hbox{\vrule \__onevbox:n {#2} \vrule \__onevbox:n {#3} \vrule}%
     \hrule
     \hbox{\vrule \__onevbox:n {#4} \vrule \__onevbox:n {#5} \vrule}%
     \hrule
     \newpage
     \endgroup
     % ---- After typesettig the pages of special layout reset the page layout ----------
     \csname @colht\endcsname=\textheight
     \csname @colroom\endcsname=\textheight
     \vsize=\textheight
     \columnwidth=\textwidth
     \hsize=\textwidth
     \linewidth=\textwidth
     \use_none:n
   }%
   \endgroup
}
\ExplSyntaxOff

%------------------------------------------------------------------------------------------------------------------------
%------------------------------------------------------------------------------------------------------------------------

\documentclass[a4paper,twoside]{article}
\usepackage{lipsum}

\csname @ifundefined\endcsname{pagewidth}{}{\pagewidth=\paperwidth}%
\csname @ifundefined\endcsname{pdfpagewidth}{}{\pdfpagewidth=\paperwidth}%
\csname @ifundefined\endcsname{pageheight}{}{\pageheight=\paperheight}%
\csname @ifundefined\endcsname{pdfpageheight}{}{\pdfpageheight=\paperheight}%

\begin{document}

\noindent A \dotfill B
\vfill
\noindent C \dotfill D

\fourboxesdefaults{%
                    PageTopMargin=1cm,
                    PageBottomMargin=1cm,
                    PageOddLeftMargin=1cm,  % with option twoside this is also the right margin for even pages
                    PageOddRightMargin=2cm, % with option twoside this is also the left margin for even pages
                    Pagestyle=plain,
                    BoxTopMargin=1cm,
                    BoxBottomMargin=1cm,
                    BoxOddLeftMargin=1cm,
                    BoxOddRightMargin=1cm,
                  }%

\fourboxes[Pagestyle=empty]
          {\hrule\vskip\topskip\lipsum[1][1-10] \textbf{BOX 1}\vskip\topskip\vfill\hrule}%
          {\hrule\vskip\topskip\lipsum[1][1-10] \textbf{BOX 2}\vskip\topskip\vfill\hrule}%
          {\hrule\vskip\topskip\lipsum[1][1-10] \textbf{BOX 3}\vskip\topskip\vfill\hrule}%
          {\hrule\vskip\topskip\lipsum[1][1-10] \textbf{BOX 4}\vskip\topskip\vfill\hrule}%

\fourboxes[%
              PageTopMargin=1.5cm,
              PageBottomMargin=1.5cm,
              PageOddLeftMargin=1.5cm, % with option twoside this is also the right margin for even pages
              PageOddRightMargin=3cm, % with option twoside this is also the left margin for even pages
              BoxTopMargin=1.5cm,
              BoxBottomMargin=1.5cm,
              BoxOddLeftMargin=1.5cm,
              BoxOddRightMargin=1.5cm
          ]%
          {\hrule\vskip\topskip\lipsum[1][1-10] \textbf{BOX 1}\vskip\topskip\vfill\hrule}%
          {\hrule\vskip\topskip\lipsum[1][1-10] \textbf{BOX 2}\vskip\topskip\vfill\hrule}%
          {\hrule\vskip\topskip\lipsum[1][1-10] \textbf{BOX 3}\vskip\topskip\vfill\hrule}%
          {\hrule\vskip\topskip\lipsum[1][1-10] \textbf{BOX 4}\vskip\topskip\vfill\hrule}%

\fourboxes{\hrule\vskip\topskip\lipsum[1][1-10] \textbf{BOX 1}\vskip\topskip\vfill\hrule}%
          {\hrule\vskip\topskip\lipsum[1][1-10] \textbf{BOX 2}\vskip\topskip\vfill\hrule}%
          {\hrule\vskip\topskip\lipsum[1][1-10] \textbf{BOX 3}\vskip\topskip\vfill\hrule}%
          {\hrule\vskip\topskip\lipsum[1][1-10] \textbf{BOX 4}\vskip\topskip\vfill\hrule}%

\fourboxes[PageOddRightMargin=1cm]%
          {\hrule\vskip\topskip\lipsum[1][1-10] \textbf{BOX 1}\vskip\topskip\vfill\hrule}%
          {\hrule\vskip\topskip\lipsum[1][1-10] \textbf{BOX 2}\vskip\topskip\vfill\hrule}%
          {\hrule\vskip\topskip\lipsum[1][1-10] \textbf{BOX 3}\vskip\topskip\vfill\hrule}%
          {\hrule\vskip\topskip\lipsum[1][1-10] \textbf{BOX 4}\vskip\topskip\vfill\hrule}%

\noindent A \dotfill B
\vfill
\noindent C \dotfill D

\end{document}

3

Another solution could be to use a tcbraster (from tcolorbox). You can easily define different aspects for each box.

\documentclass[a4paper]{article}
\usepackage[margin={1cm}]{geometry}
\usepackage[most]{tcolorbox}
\usepackage{lipsum}
\begin{document}
\thispagestyle{empty}
\begin{tcbraster}[raster columns=2, raster rows=2, raster height=\textheight,
    enhanced, sharp corners, raster column skip=-.5mm, 
    raster row skip=-.5mm, colback=white, underlay={\draw[red]([shift={(5mm,5mm)}]frame.south west)--([shift={(-5mm,5mm)}]frame.south east);},
    watermark text={\thetcbrasternum}]
    \begin{tcolorbox}
        \lipsum[1]
    \end{tcolorbox}
    \begin{tcolorbox}
        \lipsum[2]
    \end{tcolorbox}
    \begin{tcolorbox}
        \lipsum[3]
    \end{tcolorbox}
    \begin{tcolorbox}
        \lipsum[4]
    \end{tcolorbox}
\end{tcbraster}
\end{document}

enter image description here

2

Write your document as if on a6 paper, then use pgfpages or pgfmorepages to put four pages on one.

In your preamble, put:

\usepackage[a6paper]{geometry}
\usepackage{pgfmorepages}
\pgfpagesuselayout{4 on 1}[a4paper,border code=\pgfusepath{stroke}]

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .