1

So I am trying to create a series of small flashcards A6 size as follows

\documentclass{article}
\usepackage[norsk]{babel}%
\usepackage[a6paper, landscape, left=10mm, right=10mm]{geometry}% http://ctan.org/pkg/geometry

% ============================================================ % v OWN COMMANDS AND PACKAGES BELOW HERE v % ============================================================

\usepackage{amssymb} \usepackage{mathtools} \usepackage{enumitem} \usepackage{multicol}

\setlist[enumerate,1]{label={\arabic*)}}

\usepackage{xcolor} \definecolor{mengder}{HTML}{093145}

% https://tex.stackexchange.com/questions/7355/how-to-suppress-page-number \pagenumbering{gobble} %

\begin{document}

\Huge

%==============================================================================% % Mengder % %==============================================================================%

\pagecolor{mengder} \color{white}

% \setfpvar{angle.p8}{10+5\randomint{3}{11}} %\setfpvar{angle.p8}{40 + 5\randomint{0}{4}} % random.randrange(40,60,5) \include{Q1-mengder-utsagn} \include{Q2-mengder-SnittOgUnion} \include{Q3-mengder-listeform}

\nopagecolor

\end{document}

Where my flashcards are defined as follows

Q1-mengder-utsagn.tex

La $\{3, 5, 7\}$ og $B = \{3, 7\}$ \bigskip

Hvilke utsagn er sanne? \bigskip

\begin{center} \begin{multicols}{2} \begin{enumerate}[label={$\square$}] \item $3 \in B$ \item $0 \in A$ \item $A \subset B$ \item $5, 7 \in A$ \item $B \subset A$ \item $10 \not \in A$ \end{enumerate} \end{multicols} \end{center}

Q2-mengder-SnittOgUnion.tex

La $R = \{2,5,7,11\}$ \\ \phantom{S}\! og $S = \{5,7,11,15\}$

\bigskip

Finn\bigskip

\begin{center} \begin{multicols}{2} \begin{enumerate}[label={$\square$}] \item $R \cap S$ \item $R \cup S$ \item $R \setminus S$ \item $S \setminus R$ \end{enumerate} \end{multicols} \end{center}

Q3-mengder-listeform.tex

Gitt $M=\{6,7,8,9,10,11,12\}$. \\

\bigskip

Finn

\bigskip

\begin{center} \begin{enumerate} \item \mbox{$A = { x \in M \mid x \neq 7, x \neq 10}$} \item $A = { x + 7 \mid x \in M}$ \end{enumerate} \end{center}

The output now looks like

enter image description here

Where I would expect a centered output, to look more like

enter image description here

E.G the widest part of the textblock is equally far away from the margins. Similar is true for the top and bottom part of the textblock. Is there a non-manual way to acheive this? (I need around a hundred of these cards).

I also have tried to following the advice given here, center horizontally and vertically a block of text. Without much success. Eg rewriting

Q1-mengder-utsagn.tex

as

\vspace*{\fill}
\begin{list}{}{%
  \leftmargin=0pt
  \rightmargin=0pt
  \listparindent=\parindent
  \itemindent=\parindent
  \itemsep=0pt
  \parsep=0pt}
\item\relax

La ${3, 5, 7}$ og $B = {3, 7}$ \bigskip

Hvilke utsagn er sanne? \bigskip

\begin{center} \begin{multicols}{2} \begin{enumerate}[label={$\square$}] \item $3 \in B$ \item $0 \in A$ \item $A \subset B$ \item $5, 7 \in A$ \item $B \subset A$ \item $10 \not \in A$ \end{enumerate} \end{multicols} \end{center}

\end{list} \vfill % equivalent to \vspace{\fill}

gives

enter image description here

which clearly is not centered either. What am I doing wrong? I have tried adding minipages and centerings without much success.

N3buchadnezzar
  • 11,348
  • 7
  • 55
  • 114

1 Answers1

1

UPDATE

(1) Center the text area in the page setting the margins with geometry

(2) Inside the flashcards, center the content vertically.

This solution defines the environment CenterCard with three parameters:

  1. Contents of the top of the flashcard;
  2. Elements to be displayed at the bottom, up to three elements per line. Each line has the form item1 & item2 \\ or just item1 \\;
  3. Symbols to insert before each elements. A counter is provided to simulate the environment enumerate.

CenterCard uses the environment varwidth, similar to minipage but with a resulting width of the natural width of its contents; and a tabular environment to present the elements in columns.

z

\documentclass{article}
\usepackage[norsk]{babel}%
\usepackage[a6paper,
landscape, 
left=10mm,
right=10mm,
marginparsep=0pt, 
marginparwidth=0pt,
vmargin=9mm, % save space  for printing
ignoreheadfoot,
]{geometry}% changed <<<<
\setlength{\topskip}{0pt} % added  <<<<

% ============================================================ % v OWN COMMANDS AND PACKAGES BELOW HERE v % ============================================================ \usepackage{caption,booktabs,array}

\usepackage{amssymb} \usepackage{mathtools} %\usepackage{enumitem} % not used %\usepackage{multicol} % not used

\usepackage{varwidth}% added <<<<<<<<<<<<<<<<<<<<<<<<<

\usepackage{xcolor} \definecolor{mengder}{HTML}{093145}

\usepackage{showframe} % show the margins <<<<<<<< \renewcommand*\ShowFrameColor{\color{red}}

% https://tex.stackexchange.com/questions/7355/how-to-suppress-page-number \pagenumbering{gobble} %

\newcounter{CellNumber}% to add numbers to the cells \newenvironment{CenterCard}[3]{% \parindent0pt \setcounter{CellNumber}{0} \pagecolor{mengder} \color{white}\Huge \vspace{\fill}\nointerlineskip \begin{center}\begin{varwidth}{\textwidth} #1\end{varwidth}\end{center}\bigskip% \begin{center} \begin{varwidth}{\textwidth} \setlength{\tabcolsep}{30pt}% separation of the columns <<<<<<<<<<<<<<<<<<<<< \setlength{\extrarowheight}{5pt}% extra row separation <<< \begin{tabular}{{3}{>{#3}l}} #2} {% \end{tabular}\setcounter{CellNumber}{0} \end{varwidth} \end{center} \vfill \clearpage}

\begin{document}

%%
%% %==============================================================================% %% % Mengder % %% %==============================================================================%

%%
\begin{CenterCard} {La ${3, 5, 7}$ og $B = {3, 7}$ \bigskip

Hvilke utsagn er sanne? \bigskip}
{%
$3 \in B$ &amp;$5, 7 \in A$ \\
$0 \in A$ &amp; $A \subset B$ \\    
$B \subset A$ &amp; $10 \not \in A$}        
{$\square$\enspace}

\end{CenterCard}

\begin{CenterCard} {La $R = {2,5,7,11}$ \ og $S = {5,7,11,15}$
\bigskip

Finn\bigskip}
{%
$R \cap S$ &amp; $R \setminus S$ \\
$R \cup S$  &amp; $S \setminus R$
}       
{$\square$\enspace}

\end{CenterCard}

\begin{CenterCard} {Gitt $M={6,7,8,9,10,11,12}$. \
\bigskip

Finn    
\bigskip}
{%
\mbox{$A = \{ x \in M \mid x \neq 7, x \neq 10\}$}  \\  
 $A = \{ x + 7 \mid x \in M\}$
}
{\stepcounter{CellNumber}\theCellNumber)\enspace}

\end{CenterCard}

\end{document}

Simon Dispa
  • 39,141