2

I want to do exactly the same you can find here : The Quotation Environment :

  \documentclass{article}
\usepackage{quoting,xparse}

\NewDocumentCommand{\bywhom}{m}{% the Bourbaki trick
  {\nobreak\hfill\penalty50\hskip1em\null\nobreak
   \hfill\mbox{\normalfont(#1)}%
   \parfillskip=0pt \finalhyphendemerits=0 \par}%
}

\NewDocumentEnvironment{pquotation}{m}
  {\begin{quoting}[
     indentfirst=true,
     leftmargin=\parindent,
     rightmargin=\parindent]\itshape}
  {\bywhom{#1}\end{quoting}}

\begin{document}

This is not a quotation, this is normal text.

\begin{pquotation}{Jack Johnson, 2003}
This is a quotation. This is a quotation.
This is a quotation. This is a quotation.
This is a quotation. This is a quotation.

\end{pquotation}
This is not a quotation, this is normal text.


\end{document}

BUT! I'd like to have automatic french quote before and after paragraph quotation.

I tried begintext=«~ option, it's ok for the begin. But endtext put ~» at a new line.

I tried also :

\NewDocumentEnvironment{verba}{m}
{\begin{quotation}«~\small\itshape}
    {~»{}\bywhom{#1}\end{quotation}}

but closing quotation it's to a new line...

Thank you very much if you can suggest me how to create a new environment for sociological verbatim.

1 Answer 1

0

Note that xparse is no longer needed. For French quotes, you need T1 encoding.

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{quoting}

\NewDocumentCommand{\bywhom}{m}{% the Bourbaki trick
  {\nobreak\hfill\penalty50\hskip1em\null\nobreak
   \hfill\mbox{\normalfont(#1)}%
   \parfillskip=0pt \finalhyphendemerits=0 \par}%
}

\NewDocumentEnvironment{pquotation}{m}
  {\begin{quoting}[
     indentfirst=true,
     leftmargin=\parindent,
     rightmargin=\parindent]\itshape«\ignorespaces}
  {\unskip»\bywhom{#1}\end{quoting}}

\begin{document}

This is not a quotation, this is normal text.

\begin{pquotation}{Jack Johnson, 2003}
This is a quotation. This is a quotation.
This is a quotation. This is a quotation.
This is a quotation. This is a quotation.
\end{pquotation}
This is not a quotation, this is normal text.

\end{document}

No blank line before \end{pquotation}.

enter image description here

If you feel compelled to allow blank lines before \end{pquotation}, you can do as follows:

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{quoting,xparse}

\NewDocumentCommand{\bywhom}{m}{% the Bourbaki trick
  {\nobreak\hfill\penalty50\hskip1em\null\nobreak
   \hfill\mbox{\normalfont(#1)}%
   \parfillskip=0pt \finalhyphendemerits=0 \par}%
}

\ExplSyntaxOn
\NewDocumentCommand{\removetrailingpar}{+m}
 {
  \tl_set:Ne \l_tmpa_tl { \tl_trim_spaces:n { #1 } }
  \regex_replace_once:nnN { (?:\s|\c{par})*\Z } { } \l_tmpa_tl
  \tl_use:N \l_tmpa_tl
 }
\ExplSyntaxOff

\NewDocumentEnvironment{pquotation}{m+b}
 {
  \begin{quoting}[
    indentfirst=true,
    leftmargin=\parindent,
    rightmargin=\parindent
  ]\itshape
  «\removetrailingpar{#2}»
  \bywhom{#1}
  \end{quoting}
 }{}
\ExplSyntaxOff

\begin{document}

This is not a quotation, this is normal text.

\begin{pquotation}{Jack Johnson, 2003}
This is a quotation. This is a quotation.
This is a quotation. This is a quotation.
This is a quotation. This is a quotation.

\end{pquotation}
This is not a quotation, this is normal text.

\end{document}
2
  • Sorry, I think there should be an italic correction. This would be more french typical.
    – user206750
    Dec 20, 2023 at 23:22
  • 1
    Thank you very much !! I just put ~» because french typography needs a space between words and ». I don't understand why /unskip and /ignorespaces do the work, but it's perfect :) Dec 21, 2023 at 9:13

You must log in to answer this question.

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