Minipage定位问题

Minipage定位问题

我想将页面分成 9 个单元格(3x3),每个单元格包含一个小页面。因此,我将小页面宽度设置为0.33\textwidth。问题是单元格 (2,3) 的小页面移动到了 (3,1)。

enter image description here

\documentclass{article}
\usepackage{booktabs}
\usepackage[a4paper,left=0cm,top=0.2cm,bottom=0cm,right=0cm]{geometry}
\usepackage{polyglossia}
\setmainlanguage[numerals=Devanagari]{bengali}
\setmainlanguage{bengali}
\setotherlanguage{english}
%\newfontfamily\englishfont[Scale=MatchLowercase]{Linux Biolinum O}
\newfontfamily\bengalifont[Script=Bengali]{Akaash}
\usepackage{pgffor}
\newcommand{\ListItem}[1]{\underline{\makebox[5cm][l]{#1}}}
\begin{document}
\begin{minipage}{0.33\textwidth}
\foreach \x in {চাল,ডাল,লবণ,তেল,মরিচ,পেঁয়াজ,রসুন,আদা,মুরগী,মশলা}
{
\ListItem{\x}\par\bigskip}
\end{minipage}
\begin{minipage}{0.33\textwidth}
\foreach \x in {চাল,ডাল,লবণ,তেল,মরিচ,পেঁয়াজ,রসুন,আদা,মুরগী,মশলা}
{
\ListItem{\x}\par\bigskip}
\end{minipage}
\begin{minipage}{0.33\textwidth}
\foreach \x in {চাল,ডাল,লবণ,তেল,মরিচ,পেঁয়াজ,রসুন,আদা,মুরগী,মশলা}
{
\ListItem{\x}\par\bigskip}
\end{minipage}
\\

\vspace{2cm}
\begin{minipage}{0.33\textwidth}
\foreach \x in {চাল,ডাল,লবণ,তেল,মরিচ,পেঁয়াজ,রসুন,আদা,মুরগী,মশলা}
{
\ListItem{\x}\par\bigskip}
\end{minipage}
\begin{minipage}{0.33\textwidth}
\foreach \x in {চাল,ডাল,লবণ,তেল,মরিচ,পেঁয়াজ,রসুন,আদা,মুরগী,মশলা}
{
\ListItem{\x}\par\bigskip}
\end{minipage}

\begin{minipage}{0.33\textwidth}
\foreach \x in {চাল,ডাল,লবণ,তেল,মরিচ,পেঁয়াজ,রসুন,আদা,মুরগী,মশলা}
{
\ListItem{\x}\par\bigskip}
\end{minipage}

\vspace{2cm}
\begin{minipage}{0.33\textwidth}
\foreach \x in {চাল,ডাল,লবণ,তেল,মরিচ,পেঁয়াজ,রসুন,আদা,মুরগী,মশলা}
{
\ListItem{\x}\par\bigskip}
\end{minipage}
\begin{minipage}{0.33\textwidth}
\foreach \x in {চাল,ডাল,লবণ,তেল,মরিচ,পেঁয়াজ,রসুন,আদা,মুরগী,মশলা}
{
\ListItem{\x}\par\bigskip}
\end{minipage}
\begin{minipage}{0.33\textwidth}
\foreach \x in {চাল,ডাল,লবণ,তেল,মরিচ,পেঁয়াজ,রসুন,আদা,মুরগী,মশলা}
{
\ListItem{\x}\par\bigskip}
\end{minipage}
\end{document}

答案1

minipages (2,2) 和 (2,3) 之间有一个空行,这会形成一个新段落。只需删除此空行即可。它是您示例中的第 40 行。

这是我的 MWE。请注意,我在第 9 行更改了字体,因为我没有安装 Linux Biolinum 字体。

\documentclass{article}
\usepackage{booktabs}
\usepackage[a4paper,left=0cm,top=0.2cm,bottom=0cm,right=0cm]{geometry}
\usepackage{polyglossia}
\setmainlanguage[numerals=Devanagari]{bengali}
\setmainlanguage{bengali}
\setotherlanguage{english}
\newfontfamily\bengalifont[Script=Bengali]{Ani}
\usepackage{pgffor}
\newcommand{\ListItem}[1]{\underline{\makebox[5cm][l]{#1}}}
\begin{document}
\begin{minipage}{0.33\linewidth}
\foreach \x in {চাল,ডাল,লবণ,তেল,মরিচ,পেঁয়াজ,রসুন,আদা,মুরগী,মশলা}
{
\ListItem{\x}\par\bigskip}
\end{minipage}
\begin{minipage}{0.33\linewidth}
\foreach \x in {চাল,ডাল,লবণ,তেল,মরিচ,পেঁয়াজ,রসুন,আদা,মুরগী,মশলা}
{
\ListItem{\x}\par\bigskip}
\end{minipage}
\begin{minipage}{0.33\linewidth}
\foreach \x in {চাল,ডাল,লবণ,তেল,মরিচ,পেঁয়াজ,রসুন,আদা,মুরগী,মশলা}
{
\ListItem{\x}\par\bigskip}
\end{minipage}
\\

\vspace{2cm}
\begin{minipage}{0.33\linewidth}
\foreach \x in {চাল,ডাল,লবণ,তেল,মরিচ,পেঁয়াজ,রসুন,আদা,মুরগী,মশলা}
{
\ListItem{\x}\par\bigskip}
\end{minipage}
\begin{minipage}{0.33\linewidth}
\foreach \x in {চাল,ডাল,লবণ,তেল,মরিচ,পেঁয়াজ,রসুন,আদা,মুরগী,মশলা}
{
\ListItem{\x}\par\bigskip}
\end{minipage}
\begin{minipage}{0.33\linewidth}
\foreach \x in {চাল,ডাল,লবণ,তেল,মরিচ,পেঁয়াজ,রসুন,আদা,মুরগী,মশলা}
{
\ListItem{\x}\par\bigskip}
\end{minipage}

\vspace{2cm}
\begin{minipage}{0.33\linewidth}
\foreach \x in {চাল,ডাল,লবণ,তেল,মরিচ,পেঁয়াজ,রসুন,আদা,মুরগী,মশলা}
{
\ListItem{\x}\par\bigskip}
\end{minipage}
\begin{minipage}{0.33\linewidth}
\foreach \x in {চাল,ডাল,লবণ,তেল,মরিচ,পেঁয়াজ,রসুন,আদা,মুরগী,মশলা}
{
\ListItem{\x}\par\bigskip}
\end{minipage}
\begin{minipage}{0.33\linewidth}
\foreach \x in {চাল,ডাল,লবণ,তেল,মরিচ,পেঁয়াজ,রসুন,আদা,মুরগী,মশলা}
{
\ListItem{\x}\par\bigskip}
\end{minipage}
\end{document}

enter image description here

相关内容