當嘗試使用 \multicols* 新增段落時,文字會轉到頁面底部

當嘗試使用 \multicols* 新增段落時,文字會轉到頁面底部

我有以下程式碼:

\begin{multicols*}{3}
text text text text text text text text text text text text text text 

more text
\columnbreak
\begin{minted}{python}
    def python(self, n):
        i = 0
        while i in range(n + 1):
            print("an example code")

\end{minted}
\end{multicols*}

我希望更多的文字顯示在它和其他文字之間有一個行間隙,但是,它出現在頁面的底部

https://i.stack.imgur.com/U4ZGy.jpg

答案1

使用multicols*意味著您要求它製作完整尺寸的列。在範例中,第一列只有 2 個段落,因此填充該列的唯一可拉伸部分位於兩個段落之間,因此一個出現在頂部,一個出現在底部。

由於您沒有顯示完整的範例(這要好得多,因為它可以由其他人運行!)我只能猜測,但您可能使用的文件類別不會產生參差不齊的列,而是會產生刷新的列。因此,要么更改 ( \raggedbottom),要么multicols不使用星號,以便平衡您的列。

相關內容