LaTeX forum ⇒ Text Formattingcsquotes: displayquote with and without quotation marks Topic is solved

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

csquotes: displayquote with and without quotation marks

Postby SonnenAnlieger » Thu Feb 26, 2015 11:08 am

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:

  1. \documentclass[a4paper,10pt,fncontinued]{jurabook}
  2.  
  3. \usepackage[utf8]{inputenc}
  4. \usepackage[ngerman]{babel}
  5. \usepackage[T1]{fontenc}
  6.  
  7. \usepackage{parskip}
  8. \usepackage[normalem]{ulem}
  9.  
  10. \usepackage[babel,german=guillemets]{csquotes}
  11.  
  12. \newenvironment{zitat}[2]{\begin{small}\begin{displayquote}#1#2 }{\end{displayquote} \end{small}}
  13. \newenvironment*{zitatc}{\displaycquote}{\enddisplaycquote}
  14. \newenvironment{gzitat}[2]{\begin{small}\begin{displayquote}#1#2}{\end{displayquote}\end{small}}
  15.  
  16. \renewcommand{\mkbegdispquote}[2]{\openautoquote}
  17. \renewcommand{\mkenddispquote}[2]{\closeautoquote#1#2}
  18.  
  19. \begin{document}
  20. test
  21. \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!!

Tags:

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

Postby Johannes_B » Thu Feb 26, 2015 5:57 pm

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

Postby SonnenAnlieger » Fri Feb 27, 2015 11:37 am

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
  1. \renewcommand{\mkbegdispquote}[2]{\openautoquote}
  2. \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: 268
Joined: Sun Nov 16, 2014 8:51 pm

Postby rais » Fri Feb 27, 2015 10:50 pm

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:
  1. \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: 4163
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Fri Feb 27, 2015 11:34 pm

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

Postby SonnenAnlieger » Mon Mar 02, 2015 11:16 am

The mini example is here:
  1. \documentclass[a4paper,10pt,fncontinued]{jurabook}
  2.  
  3. \usepackage[utf8]{inputenc}
  4. \usepackage[ngerman]{babel}
  5. \usepackage[T1]{fontenc}
  6.  
  7. \usepackage{graphicx}
  8. \graphicspath{ {pics/} }
  9.  
  10. \usepackage{color}
  11.  
  12. \usepackage{makeidx}
  13. \makeindex
  14.  
  15. \usepackage[draft]{pdfpages}
  16.  
  17. \usepackage{eurosym}
  18.  
  19. \usepackage{parskip}
  20.  
  21. \usepackage[normalem]{ulem}
  22.  
  23. \usepackage{ifthen}
  24. \emergencystretch20pt
  25. \tolerance2000
  26. \usepackage{listings}
  27.  
  28. \title{Cloud Computing}
  29. \author{Stefan}
  30. \date{05. Februar 2015}
  31.  
  32. \usepackage[%
  33. backend=biber,%
  34. uniquename=true,%
  35. singletitle=true%
  36. sorting=nyvt,%
  37. sortcites=true,%
  38. maxnames=3,%
  39. idemtracker=constrict,%
  40. style=biblatex-juradiss,%
  41. ibidtracker=false,%
  42. datezeros=false,%
  43. date=short,%
  44. ]{biblatex}
  45.  
  46. \usepackage[babel,german=guillemets]{csquotes}
  47.  
  48. \bibliography{jura_bib}
  49.  
  50. \begin{document}
  51.  
  52. \begin{zitat}
  53. This is a quotation which should have quotation marks I define once in the preamble.
  54. \end{zitat}
  55.  
  56. \begin{gzitat}
  57. § 1232 WhatEver
  58.  
  59. It is prohibited ...
  60. \end{gzitat}
  61.  
  62. \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: 4163
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Mon Mar 02, 2015 6:01 pm

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

So, you can do:
  1. \begin{gesetz}{bgb250}
  2. Text Paragraph 250 BGB
  3. \end{gesetz}


which would lead to:
  1. Text Paragraph 250 BGB
  2. 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: 4163
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Mon Mar 02, 2015 6:52 pm

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


  1. \documentclass[a4paper,10pt,fncontinued]{jurabook}
  2.  
  3. \usepackage[utf8]{inputenc}
  4. \usepackage[ngerman]{babel}
  5. \usepackage[T1]{fontenc}
  6.  
  7. \usepackage{blindtext}
  8. \usepackage{url}
  9. \usepackage{parskip}
  10. \usepackage{xcolor}
  11. \usepackage{xparse}
  12.  
  13. \usepackage[babel,german=guillemets]{csquotes}
  14. \usepackage[style=authoryear]{biblatex}
  15. \addbibresource{biblatex-examples.bib}
  16.  
  17. \newenvironment{zitat}[2][]{%
  18. \begin{displaycquote}[#1]{#2}%
  19. \color{blue}\small
  20. }{\end{displaycquote}}
  21.  
  22. \NewDocumentEnvironment{gesetz}{ O{} }{
  23. \begin{quote}\small\color{red}
  24. \textquotedblleft}{%
  25. \IfValueT{#1}{\setlength{\parskip}{0pt}\par\hbox{}\hfill\cite{#1}}\textquotedblright\end{quote}\bigbreak
  26. }
  27.  
  28. \begin{document}
  29. \begin{zitat}{aristotle:physics}\blindtext
  30. \end{zitat}
  31. \begin{zitat}[12]{companion}\blindtext
  32. \end{zitat}
  33. \blindtext
  34. \begin{gesetz}[westfahl:space]\blindtext
  35. \end{gesetz}
  36. \begin{displayquote}\color{green}\blindtext
  37. \end{displayquote}
  38. \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

Postby SonnenAnlieger » Fri Aug 21, 2015 5:12 pm

I found a solution that fit my needs:

  1. \newenvironmentx{zitat}[1][1]{%
  2. \small%
  3. \begin{displayquote}[{\textit{#1}}]\frqq}%
  4. {\flqq\end{displayquote}}
  5.  
  6. \newenvironmentx{zitatc}[3][1, 2]{%
  7. \small%
  8. \begin{displaycquote}[{#1}][{#2}]{#3}\frqq}%
  9. {\flqq\end{displaycquote}}
  10.  
  11. \newenvironmentx{gzitat}[1][1]{%
  12. \small%
  13. \begin{displayquote}[{\textit{#1}}]}%
  14. {\end{displayquote}}


Thanks a lot for your help!!

User avatar
Stefan Kottwitz
Site Admin
Posts: 9572
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Fri Aug 21, 2015 7:22 pm

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


Return to “Text Formatting”

Who is online

Users browsing this forum: No registered users and 2 guests