如何更改小页面中多列元素的各个列的宽度(均在多列元素内)?

如何更改小页面中多列元素的各个列的宽度(均在多列元素内)?

我有一个外部多列,然后列里面有小页面。

在我的迷你页面中,我有多栏。但是如何改变宽度里面多列每个小页面(即,独立于其他小页面中的所有其他多栏)?并且,不影响全局多栏的宽度?

具体来说:设置列宽度的任何方法都可以:手动调整每个列,或按某些百分比调整(即 50%/50% 或 30%/40%/30% 等)

谢谢!

没有设置列宽的输出: 在此处输入图片描述

尝试设置列宽的输出(失败): 在此处输入图片描述

期望输出:更改第一个小页面的多列宽度: 在此处输入图片描述

梅威瑟:

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[landscape]{geometry}
\usepackage{multicol}
\usepackage{tikz}

\advance\topmargin-.8in
\advance\textheight3in
\advance\textwidth3in
\advance\paperheight1.5in 
\advance\oddsidemargin-1.5in
\advance\evensidemargin-1.5in
\parindent0pt
\parskip2pt

\usepackage{fourier}
\usepackage{hyperref}

\begin{document}

\begin{center}{\huge{\textbf{Notes}}}
\end{center}
\begin{multicols*}{3}

\tikzset{mybox/.style={draw=black, fill=white, very thick,
    rectangle, rounded corners, inner sep=10pt, inner ysep=10pt},
        fancytitle/.style={fill=black, text=white, font=\bfseries}
    }

%------------ Box 1 ---------------
\begin{tikzpicture}
\node [mybox] (box){%
    \small
    \begin{minipage}{0.3\textwidth}
    \setlength{\columnsep}{-2.5cm}
    \begin{multicols*}{2}
    This is a sentence, it keeps going and going and going and going and going.\\
    This is a shorter sentence, it stops here.
    \newpage
    This is a sentence, it keeps going and going and going and going and going.\\
    This is a shorter sentence, it stops here.
    \end{multicols*}
    \end{minipage}
};
\node[fancytitle, right=10pt] at (box.north west) {Box 1};
\end{tikzpicture}

%------------ Really long box to fill up the rest of column ---------------
\begin{tikzpicture}
\node [mybox] (box){%
    \Huge
    \begin{minipage}{0.3\textwidth}
    asdf asdf asdf asdf asdf asdf asdf asdf
    asdf asdf asdf asdf asdf asdf asdf asdf
    asdf asdf asdf asdf asdf asdf asdf asdf
    asdf asdf asdf asdf asdf asdf asdf asdf
    asdf asdf asdf asdf asdf asdf asdf asdf
    asdf asdf asdf asdf asdf asdf asdf asdf
    asdf asdf asdf asdf asdf asdf asdf asdf
    asdf asdf asdf asdf asdf asdf asdf asdf
    asdf asdf asdf asdf asdf asdf asdf asdf
    asdf asdf asdf asdf asdf asdf asdf asdf
    \end{minipage}
};
\node[fancytitle, right=10pt] at (box.north west) {Really long box to fill up rest of column};
\end{tikzpicture}


%------------ Box 3 ---------------
\begin{tikzpicture}
\node [mybox] (box){%
    \Huge
    \begin{minipage}{0.3\textwidth}
    Some typing here. This box should be as usual/expected.
    \end{minipage}
};
\node[fancytitle, right=10pt] at (box.north west) {Box 3};
\end{tikzpicture}


\end{multicols*}
\end{document}

答案1

我认为您无法设置 的宽度multicol。相反,您应该使用vwcol(variable-width multiple text columns) 包。

将其包括进去\usepackage{vwcol}并如下使用它:

\begin{vwcol}[_Conditions_] 

\end{vwcol} 

对于你的情况,我会用widths={0.3,0.7}, sep=.8cm, justify=flush,rule=0pt作为条件。

梅威瑟:

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[landscape]{geometry}
\usepackage{multicol}
\usepackage{vwcol}
\usepackage{tikz}

\advance\topmargin-.8in
\advance\textheight3in
\advance\textwidth3in
\advance\paperheight1.5in 
\advance\oddsidemargin-1.5in
\advance\evensidemargin-1.5in
\parindent0pt
\parskip2pt

\usepackage{fourier}
\usepackage{hyperref}

\begin{document}

\begin{center}{\huge{\textbf{Notes}}}
\end{center}
\begin{multicols*}{3}

\tikzset{mybox/.style={draw=black, fill=white, very thick,
    rectangle, rounded corners, inner sep=10pt, inner ysep=10pt},
        fancytitle/.style={fill=black, text=white, font=\bfseries}
    }

%------------ Box 1 ---------------
\begin{tikzpicture}
\node [mybox] (box){%
    \small
    \begin{minipage}{0.3\textwidth}
    \setlength{\columnsep}{-2.5cm}
    
     \begin{vwcol}[widths={0.3,0.7},
 sep=.8cm, justify=flush,rule=0pt] 
This is a sentence, it keeps going and going and going and going and going.\\
    This is a shorter sentence, it stops here.
        \newpage
    \noindent This is a sentence, it keeps going and going and going and going and going.\\
    This is a shorter sentence, it stops here.
 \end{vwcol} 
    \end{minipage}
};
\node[fancytitle, right=10pt] at (box.north west) {Box 1};
\end{tikzpicture}

%------------ Really long box to fill up the rest of column ---------------
\begin{tikzpicture}
\node [mybox] (box){%
    \Huge
    \begin{minipage}{0.3\textwidth}
    asdf asdf asdf asdf asdf asdf asdf asdf
    asdf asdf asdf asdf asdf asdf asdf asdf
    asdf asdf asdf asdf asdf asdf asdf asdf
    asdf asdf asdf asdf asdf asdf asdf asdf
    asdf asdf asdf asdf asdf asdf asdf asdf
    asdf asdf asdf asdf asdf asdf asdf asdf
    asdf asdf asdf asdf asdf asdf asdf asdf
    asdf asdf asdf asdf asdf asdf asdf asdf
    asdf asdf asdf asdf asdf asdf asdf asdf
    asdf asdf asdf asdf asdf asdf asdf asdf
    \end{minipage}
};
\node[fancytitle, right=10pt] at (box.north west) {Really long box to fill up rest of column};
\end{tikzpicture}


%------------ Box 3 ---------------
\begin{tikzpicture}
\node [mybox] (box){%
    \Huge
    \begin{minipage}{0.3\textwidth}
    Some typing here. This box should be as usual/expected.
    \end{minipage}
};
\node[fancytitle, right=10pt] at (box.north west) {Box 3};
\end{tikzpicture}


\end{multicols*}
\end{document}

产生以下结果: MWE 结果

相关内容