Французская цитата в цитатной среде для социологических дословных изложений

Французская цитата в цитатной среде для социологических дословных изложений

Я хочу сделать то же самое, что вы можете найти здесь:Среда котировок:

  \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}

НО! Я бы хотел иметь автоматическую французскую цитату до и после цитирования абзаца.

Я попробовал begintext="~ option, для начала нормально. Но endtext ставит ~" на новой строке.

Я также попробовал:

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

но закрывающая цитата - это новая строка...

Большое спасибо, если вы сможете подсказать мне, как создать новую среду для социологической дословности.

решение1

Обратите внимание, что xparseбольше не требуется. Для французских цитат вам понадобится кодировка T1.

\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}

Перед . нет пустой строки \end{pquotation}.

введите описание изображения здесь

Если вы считаете необходимым разрешить пустые строки перед \end{pquotation}, вы можете сделать следующее:

\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}

Связанный контент