1

I have found a nice template on the Internet, and wanted to hack around it. I have no TEX experience; this is the second time I am using it.

My problem is, essentially, TEX figures out one of the sections wouldn't fit to the page, so it breaks the page, and moves the section to the next page.

I don't want that; I'd like it to continue to the next page. In my example, I'd like "Bar" section to follow the "Foo" section immediately in the first page, then split/break the part of Bar that wouldn't fit to the first page to the second page. I have searched many times with several keywords, but couldn't find an easy to understand solution. I have tried nobottomtitles*, but that didn't help. Maybe sections would flow nicely, but lists don't want to break. I tried to preprocess the file, hoping to find a break around the boxes, but that didn't give any information either.

I'd be very happy, if you could help me resolve the issue. I'm sorry, if I picked the wrong tags.

\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}

This is how it looks today

  • 1
    A tabular can never be split across pages. But do you need a tabular to begin with? – egreg Oct 1 '17 at 10:27
  • removed tag: tex-core. that's not applicable to latex, and anything with a \documentclass is latex. – barbara beeton Oct 1 '17 at 13:50
  • @egreg Thank you for explaining why it didn't work even after tens of attempts. I am not a latex expert, therefore I cannot know whether I can do fine without tabular. As I said, I grabbed a template and tried to hack around it. But since you explained that I cannot split tabular, then I'll start looking into alternatives. Maybe I can \end{tabular} earlier, then another \begin{tabular} that starts in the next page... – user1150609 Oct 1 '17 at 14:16
  • @barbarabeeton Sorry for picking the wrong tag. – user1150609 Oct 1 '17 at 14:17
  • no problem about the tag; happens quite often, especially with newbies. more to the point, if you don't really need to present your information in a table, there are other ways of getting the appearance you seem to be looking for. or if table, there's longtable which does break across pages. – barbara beeton Oct 1 '17 at 14:50
3

Without the tabular making an unbreakable box, lists break like normal pargraph text.

enter image description here

\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}

If you really need a tabular layout (which doesn't seem to be the case here) you can use longtable

enter image description here

\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}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.