避免多列分頁

避免多列分頁

我正在嘗試將 Scrum 使用者故事添加到乳膠檔案中,但頁面末尾的分頁符號破壞了流程。例如,我正在努力實現: 在此輸入影像描述

然而,當列到達分頁符號時,它們就會扭曲並變成這樣:在此輸入影像描述

這基本上就是我的乳膠文件中的內容:

\begin{multicols}{2}
[
\textbf{Priority:} \textit{5}\hfill \textbf{Size Estimate:} \textit{2}
\linebreak As a \textit{developer}, I want to \textit{implement a basic local database with a single table} in order to \textit{have a basis for storing more information and expanding it at a later point}.
]
\textbf{Set of Tasks}
\begin{itemize}
    \item Research the setup process for a local database.
    \item Create database.
    \item Add restrictions to the database.
    \item Add new entry in the form of a table.
\end{itemize}

\columnbreak

\textbf{Acceptance Criteria}
\begin{itemize}
    \itemsep0em 
    \item Test the functionality of the table.
    \item Test restrictions concerning password, access and privileges.
    \item Successful queries to the table with simple INSERT, SELECT, UPDATE and DELETE operations.
\end{itemize}
\end{multicols}

我嘗試透過建立表格來繞過它,但表格似乎不接受逐項部分。有沒有辦法繞過這個分頁符號或任何其他解決方案來解決這個問題?任何幫助將不勝感激!

答案1

你不可能真正兩全其美。從某種意義上說,您濫用了multicol (它試圖平衡材料並在必要時添加分頁符,而您似乎想要的是一個兩列“表格”,左側為“任務”,右側為“條件」。

為了實現這一點,您需要明確地強制在兩者之間進行分欄。但為了完成這項工作,您的整個材料需要適合頁面上的剩餘空間,特別是必須保留足夠的空間來將任務材料完全放入第一列。

由於情況並非如此,因此\columnbreak最終出現在第二列並結束它。所以你必須決定在這種情況下你真正想看到什麼

  • 手動更正(例如使用\enlargethispagemulticols 或間距參數)或您是否需要自動化(資料庫)解決方案?
  • 如果使用者故事不適合單一頁面,則開始一個新頁面
  • 當使用者故事出現在分頁符號上時更改使用者故事的行為(如果它應該自動工作,則相當困難)

如果您總是希望使用者故事始終位於單一頁面上,那麼您可以將整個故事放在一個盒子(迷你頁)中,這樣它就不會用類似的東西來破壞和分離故事

   \vfil\penalty9999\vfilneg

這樣,如果故事不完全適合,TeX 就會在故事之前中斷(假設故事永遠不會超過一頁)。

更新

我可能應該說,對於您的情況,使用表格實際上會更簡單,例如

\usepackage{tabularx}
\newcolumntype{Y}{>{\fussy}X}

\noindent\begin{tabularx}{\textwidth}{YY}
\textbf{Set of Tasks}
\begin{itemize}
    \item Research the setup process for a local database.
    \item Create database.
    \item Add restrictions to the database.
    \item Add new entry in the form of a table.
\end{itemize}
&
\textbf{Acceptance Criteria}
\begin{itemize}
    \itemsep0em 
    \item Test the functionality of the table.
    \item Test restrictions concerning password, access and privileges.
    \item Successful queries to the table with simple INSERT, SELECT, UPDATE and DELETE operations.
\end{itemize}
\end{tabularx}

或其適當的變體(以上只會將任務作為一個標準)

相關內容