Text Formattingcsquotes: displayquote with and without quotation marks

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
SonnenAnlieger
Posts: 4
Joined: Thu Feb 26, 2015 10:58 am

csquotes: displayquote with and without quotation marks

Post by SonnenAnlieger »

Hi there,

I am working on my German PhD in law. I found out that the package csquotes is perfect for citations and quotes. The only problem I am facing is that I need two environments for "displayquote". One with guillemets as quotation marks and one without any quotation marks. The latter one is for citing law texts.

This is what I got so far:

Code: Select all

\documentclass[a4paper,10pt,fncontinued]{jurabook}

\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage[T1]{fontenc}

\usepackage{parskip}
\usepackage[normalem]{ulem}

\usepackage[babel,german=guillemets]{csquotes}

\newenvironment{zitat}[2]{\begin{small}\begin{displayquote}#1#2 }{\end{displayquote} \end{small}}
\newenvironment*{zitatc}{\displaycquote}{\enddisplaycquote}
\newenvironment{gzitat}[2]{\begin{small}\begin{displayquote}#1#2}{\end{displayquote}\end{small}}

\renewcommand{\mkbegdispquote}[2]{\openautoquote}
\renewcommand{\mkenddispquote}[2]{\closeautoquote#1#2}

\begin{document}
test
\end{document}
So I defined three new environments called zitat, zitatc and gzitat of displayquote. The last one should be the one without quotation marks.

Can anyone help me on this? Thank you!!

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

csquotes: displayquote with and without quotation marks

Post by Johannes_B »

Please be a bit more verbose on your requirements, what should be printed where and how. Let us take care of the implementation. Right now, you have 3 quote environments, and i have no idea what they shall do, which one is to cite laws (g for Gesetz?).

Please be aware, that \small is a font switch, not an environment. Since you are writing in german, a link to our german partner site TeXwelt. Feel free to ask there as well.
Wieso kann ich Schriftauszeichnungen nicht als Umgebung nutzen?
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
SonnenAnlieger
Posts: 4
Joined: Thu Feb 26, 2015 10:58 am

csquotes: displayquote with and without quotation marks

Post by SonnenAnlieger »

Ok, I'll try to be more precise. In my paper I mostly have to quote citations and legal text. For the legal text I do not need any quotation marks. As a fact I would like to have none. The other quotes should have quotations marks no matter which kind of.

And I want to use this environment \begin{displayquote}<Quote>\end{displayquote} to make it easier for me to distinguish between normal text and quotes.

So I thought of defining two different environments called "zitat" and "gzitat". The latter should be without quotation marks as it should quote legal text. The third of these environments is just an alias and is called "zitatc". I need this to link the quote to a bibtex entry.

All quotations should be smaller than the normale text. This is why I put the \small-Command in the new environments. I don't know if there is a better way for achieving this.

I used the commands

Code: Select all

\renewcommand{\mkbegdispquote}[2]{\openautoquote}
\renewcommand{\mkenddispquote}[2]{\closeautoquote#1#2}
to get quotation marks to the displayquote-environment at all. But what I really need is one environment with and one without quotation marks.

I hope that helps you to understand my problem.

Thanks a lot!
Stefan
rais
Posts: 419
Joined: Sun Nov 16, 2014 8:51 pm

csquotes: displayquote with and without quotation marks

Post by rais »

SonnenAnlieger wrote: And I want to use this environment \begin{displayquote}<Quote>\end{displayquote} to make it easier for me to distinguish between normal text and quotes.

So I thought of defining two different environments called "zitat" and "gzitat".
That may all be well, but how are the environment's arguments to be handled? According to the csquotes' documentation, \begin{displayquote} understands two optional arguments---for citation and final punctuation---but what about the arguments to your own environments? This:
SonnenAnlieger wrote:

Code: Select all

\newenvironment{zitat}[2]{\begin{small}\begin{displayquote}#1#2 }{\end{displayquote} \end{small}}
defines a new environment `zitat', that has two mandatory arguments, which are passed on to the internally called `displayquote' environment---as (first part of its) body. Why bother?
SonnenAnlieger wrote:All quotations should be smaller than the normale text. This is why I put the \small-Command in the new environments.
\small is quite different from the shown \begin{small}...\end{small}. That's just one of the things: you didn't put a \small command into your new environments. You did put a not defined `small' environment into your newenvironments.

You may be better off by providing a Infominimal working example that actually demonstrates the usage of your selfdefined environments.

KR
Rainer
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

csquotes: displayquote with and without quotation marks

Post by Johannes_B »

rais wrote:You may be better off by providing a Infominimal working example that actually demonstrates the usage of your selfdefined environments.
I agree strongly. I have been trying to figure out what you want to do, on and off, for the last three hours.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
SonnenAnlieger
Posts: 4
Joined: Thu Feb 26, 2015 10:58 am

csquotes: displayquote with and without quotation marks

Post by SonnenAnlieger »

The mini example is here:

Code: Select all

\documentclass[a4paper,10pt,fncontinued]{jurabook}

\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage[T1]{fontenc}

\usepackage{graphicx}
\graphicspath{ {pics/} }

\usepackage{color}

\usepackage{makeidx}
\makeindex

\usepackage[draft]{pdfpages}

\usepackage{eurosym}

\usepackage{parskip}

\usepackage[normalem]{ulem}

\usepackage{ifthen}
\emergencystretch20pt
\tolerance2000
\usepackage{listings}

\title{Cloud Computing}
\author{Stefan}
\date{05. Februar 2015}

\usepackage[%
backend=biber,%
uniquename=true,%
singletitle=true%
sorting=nyvt,%
sortcites=true,%
maxnames=3,%
idemtracker=constrict,% 
style=biblatex-juradiss,% 
ibidtracker=false,% 
datezeros=false,% 
date=short,%
]{biblatex} 

\usepackage[babel,german=guillemets]{csquotes}

\bibliography{jura_bib}

\begin{document}

\begin{zitat}
This is a quotation which should have quotation marks I define once in the preamble.
\end{zitat}

\begin{gzitat}
§ 1232 WhatEver

It is prohibited ...
\end{gzitat}

\end{document}
So the zitat-environment should look like this and have quotation marks:
"This is a quotation which should have quotation marks I define once in the preamble."
The gzitat-environment shoud look like this:
§ 1232 WhatEver

It is prohibited ...
I didn't know that I've used mandatory arguments in my environment. How can I use optional arguments?

In my opinion I should use two different environments for quotation of legal texts and literal quotation from other authors.

I hope that gives you an idea what I am looking for. Sorry I left not enough information for you.

Stefan
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

csquotes: displayquote with and without quotation marks

Post by Johannes_B »

csquotes is for some kind of fancy quoting, you can combine it with biblatex to cite.

So, you can do:

Code: Select all

\begin{gesetz}{bgb250}
Text Paragraph 250 BGB
\end{gesetz}
which would lead to:

Code: Select all

Text Paragraph 250 BGB
                         BundesGesetzBuch Paragraph 250
Along with an entry in your bibliography. The same goes for normal quotes.

Above {bgb250} is the mandatory argument, you could use optional arguments as well. I could just code something up that you can use, but if you don't want all this fancy stuff, the usual quote environment from the LaTeX Kernel is more than enough.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

csquotes: displayquote with and without quotation marks

Post by Johannes_B »

Please look at the following example and play around a bit.

Code: Select all

\documentclass[a4paper,10pt,fncontinued]{jurabook}

\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage[T1]{fontenc}

\usepackage{blindtext}
\usepackage{url}
\usepackage{parskip}
\usepackage{xcolor}
\usepackage{xparse}

\usepackage[babel,german=guillemets]{csquotes}
\usepackage[style=authoryear]{biblatex}
\addbibresource{biblatex-examples.bib}

\newenvironment{zitat}[2][]{%
	\begin{displaycquote}[#1]{#2}%
		\color{blue}\small
	}{\end{displaycquote}}

\NewDocumentEnvironment{gesetz}{ O{} }{
	\begin{quote}\small\color{red}
\textquotedblleft}{%
		\IfValueT{#1}{\setlength{\parskip}{0pt}\par\hbox{}\hfill\cite{#1}}\textquotedblright\end{quote}\bigbreak
}

\begin{document}
\begin{zitat}{aristotle:physics}\blindtext
\end{zitat}
\begin{zitat}[12]{companion}\blindtext
\end{zitat}
\blindtext
\begin{gesetz}[westfahl:space]\blindtext
\end{gesetz}
\begin{displayquote}\color{green}\blindtext
\end{displayquote}
\end{document}
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
SonnenAnlieger
Posts: 4
Joined: Thu Feb 26, 2015 10:58 am

csquotes: displayquote with and without quotation marks

Post by SonnenAnlieger »

I found a solution that fit my needs:

Code: Select all

\newenvironmentx{zitat}[1][1]{%
		\small%       
        \begin{displayquote}[{\textit{#1}}]\frqq}%
		{\flqq\end{displayquote}}

\newenvironmentx{zitatc}[3][1, 2]{%
		\small%
		\begin{displaycquote}[{#1}][{#2}]{#3}\frqq}%
		{\flqq\end{displaycquote}}

\newenvironmentx{gzitat}[1][1]{%
		\small%
        \begin{displayquote}[{\textit{#1}}]}%
        {\end{displayquote}}
Thanks a lot for your help!!
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Re: csquotes: displayquote with and without quotation marks

Post by Stefan Kottwitz »

Welcome to the forum,

and thanks for posting the solution which you are now using! That's good practice, so further reader coming in via google would found a good solution.

Good luck with your PhD! If you would encounter any LaTeX challenge, let us know. Either here, or in our German partner forum.

Stefan
LaTeX.org admin
Post Reply