6

I am writing a quote using the csquote package and the Tex code is:

\documentclass[12pt]{article}
\usepackage[a4paper]{geometry}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{csquotes}
\usepackage{lipsum}

\begin{document}

\lipsum[1]

\blockquote{\noindent\hrulefill \\
Nam dui ligula, fringilla a, euismod sodales, sollicitudin vel, wisi. Morbi auctor lorem non justo. Nam lacus libero, pretium at, lobortis vitae, ultricies et, tellus. Donec aliquet, tortor sed accumsan bibendum, erat ligula aliquet magna, vitae ornare odio metus a mi. Morbi ac orci et nisl hendrerit mollis. Suspendisse ut massa. Cras nec ante. Pellentesque a nulla. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aliquam tincidunt urna. Nulla ullamcorper vestibulum turpis. Pellentesque cursus luctus mauris.\\
\noindent\hrulefill}

\lipsum[3]

\end{document}

At first it worked flawlessly, the line matched the text width. After I've re-run the command for typesetting while working on other parts of the document, the bottom line disappeared.

I have tried inserting the line after and outside the blockquote and it appears again (even multiple ones). Why is it disappearing? I haven't changed anything in the code.

The example text is actual text and not \lipsum[2] because I needed actual text to reproduce the problem (if I write it and put the rule-command after it, the rule appears again).

2 Answers 2

4

blockquote does not indent its argument text, so there's no need for \noindent. However, to provide a full line of fill, set something (nothing) at the beginning of the line:

enter image description here

\documentclass[12pt]{article}
\usepackage[a4paper]{geometry}
\usepackage{csquotes,lipsum}

\begin{document}

\lipsum[1]

\blockquote{\mbox{}\hrulefill \par
Nam dui ligula, fringilla a, euismod sodales, sollicitudin vel, wisi. 
Morbi auctor lorem non justo. Nam lacus libero, pretium at, lobortis 
vitae, ultricies et, tellus. Donec aliquet, tortor sed accumsan 
bibendum, erat ligula aliquet magna, vitae ornare odio metus a mi. 
Morbi ac orci et nisl hendrerit mollis. Suspendisse ut massa. Cras 
nec ante. Pellentesque a nulla. Cum sociis natoque penatibus et 
magnis dis parturient montes, nascetur ridiculus mus. Aliquam 
tincidunt urna. Nulla ullamcorper vestibulum turpis. Pellentesque 
cursus luctus mauris. 
\\\mbox{}\hrulefill}

\lipsum[3]

\end{document}

If this type of decoration is something you're interested in using more frequently, you could incorporate it in a fixed command, rather than adding horizontal rules manually. It provides consistency. Below is an example that uses a regular tabular to set the quote (foregoing page breaking, of course):

enter image description here

\documentclass[12pt]{article}
\usepackage[a4paper]{geometry}
\usepackage{lipsum}

\newcommand{\blockquote}[1]{\par\bigskip{%
  \centering\begin{tabular}{p{.85\linewidth}}
    \hline \\[\dimexpr-\normalbaselineskip+5pt] #1 \\[5pt] \hline
  \end{tabular}\par}\bigskip}
\begin{document}

\lipsum[1]

\blockquote{%
Nam dui ligula, fringilla a, euismod sodales, sollicitudin vel, wisi. 
Morbi auctor lorem non justo. Nam lacus libero, pretium at, lobortis 
vitae, ultricies et, tellus. Donec aliquet, tortor sed accumsan 
bibendum, erat ligula aliquet magna, vitae ornare odio metus a mi. 
Morbi ac orci et nisl hendrerit mollis. Suspendisse ut massa. Cras 
nec ante. Pellentesque a nulla. Cum sociis natoque penatibus et 
magnis dis parturient montes, nascetur ridiculus mus. Aliquam 
tincidunt urna. Nulla ullamcorper vestibulum turpis. Pellentesque 
cursus luctus mauris.}

\lipsum[3]

\end{document}

To allow page breaking of such quotes, one could also consider mdframed.

2
  • Thanks, could you explain to me the bit "However, to provide a full line of fill, set something (nothing)"? I am not sure I understand what you mean there. Thanks!
    – Alenanno
    Commented Sep 18, 2013 at 16:21
  • 3
    @Alenanno: In order for fill to stretch, it need something to stretch from. \mbox{} prints nothing, but sets a marker from which fill can stretch.
    – Werner
    Commented Sep 18, 2013 at 16:54
1

If you want this style for all \blockquotes, then you can use

\renewcommand{\mkblockquote}[4]{\hrulefill\par#1#2#4#3\par\hrulefill}

This redefines how the various blockquote commands are displayed (when it is exceeds the given threshold and is typeset as a displayed quotation). See section 8.7 of the manual for details about what the different arguments mean.

\documentclass[12pt]{article}
\usepackage[a4paper]{geometry}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{csquotes}
\usepackage{lipsum}
\renewcommand{\mkblockquote}[4]{\hrulefill\par#1#2#4#3\par\hrulefill}

\begin{document}

\lipsum[1]

\blockquote{Nam dui ligula, fringilla a, euismod sodales, sollicitudin vel, wisi. Morbi auctor lorem non justo. Nam lacus libero, pretium at, lobortis vitae, ultricies et, tellus. Donec aliquet, tortor sed accumsan bibendum, erat ligula aliquet magna, vitae ornare odio metus a mi. Morbi ac orci et nisl hendrerit mollis. Suspendisse ut massa. Cras nec ante. Pellentesque a nulla. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aliquam tincidunt urna. Nulla ullamcorper vestibulum turpis. Pellentesque cursus luctus mauris.}

\lipsum[3]

\end{document}
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .