2

I want to make quotes like the following image at the start of a chapter, but I can't seem to find how :(

This is what i been using for Now but i like this one. Can you help with that. thanks :) have a good day

\documentclass[11pt]{book}

\usepackage{microtype}
\usepackage{times}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{graphicx}
\usepackage{xcolor}
\usepackage{lipsum}
%%%%*************************************************
% fancy quotes
\definecolor{quotemark}{gray}{0.7}
\makeatletter
\def\fquote{%
  \@ifnextchar[{\fquote@i}{\fquote@i[]}%]
}

\def\fquote@i[#1]{%
  \def\tempa{#1}%
  \@ifnextchar[{\fquote@ii}{\fquote@ii[]}%]
}%

\def\fquote@ii[#1]{%
  \def\tempb{#1}%
  \@ifnextchar[{\fquote@iii}{\fquote@iii[]}%]
}%

\def\fquote@iii[#1]{%
  \def\tempc{#1}%
  \vspace{1em}%
  \noindent%
  \begin{list}{}{%
    \setlength{\leftmargin}{0.1\textwidth}%
    \setlength{\rightmargin}{0.1\textwidth}%
  }%
    \item[]%
      \begin{picture}(0,0)%
        \put(-15,-5){\makebox(0,0){\scalebox{3}
          {\textcolor{quotemark}{``}}}}%
      \end{picture}%
      \begingroup\itshape}%
\def\endfquote{%
  \endgroup\par%
  \makebox[0pt][l]{%
    \hspace{0.8\textwidth}%
    \begin{picture}(0,0)(0,0)%
      \put(15,15){\makebox(0,0){%
        \scalebox{3}{\color{quotemark}''}}}%
    \end{picture}}%
  \ifx\tempa\empty%
  \else%
    \ifx\tempc\empty%
      \hfill\rule{100pt}{0.5pt}\\\mbox{}\hfill\tempa,\
      \emph{\tempb}%
    \else%
      \hfill\rule{100pt}{0.5pt}\\\mbox{}\hfill\tempa,\
      \emph{\tempb},\ \tempc%
    \fi\fi\par%
  \vspace{0.5em}%
  \end{list}}
\makeatother

%%%*********************************************

\begin{document}
  \chapter{Graph theory}
  \begin{fquote}[Confucius]Our greatest glory is not in
    never falling, but in rising every time we fall.
  \end{fquote}
  \lipsum[2]
  \begin{fquote}[Lewis Carroll][Alice in Wonderland]
    [1899]Begin at the beginning,'' the King said,
    gravely, ``
  \end{fquote}
  \lipsum[2]
\end{document}

enter image description here

moewe
  • 175,683
  • Sorry for being thick, but can you explain what exactly you are asking again? The code you posted roughly produces something similar to the picture. Do you want the output to look more like the picture? If so, please explain what exactly needs to be changed in more detail. – moewe Sep 17 '18 at 14:50
  • yeah i want the output similar to the picture :) – Alexia Colaud Sep 17 '18 at 14:54
  • It would still help if you could list exactly what you want to have changed from the status quo, but maybe that is just me. The original code seems to come from https://tex.stackexchange.com/a/53452/35864. Possibly interesting: https://tex.stackexchange.com/q/16964/35864, https://tex.stackexchange.com/q/98984/35864 – moewe Sep 17 '18 at 15:03
  • I want the format and the position of quotation mark and the vspace between the quote and chapter title – Alexia Colaud Sep 17 '18 at 15:06
  • I saw this kind of block quotes but not actually what i wanted can you just tell me how can i modify just the format and position of quotation mark?? that will be enough for me – Alexia Colaud Sep 17 '18 at 15:10

2 Answers2

4

Building upon pluton's answer to "Inspirational" quote at start of chapter we can come up with the following

\documentclass[11pt]{book}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{libertinus}
\usepackage{microtype}
\usepackage[english]{babel}
\usepackage{graphicx}
\usepackage{xcolor}
\usepackage{csquotes}
\usepackage{lipsum}

\definecolor{quotemark}{gray}{0.7} \makeatletter \newlength\origparskip

\newcommand{\fquote}{% @ifnextchar[{\fquote@i}{\fquote@i[]}%] }

\def\fquote@i[#1]{% @ifnextchar[{\fquote@ii{#1}}{\fquote@ii{#1}[]}%] }%

\def\fquote@ii#1[#2]{% \def\pqm@tempa{#1}% \def\pqm@tempb{#2}% \noindent \list {} {\setlength{\leftmargin}{0.3\textwidth}% \setlength{\rightmargin}{0.1\textwidth}% \setlength{\origparskip}{\parskip}}% \item[]% \begin{picture}(0,0)% \put(-15,-8){\makebox(0,0){\scalebox{4}{% \textcolor{quotemark}{\textquotedblright}}}}% \end{picture}% \begingroup \itshape \ignorespaces}%

\def\endfquote{% \endgroup \par \raggedleft \ifx\pqm@tempa\empty \else {\bfseries --- \pqm@tempa\par}% \setlength{\parskip}{\origparskip}% \ifx\pqm@tempb\empty \else (\pqm@tempb)% \fi \fi \par \endlist} \makeatother

\begin{document} \chapter{Graph theory} \begin{fquote}[Wim Crouwel][Graphic designer and typographer] You can’t do better design with a computer, but you can speed up your work enormously. \end{fquote} \lipsum[2] \begin{fquote}[Wim Crouwel] You can’t do better design with a computer, but you can speed up your work enormously. \end{fquote} \lipsum[2] \end{document}

The code has been changed to output only the opening quotation mark and fquote only accepts two optional arguments now: One for the name and one for the parenthetical insertion.

screenshot of the result

moewe
  • 175,683
  • Should the quotes be opening? – Sigur Sep 17 '18 at 16:39
  • 2
    @Sigur Let's say they are opening in the sense of the question ;-). If you shift them down a tiny bit they would work as German opening quotes as well (which are „Gänsefüßchen“ 99-bottom and 66-top). – moewe Sep 17 '18 at 16:41
  • Thta is exactly what i want thank youuuuu so much @moewe – Alexia Colaud Sep 17 '18 at 17:10
  • how can i add space between the quote and the text ?@moewe – Alexia Colaud Sep 17 '18 at 17:14
  • and thank you again I really appreciate your help:) – Alexia Colaud Sep 17 '18 at 17:15
  • @AlexiaColaud Remove the % first in %\vspace{0.5em} and adjust the number to your liking. – moewe Sep 17 '18 at 18:54
  • I tried the code but i didn't get the same quotation mark may be because I have in my preambule : \usepackage[babel,french=guillemets]{csquotes} – Alexia Colaud Sep 17 '18 at 19:02
  • If I delet the options that will impact the quotation mark in my text too ? – Alexia Colaud Sep 17 '18 at 19:04
  • @AlexiaColaud Even with \usepackage[babel,french=guillemets]{csquotes} I get the same quotation marks in the MWE. The result might be slightly different depending on your font, but the overall appearance should at least be similar. If you get something wildly different, please prepare a full MWE that reproduces the undesired behaviour and show it. – moewe Sep 17 '18 at 19:04
  • yeah i get a different quotation mark << << wwhen i delet the options I get the same result as shown in your code – Alexia Colaud Sep 17 '18 at 19:05
  • 1
    @AlexiaColaud (1) Where do you get that quotation mark? (2) Please show me a complete example document that reproduces the behaviour. I could not reproduce it only by adding \usepackage[babel,french=guillemets]{csquotes} to the code above, even after changing to french as the main language I still get a big "„" in front of the quotation. Of course inside the epigraph things might be different. But I'm not quite sure if I understand you correctly, so I need to see the code. – moewe Sep 17 '18 at 19:07
  • its good now I did recompile the code twice with the \usepackage[babel,french=guillemets]{csquotes} and now i get the same quotation mark thank youuuuuu @moewe :) you are the best – Alexia Colaud Sep 17 '18 at 19:10
  • 1
    @AlexiaColaud Very good. Glad I could help. – moewe Sep 17 '18 at 19:12
  • @moewe I am getting the following error from your code when I try to implement it in an overleaf document Extra \else.

    "@include ...ediate \closeout @partaux \fi \else \deadcycles \z@ @nameuse ... l.57 \include{Main/Chap1/Intro}

    I'm ignoring this; it doesn't match any \if". I am not sure which IF condition it refers to. It still produces the quote design you posted but I wasn't able to remove the error. Could you please point me in the right direction?

    – Sara Krauss Mar 11 '21 at 13:10
  • @SaraKrauss The code as posted compiles fine for me both on my local machine as well as on Overleaf. If you get errors that's probably because some other code in your preamble interferes with the code here. I think I will only be able to say more if you can show me a short example document that reproduces the error. – moewe Mar 11 '21 at 14:22
  • 1
    @SaraKrauss There was a missing \fi. I edited the answer and added it. – moewe Mar 11 '21 at 15:05
  • @moewe thank you very much. It works! now I can start my thesis in peace – Sara Krauss Mar 11 '21 at 15:08
  • @moewe btw Is it possible to move the quote before the chapter? I mean at the top right of the page above the chapter text? I could not figure out where to edit for that? – Sara Krauss Mar 20 '21 at 18:00
  • @SaraKrauss On first glance I'd think that would be (much?) harder, because the \chapter command starts a new page. So you can't just use this environment before \chapter. If you really want an answer, I suggest you ask a new question (the document class is going to be important, so make sure your MWE for the question uses the actual document class and heading settings of your document.) – moewe Mar 20 '21 at 19:22
4

I'm not sure I understood exactly what you want, but this is what I propose, based on epigraph. I replaced the obsolete times package with newtxtext, newtxmath based on the Times clone TeX Gyre Termes:

\documentclass[11pt]{book}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{microtype}
\usepackage{newtxtext, newtxmath}
\usepackage[english]{babel}
\usepackage{graphicx}
\usepackage[svgnames]{xcolor}
\usepackage{lipsum}
%%%%*************************************************
\usepackage{tabularx}
\usepackage{epigraph}
\setlength{\epigraphwidth}{0.6\textwidth}
\setlength{\epigraphrule}{0pt}
%%%*********************************************
\newcommand{\myopeningquote}{\smash{\raisebox{-1.25\height}{\llap{\scalebox{3}
          {\textcolor{Silver}{``}}\,}}}}
\newcommand{\myclosingquote}{\raisebox{-0.66\height}{\scalebox{3}{\textcolor{Silver}{”}}}}

\begin{document}

  \chapter{Graph theory}

\epigraph{\itshape\myopeningquote Our greatest glory is not in never falling, but in rising every time we fall.\myclosingquote}
{Confucius}%

  \lipsum[2]

\epigraph{\itshape\myopeningquote Begin at the beginning,'' the King said,
    gravely,\myclosingquote}
{Lewis Carroll, \emph{Alice in Wonderland} (1865)}%

  \lipsum[2]

\end{document} 

enter image description here

Bernard
  • 271,350