2

By some weird standards I need to create a quote environment following some strict rules. (as we can see in attached figure)

enter image description here

While the document uses 1.5 spacing the quotation should use regular (1) spacing. Be 2.5cm shifted to right (the whole paragraph) and use smaller fontsize.

Right now I'm using lualatex and I use setspace package to set document line spacing with the command \onehalfspacing. I tried many things but was not able to get this working. Hence I came here to ask you how to accomplish that.

  • 1
    Apart from that, you might want to include a minimal working example (MWE) that includes the documentclass as well as the relevant packages and shows what aou have tried so far. – leandriis Jun 22 at 21:53
  • I always do this, but in this time I didn't have anything to show. – Lin Jun 22 at 22:31
2

You can use xparse to define the new environment.

I also used biblatex to get more flexibility in typesetting citations.

\begin{filecontents*}{\jobname.bib}
@article{oliveira1995,
  author={Oliveira, X.},
  title={whatever},
  year={1995},
}
@article{levi-strauss1970,
  author={Levi-Strauss, A. and Xyz, X. and Abc, Y. and Somebody, S.},
  title={whatever},
  year=1970,
}
@article{laraia2006,
  author={Laraia, L.},
  title={whatever},
  year=2006,
}
\end{filecontents*}

\documentclass[a4paper]{book}
\usepackage[margin=2.75cm]{geometry}
\usepackage[T1]{fontenc}
\usepackage[brazilian]{babel}
\usepackage[style=authoryear]{biblatex}
\usepackage{csquotes}
\usepackage{xparse}
\usepackage{setspace}

\addbibresource{\jobname.bib}
\renewcommand*{\mkbibnamefamily}[1]{\MakeUppercase{#1}}

\NewDocumentEnvironment{squote}{omb}
 {%
  \list{}{
    \setlength{\leftmargin}{2.5cm}%
    \setlength{\rightmargin}{0pt}%
  }%
  \singlespacing\small\item\relax \enquote{#3}
  \IfNoValueTF{#1}{%
    \parencite{#2}%
  }{%
    \parencite[#1]{#2}%
  }%
  \endlist
 }{}

\onehalfspacing

\begin{document}

Conforme \textcite[30]{oliveira1995} relativizar é constituinte do próprio 
conhecimento antropológico. Sendo relativizar uma atitude epistêmica,
eminentemente antropológica, em que o pesquisado busca fugir do etnocentrismo. 
\begin{squote}[239]{levi-strauss1970}
A noção de evolução biológica corresponde a uma hipótese dotada de um dos mais altos 
coeficientes de probabilidade gue podem encontrar-se no dominio das ciências naturais; 
ao passo que o conceito de evolução social ou cultural só conduz: no máximo: a um 
procedimento sedutor, mas perigosamente cómodo: de apresentação dos fatos.
\end{squote}

Este trecho de \textcite{levi-strauss1970} nos ajuda compreender o que 
\textcite[93]{laraia2006} diz sobre a lógica de um sistema cultural depende 
da compreensão das categorias constituídas pelo mesmo \parencite[93]{laraia2006}.

\end{document}

enter image description here

  • The authoryear bibtex snippet will be very helpful, even not related to the OP. What is the omb in the NewDocumentEnvironment ? – Lin Jun 23 at 17:35
  • Removing babel and fontenc and replacing for polyglossia, is this a lualatex compatible code? – Lin Jun 23 at 18:03
  • @Lin Sure, why not? – egreg Jun 23 at 20:38
  • Tried here and received: LaTeX error: "xparse/unknown-argument-type" Unknown argument type 'b' for the command '\environment squote'. – Lin Jun 23 at 23:18
  • @Lin Update your TeX distribution. – egreg Jun 23 at 23:20
5

This is very easy with the quoting package and its eponymous environment:

\documentclass{book}
\usepackage[utf8]{inputenc}%
\usepackage[T1]{fontenc} %
\usepackage{setspace} %
 \usepackage{quoting} %
\usepackage{lipsum}
\quotingsetup{font={footnotesize, noindent}, leftmargin=2.5cm, rightmargin=0cm}

 \begin{document}

\onehalfspacing

 \lipsum[2]

\begin{singlespacing}
    \begin{quoting}[]
    Sed feugiat. Cum sociis natoque penatibus et magnis dis parturient
     montes, nascetur ridiculus mus. Ut pellentesque augue sed urna.
     Vestibulum diam eros, fringilla et, consectetuer eu, nonummy id,
     sapien. Nullam at lectus. In sagittis ultrices mauris. Curabitur
     malesuada erat sit amet massa. Fusce blandit. Aliquam erat volutpat.
     Aliquam euismod. Aenean vel lectus. Nunc imperdiet justo nec dolor.
    \end{quoting}
\end{singlespacing}
\lipsum[3]

\end{document} 

enter image description here

3

Here is an adapted version of one of my previous answers:

enter image description here

\documentclass{article}
\usepackage{setspace}
\usepackage{lipsum}

\onehalfspacing

\usepackage{changepage}
\newenvironment{myquote}{\par\vspace{\baselineskip}\begin{singlespace*}\begin{adjustwidth}{2.5cm}{0cm}\small}{\end{adjustwidth}\end{singlespace*}\par\vspace{\baselineskip}}


\begin{document}

\lipsum[1]

\begin{myquote}
\lipsum[5]
\end{myquote}

\lipsum[1]
\end{document}
  • where changepage and etoolbox are used? – Lin Jun 22 at 22:29
  • 1
    @Lin: changepage in needed for the adjustwidth environment that allows to locally change the margins (I used it for the 2.5 cm indentation from the left margin). etoolbox is a leftover from my previous answer and is not neede. I have therefore removed it from the MWE. – leandriis Jun 23 at 8:47

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.