因此,我尝试创建一系列 A6 尺寸的小抽认卡,如下所示
\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}
我的抽认卡定义如下
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}
输出现在看起来像
我期望居中输出的结果更像
例如,文本块的最宽部分与边距同样远。文本块的顶部和底部也是如此。有没有非手动方式来实现这一点?(我需要大约一百张这样的卡片)。
我也尝试遵循这里给出的建议,将文本块水平和垂直居中。没有取得多大成功。例如重写
Q1-mengder-utsagn.tex
作为
\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}
给出
显然也没有居中。我做错了什么?我尝试添加小页面和居中,但没有成功。
答案1
更新
(1)将文本区域置于页面中央,设置边距geometry
(2)在抽认卡内,将内容垂直居中。
CenterCard
该解决方案使用三个参数定义环境:
- 抽认卡顶部的内容;
- 显示在底部的元素,每行最多三个元素。每行的形式
item1 & item2 \\
为 或item1 \\
; - 在每个元素前插入的符号。提供了一个计数器来模拟环境
enumerate
。
CenterCard
使用环境varwidth
,类似于minipage
但最终宽度为其内容的自然宽度;并使用tabular
环境以列的形式显示元素。
\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$ &$5, 7 \in A$ \\
$0 \in A$ & $A \subset B$ \\
$B \subset A$ & $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$ & $R \setminus S$ \\
$R \cup S$ & $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}