我在网上找到了一个不错的模板,想尝试一下。我没有 TEX 经验;这是我第二次使用它。
我的问题是,本质上,TEX 发现其中一个部分无法容纳该页面,因此它会拆分该页面并将该部分移动到下一页。
我不想这样;我希望它继续到下一页。在我的例子中,我希望“Bar”部分在第一页中紧跟“Foo”部分,然后将 Bar 中不适合第一页的部分拆分/拆分到第二页。我用几个关键词搜索了很多次,但找不到一个容易理解的解决方案。我试过了nobottomtitles*
,但没有帮助。也许部分会流畅,但列表不想中断。我尝试预处理文件,希望找到围绕框的中断,但这也没有提供任何信息。
如果您能帮助我解决这个问题,我会非常高兴。如果我选错了标签,我很抱歉。
\documentclass[10pt,a4paper]{article}
\usepackage[english]{babel}
\usepackage{blindtext}
\usepackage[nobottomtitles*,compact]{titlesec}
\usepackage{array}
\titleformat{\section}{\Large\scshape\raggedright}{}{0em}{}[\titlerule]
\titlespacing{\section}{0pt}{3pt}{3pt}
\titleformat{\subsection}[hang]{\normalsize\scshape\raggedright}{\quad}{0em}{}
\titlespacing*{\subsection}{0pt}{0pt}{0pt}
\renewcommand{\bottomtitlespace}{0pt}
\newcolumntype{L}[1]
{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{C}[1]
{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{R}[1]
{>{\raggedleft\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\begin{document}
\pagestyle{empty}
\section{Foo}
\begin{tabular}{R{1.86cm}|p{11cm}}
& \blindlist{enumerate}[17] \\
&
\end{tabular}
\section{Bar}
\begin{tabular}{R{1.86cm}|p{11cm}}
& \blindlist{enumerate}[8] \\
&
\end{tabular}
\end{document}
答案1
如果不tabular
制作牢不可破的框,列表将会像普通段落文本一样中断。
\documentclass[10pt,a4paper]{article}
\usepackage[english]{babel}
\usepackage{blindtext}
\usepackage[nobottomtitles*,compact]{titlesec}
\usepackage{array}
\titleformat{\section}{\Large\scshape\raggedright}{}{0em}{}[\titlerule]
\titlespacing{\section}{0pt}{3pt}{3pt}
\titleformat{\subsection}[hang]{\normalsize\scshape\raggedright}{\quad}{0em}{}
\titlespacing*{\subsection}{0pt}{0pt}{0pt}
\renewcommand{\bottomtitlespace}{0pt}
\newcolumntype{L}[1]
{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{C}[1]
{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{R}[1]
{>{\raggedleft\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\begin{document}
\pagestyle{empty}
\section{Foo}
\blindlist{enumerate}[17]
\section{Bar}
\blindlist{enumerate}[8]
\end{document}
如果你真的需要表格布局(这里似乎不是这种情况),你可以使用longtable
\documentclass[10pt,a4paper]{article}
\usepackage[english]{babel}
\usepackage{blindtext}
\usepackage[nobottomtitles*,compact]{titlesec}
\usepackage{array,longtable}
\titleformat{\section}{\Large\scshape\raggedright}{}{0em}{}[\titlerule]
\titlespacing{\section}{0pt}{3pt}{3pt}
\titleformat{\subsection}[hang]{\normalsize\scshape\raggedright}{\quad}{0em}{}
\titlespacing*{\subsection}{0pt}{0pt}{0pt}
\renewcommand{\bottomtitlespace}{0pt}
\newcolumntype{L}[1]
{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{C}[1]
{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{R}[1]
{>{\raggedleft\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\begin{document}
\pagestyle{empty}
% just for the test so \blindlist generates table rows
\section{Foo}
\begin{longtable}{R{1.86cm}|p{9cm}}
& some text\\& some text\\& some text\\& some text\\& some text\\
& some text\\& some text\\& some text\\& some text\\& some text\\
& some text\\& some text\\& some text\\& some text\\& some text\\
& some text\\& some text\\& some text\\& some text\\& some text\\
& some text\\& some text\\& some text\\& some text\\& some text\\
& some text\\& some text\\& some text\\& some text\\& some text\\
& some text\\& some text\\& some text\\& some text\\& some text\\
& some text\\& some text\\
\end{longtable}
\section{Bar}
\begin{longtable}{R{1.86cm}|p{9cm}}
& some text\\& some text\\& some text\\& some text\\
& some text\\& some text\\& some text\\& some text\\
& some text\\& some text\\& some text\\& some text\\
& some text\\& some text\\& some text\\& some text\\
& some text\\& some text\\& some text\\& some text\\
\end{longtable}
\end{document}