1

Background

I'm typesetting a book for which I use twocolumn declaration in the documentclass (it's a very long science book with many tables and figures so I didn't want to redeclare the twocolumn env. after every fullwidth image/table so I chose the document class way).

The problem

At the start of each chapter, there's a quote which I would like to keep onecolumn (ie. at the width of \textwidth), so I don't have it only in the 1st column but rather above both of the columns. So far I've tried minipage environment and \parbox which both do give me a box with width of \textwidth, but the second column isn't pushed lower beneath the quote box so it overflows it. When I've tried a hack using

\begin{table*}
The text of the quote
\endtable*}

the quote displayed as I wanted above both columns but at the next page, not right under the chapter heading. When I've tried to use \Floatbarrier from placeins package, the 2nd column overflown the quote as with the other solutions.

My current setup (posting only MWE here, I have lots of other packages loaded which, I believe, are irrelevant to this) which gives me the undesired result of the quote being in only the 1st column, not above both the columns, is this:

\documentclass[a4paper,10pt,openany,twoside,twocolumn]{book}
\usepackage[inner=3cm,outer=2cm, top=2cm]{geometry}
\usepackage{lmodern}
\usepackage[english]{babel}
\usepackage{dblfloatfix} 
\usepackage{lipsum} % using only for this MWE

\begin{document}
    \chapter{Lorem ipsum sit dolor amet} % (fold)
        \textit{This is the text of a very insightful and deep quote that affects lives of all beings.}
        \begin{flushright}
            Konfucius
        \end{flushright}
        \medskip
        \lipsum[1-6]
\end{document}

Which results in this when compiled in Lualatex:

enter image description here

Question

Is there any way I can produce this desired result in Latex?

enter image description here

Thanks a lot for your help.

3

With use of the macro strip from the package cuted:

\documentclass[a4paper,10pt,openany,twoside,twocolumn]{book}
\usepackage[inner=3cm,outer=2cm, top=2cm]{geometry}
\usepackage{lmodern}
\usepackage[english]{babel}
%\usepackage{dblfloatfix} 
\usepackage{cuted}  % <---

\usepackage{lipsum} % using only for this MWE

\begin{document}
    \chapter{Lorem ipsum sit dolor amet} % (fold)
    \begin{strip}   % <---
        \textit{This is the text of a very insightful and deep quote that affects lives of all beings.}
        \begin{flushright}
            Konfucius
        \end{flushright}
    \end{strip}    % <---
        \medskip
        \lipsum[1-6]
\end{document}

enter image description here

  • Thanks, this is the simplest solution to my problem which works like a charm and since the 2 first answers are essentially the same, I'm accepting yours because it came earlier. Thanks a lot for your help :) – edison23 Aug 23 at 15:28
2

In addition to the strip environment, I would recommend using the epigraph package, which can easily be adapted to your taste:

\documentclass[a4paper,10pt,openany,twoside,twocolumn]{book}
\usepackage[inner=3cm,outer=2cm, top=2cm]{geometry}
\usepackage{lmodern}
\usepackage[english]{babel}
\usepackage{dblfloatfix}
 \usepackage{cuted}
 \usepackage{epigraph}
 \setlength{\epigraphwidth}{0.75\textwidth}
 \renewcommand{\textflush}{flushright}
 \setlength{\epigraphrule}{0pt}
 \setlength{\beforeepigraphskip}{0pt}
 \setlength{\afterepigraphskip}{0pt}

\usepackage{lipsum} % using only for this MWE

\begin{document}

    \chapter{Lorem ipsum sit dolor amet} % (fold)

\begin{strip}
\epigraph{\itshape This is the text of a very insightful and deep quote that affects lives of all beings.}{Konfucius}
\end{strip}
        \lipsum[1-6]

\end{document} 

enter image description here

  • Thanks for your answer, the strip environment works like a charm and thanks for proposing the epigraph but is there a way I can make the horizontal line between the quote and the author only e.g. 0.4\textwidth wide? – edison23 Aug 23 at 15:36
  • 1
    Yes, in several ways. For instance you can remove the line \setlength{\epigraphrule}{0pt} in your preamble and replace it with: \makeatletter \renewcommand{\@epirule}{\rule[.5ex]{0.4\textwidth}{\epigraphrule}} \makeatother – Bernard Aug 23 at 15:50
  • Thanks, I've modified the setting so it aligns the rule to the right: \makeatletter \renewcommand{\@epirule}{\begin{flushright}\rule[.5ex]{0.4\textwidth}{\epigraphrule}\end{flushright}} \makeatother – edison23 Aug 25 at 18:34
  • I also added negative 1.5em vertical space to remove the big margin above the rule - \vspace{-1.5em} - but that's just a matter of taste – edison23 Aug 25 at 18:55
1

This solution modifies \@makechapterhead to include the quote, which is stored in a savebox ahead of time by \chapterquote.

Note that flushright is a list and adds extra space above and below, where as \makebox does not.

\documentclass[a4paper,10pt,openany,twoside,twocolumn]{book}
\usepackage[inner=3cm,outer=2cm, top=2cm]{geometry}
\usepackage{lmodern}
\usepackage[english]{babel}
\usepackage{dblfloatfix} 
\usepackage{lipsum} % using only for this MWE

\newsavebox{\quotebox}

\newcommand{\chapterquote}[2]% #1==quote, #2=credit
{\savebox{\quotebox}{\parbox{\textwidth}{\centering\textit{#1}\\%
  \ifx\empty#2\relax\else \makebox[\textwidth][r]{#2}\fi}}\ignorespaces}

\makeatletter
\def\@makechapterhead#1{%
  \vspace*{50\p@}%
  {\parindent \z@ \raggedright \normalfont
    \ifnum \c@secnumdepth >\m@ne
      \if@mainmatter
        \huge\bfseries \@chapapp\space \thechapter
        \par\nobreak
        \vskip 20\p@
      \fi
    \fi
    \interlinepenalty\@M
    \Huge \bfseries #1\par\nobreak
    \vskip 40\p@ % gap below title
    \ifvoid\quotebox\else
      \box\quotebox
      \bigskip
    \fi
  }}
\makeatother

\begin{document}
    \chapterquote{This is the text of a very insightful and deep quote that affects lives of all beings.}%
        {Konfucius}%
    \chapter{Lorem ipsum sit dolor amet}%
    \lipsum[1-6]
\end{document}

One can simplify the code somewhat by using the etoolbox package to edit \@makechapterhead.

\makeatletter
\patchcmd{\@makechapterhead}{\vskip 40\p@}{%
  \vskip 40\p@ % gap below title
  \ifvoid\quotebox\else
    \box\quotebox
    \bigskip
  \fi}{}{}
\makeatother
  • Thanks, but this solution is unnecessarily complicated for my usecase... but it may certainly be useful for some other people. – edison23 Aug 23 at 15:37
  • Technically, the \@makechapterhead definition is already in your code, you just can't see it. – John Kormylo Aug 23 at 15:45
  • I know it's there but it's just easier for me to do it using the strip environment. There might be cases where I don't have a quote for a chapter and then I'd have to fiddle with the chapter definition again. Anyway, thanks for pointing out the fact about flushright adding margins and possibility to use makebox, it's actually better that way :) – edison23 Aug 23 at 15:48

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.