TeX - LaTeX Asked on July 17, 2021
Quotation requirements can be very variable and I’ve not found a way to adapt the csquotes
standard for my puropse. For a thesis/paper it is required to fulfill following blockquotation standards:
onehalfspacing
with the setspace
package) csquotes
)Since specific language settings are also required, it would be very facile if the proposed solution would use the same ´csquotes´ package.
I’ve found
While the first is setting the fontsize only relative to the nomrla font size, the second is almost not commented and so practically impossible to adapt for a novice like me.
Here you find a minimal example:
documentclass{article}
usepackage[ngerman]{babel}
usepackage[utf8]{inputenc}
usepackage{parskip}
usepackage{setspace}
onehalfspacing
usepackage[autostyle,german=guillemets]{csquotes}
begin{document}
Here comes a blockquotation:
begin{displayquote}
Dies ist ein Zitat das nichts sagt. Und wenn sie noch nicht gestorben sind dann denken sie daran für immer zu sein.
end{displayquote}
end{document}
I believe this covers your requirements. I commented it so that hopefully it's easy to follow.
makeatletter
%Take the original environment definition and change the leftmargin to 1cm
renewenvironment*{displayquote}
{begingroupsetlength{leftmargini}{1cm}csq@getcargs{csq@bdquote{}{}}}
{csq@edquoteendgroup}
makeatother
%Hooks
%Use single spacing, set 10pt font, and begin beginning quotes
%%%Curly quotes version
%renewcommand{mkbegdispquote}
%{singlespacingfontsize{10pt}{10pt}selectfontsetquotestyle{quote}textooquote}%
%%%German guillemets version
renewcommand{mkbegdispquote}
{singlespacingfontsize{10pt}{10pt}selectfonttextooquote}%
%%%German guillemets version plus italics
%renewcommand{mkbegdispquote}
%{singlespacingfontsize{10pt}{10pt}selectfontitshapetextooquote}%
renewcommand{mkenddispquote}{textcoquote}
I could not find any way to change the indent size... so I searched csquotes
for the displayquote
definition. I copied that and threw it between makeatletter...makeatother
(because it contains the @
character. Then, I put begingroup
and endgroup
, so that the leftmargini
dimension change would only apply within displayquote
environments.
Next, I renewed the two hook commands that are applicable to displayquote
: mkbegdispquote
and mkenddispquote
. Basically, you just put whatever changes you need here. In this case, you wanted single space, font size of 10pt, quote style (if needed, see version 2), and quotes. Then, you put the beginning quotes and the ending quotes.
Here is a complete version from your example:
documentclass{article}
usepackage[ngerman]{babel}
usepackage[utf8]{inputenc}
usepackage{parskip}
usepackage{setspace}
onehalfspacing
usepackage[autostyle,german=guillemets]{csquotes}
makeatletter
%Take the original environment definition and change the leftmargin to 1cm
renewenvironment*{displayquote}
{begingroupsetlength{leftmargini}{1cm}csq@getcargs{csq@bdquote{}{}}}
{csq@edquoteendgroup}
makeatother
%Hooks
%Use single spacing, set 10pt font, and beginning quotes
renewcommand{mkbegdispquote}
{singlespacingfontsize{10pt}{10pt}selectfonttextooquote}
%End displayquote environment with ending quotes
renewcommand{mkenddispquote}{textcoquote}
usepackage{geometry}
geometry{lmargin=25mm,rmargin=25mm,}
begin{document}
Here comes a blockquotation Here comes a blockquotation Here comes a blockquotation Here comes a blockquotation Here comes a blockquotation Here comes a blockquotation Here comes a blockquotation:
begin{displayquote}
Dies ist ein Zitat das nichts sagt. Und wenn sie noch nicht gestorben sind dann denken sie daran für immer zu sein. Dies ist ein Zitat das nichts sagt. Und wenn sie noch nicht gestorben sind dann denken sie daran für immer zu sein. Dies ist ein Zitat das nichts sagt. Und wenn sie noch nicht gestorben sind dann denken sie daran für immer zu sein.
end{displayquote}
Here comes a blockquotation Here comes a blockquotation Here comes a blockquotation Here comes a blockquotation Here comes a blockquotation Here comes a blockquotation Here comes a blockquotation:
end{document}
And, if you want to change the quotes to be “
and ”
, you can change the quote style:
documentclass{article}
usepackage[ngerman]{babel}
usepackage[utf8]{inputenc}
usepackage{parskip}
usepackage{setspace}
onehalfspacing
usepackage[autostyle,german=guillemets]{csquotes}
makeatletter
%Take the original environment definition and change the leftmargin to 1cm
renewenvironment*{displayquote}
{begingroupsetlength{leftmargini}{1cm}csq@getcargs{csq@bdquote{}{}}}
{csq@edquoteendgroup}
makeatother
%Hooks
%Use single spacing, set 10pt font, set quote style curly quotes, and beginning quotes
renewcommand{mkbegdispquote}
{singlespacingfontsize{10pt}{10pt}selectfontsetquotestyle{quote}textooquote}
%End displayquote environment with ending quotes
renewcommand{mkenddispquote}{textcoquote}
usepackage{geometry}
geometry{lmargin=25mm,rmargin=25mm,}
begin{document}
Here comes a blockquotation Here comes a blockquotation Here comes a blockquotation Here comes a blockquotation Here comes a blockquotation Here comes a blockquotation Here comes a blockquotation:
begin{displayquote}
Dies ist ein Zitat das nichts sagt. Und wenn sie noch nicht gestorben sind dann denken sie daran für immer zu sein. Dies ist ein Zitat das nichts sagt. Und wenn sie noch nicht gestorben sind dann denken sie daran für immer zu sein. Dies ist ein Zitat das nichts sagt. Und wenn sie noch nicht gestorben sind dann denken sie daran für immer zu sein.
end{displayquote}
Here comes a blockquotation Here comes a blockquotation Here comes a blockquotation Here comes a blockquotation Here comes a blockquotation Here comes a blockquotation Here comes a blockquotation:
end{document}
And version with italics (and German-style quotes):
documentclass{article}
usepackage[ngerman]{babel}
usepackage[utf8]{inputenc}
usepackage{parskip}
usepackage{setspace}
onehalfspacing
usepackage[autostyle,german=guillemets]{csquotes}
makeatletter
%Take the original environment definition and change the leftmargin to 1cm
renewenvironment*{displayquote}
{begingroupsetlength{leftmargini}{1cm}csq@getcargs{csq@bdquote{}{}}}
{csq@edquoteendgroup}
makeatother
%Hooks
%Use single spacing, set 10pt font, set italics, and beginning quotes
renewcommand{mkbegdispquote}
{singlespacingfontsize{10pt}{10pt}selectfontitshapetextooquote}%setquotestyle{quote}
%End displayquote environment with ending quotes
renewcommand{mkenddispquote}{textcoquote}
usepackage{geometry}
geometry{lmargin=25mm,rmargin=25mm,}
begin{document}
Here comes a blockquotation Here comes a blockquotation Here comes a blockquotation Here comes a blockquotation Here comes a blockquotation Here comes a blockquotation Here comes a blockquotation:
begin{displayquote}
Dies ist ein Zitat das nichts sagt. Und wenn sie noch nicht gestorben sind dann denken sie daran für immer zu sein. Dies ist ein Zitat das nichts sagt. Und wenn sie noch nicht gestorben sind dann denken sie daran für immer zu sein. Dies ist ein Zitat das nichts sagt. Und wenn sie noch nicht gestorben sind dann denken sie daran für immer zu sein.
end{displayquote}
Here comes a blockquotation Here comes a blockquotation Here comes a blockquotation Here comes a blockquotation Here comes a blockquotation Here comes a blockquotation Here comes a blockquotation:
end{document}
Correct answer by whatisit on July 17, 2021
We can avoid some patching if we use the method to customise displayquote
shown in csquotes.cfg
.
The idea is to first define a new environment based on quote
that does most of what we want. Then we use our new environment instead of the standard quote
with SetBlockEnvironment
.
documentclass{article}
usepackage[ngerman]{babel}
usepackage[T1]{fontenc}
usepackage[utf8]{inputenc}
usepackage{parskip}
usepackage{setspace}
onehalfspacing
usepackage[autostyle,german=guillemets]{csquotes}
newenvironment*{innerquote}
{setlength{leftmargini}{1cm}%
quote
singlespacingfontsize{10pt}{10pt}selectfontitshape}
{endquote}
SetBlockEnvironment{innerquote}
renewcommand{mkbegdispquote}[2]{textooquote}
renewcommand{mkenddispquote}[2]{textcoquote#1#2}
usepackage{lipsum}
begin{document}
lipsum[1]
begin{displayquote}
lipsum[2]
end{displayquote}
lipsum[3]
end{document}
Note that technically mkbegdispquote
and mkenddispquote
are defined as taking two arguments.
Answered by moewe on July 17, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP