I did not know that latex had different symbol for opening and closing quotation marks. I've used it like "abc" every where and just realised that I really should have used ``abc"
. Is there anyway I can convert all the quotations to become like “abc"? Doing it manually will take forever as I have a lot of quotations.
[Tex/LaTex] Automatically convert quotations in the form of “abc” to become “abc”
punctuation
Related Solutions
Here is a proposal, using some low level commands. The text is typeset in a \vtop
and its depth is used to place the opening quotes, while the closing quotes will be level with the top line (with some lowering due to size).
Thanks to Jake, I've been able to solve a mystery that bugged me, about a spacing that seems necessary and is due to the inner sep
of TikZ nodes.
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{kpfonts}
\usepackage[svgnames]{xcolor}
\definecolor{framecolor}{named}{SteelBlue}
\colorlet{framebgcolor}{PowderBlue!50!White}
\definecolor{quotesignclr}{named}{LightSlateGrey}
\usepackage{changepage}
\usepackage{environ,graphicx}
\usepackage{tikz}
\usetikzlibrary{backgrounds}
\newcommand\sopeningquote{\scalebox{2}{\color{quotesignclr}\smash\quotedblbase}}
\newcommand\sclosingquote{\scalebox{2}{\color{quotesignclr}\smash\textquotedblleft}}
\makeatletter
\newsavebox\simplequestbox
\NewEnviron{simplequest}{%
\normalfont
\begin{adjustwidth}{3em}{3em}
\settowidth{\dimen@}{\sopeningquote\kern.4em\sclosingquote}%
\dimen@=\dimexpr\linewidth-\dimen@\relax
\setbox\simplequestbox=\vtop{
\@parboxrestore\itshape
\hsize=\dimexpr\dimen@-\pgfkeysvalueof{/pgf/inner xsep}*2\relax % thanks, Jake
\sbox\z@{\BODY}
\ifdim\wd\z@>\hsize
\noindent\BODY\par
\else
\box\z@
\fi
\xdef\simplequestpd{\the\prevdepth}
}
\begin{tikzpicture}
[background rectangle/.style={draw=framecolor,line width=0.2pt,
fill=framebgcolor,rounded corners}, show background rectangle,
inner frame xsep=-2pt,inner frame ysep=2pt]
\node {\mbox{%
\raisebox{\dimexpr-\dp\simplequestbox+\simplequestpd+.05ex}
[0pt][0pt]{\sopeningquote}%
\kern.2em
\box\simplequestbox
\kern.2em
\raisebox{-1.4ex}[0pt][0pt]{\sclosingquote}}};
\end{tikzpicture}
\end{adjustwidth}
}
\makeatother
\begin{document}
\begin{simplequest}
Dies hier ist ein Blindtext zum Testen von Textausgaben.
Wer diesen Text liest, ist selbst schuld.
\end{simplequest}
\begin{simplequest}
Dies hier ist ein Blindtext
\end{simplequest}
\Large
\begin{simplequest}
Dies hier ist ein Blindtext zum Testen von Textausgaben.
Wer diesen Text liest, ist selbst schuld.
\end{simplequest}
\end{document}
In the picture the similar quotes are: top mine, bottom yours.
A problem may arise in case the text consists of more than one paragraph and the first one is not long enough to fill a line. Should this case present itself in the document, the code might be changed like this:
\makeatletter
\newsavebox\simplequestbox
\NewEnviron{simplequest}[1][]{%
\normalfont
\begin{adjustwidth}{3em}{3em}
\settowidth{\dimen@}{\sopeningquote\kern.4em\sclosingquote}%
\dimen@=\dimexpr\linewidth-\dimen@\relax
\setbox\simplequestbox=\vtop{
\@parboxrestore\itshape
\hsize=\dimexpr\dimen@-\pgfkeysvalueof{/pgf/inner xsep}*2\relax % thanks, Jake
\if\relax\detokenize{#1}\relax
\sbox\z@{\BODY}
\ifdim\wd\z@>\hsize
\noindent\BODY\par
\else
\box\z@
\fi
\else
\sbox\z@{#1}
\hsize\wd\z@
\BODY\par
\fi
\xdef\simplequestpd{\the\prevdepth}
}
\begin{tikzpicture}
[background rectangle/.style={draw=framecolor,line width=0.2pt,
fill=framebgcolor,rounded corners}, show background rectangle,
inner frame xsep=-2pt,inner frame ysep=2pt]
\node {\mbox{%
\raisebox{\dimexpr-\dp\simplequestbox+\simplequestpd+.05ex}
[0pt][0pt]{\sopeningquote}%
\kern.2em
\box\simplequestbox
\kern.2em
\raisebox{-1.4ex}[0pt][0pt]{\sclosingquote}}};
\end{tikzpicture}
\end{adjustwidth}
}
\makeatother
The environment now has an optional argument, the first short line; here's an example:
\begin{simplequest}[Dies hier ist ein Blindtext.]
Dies hier ist ein Blindtext.
Wer diesen Text liest, ist selbst schuld.
\end{simplequest}
One could try getting only the first paragraph, but this might be error prone.
Note that the csquotes
package allows to define an optional argument for citations in \blockquote
and this one can be defined to be a footnote.
So, you just have to add
\renewcommand{\mkcitation}[1]{\footnote{#1}}
in the preamble
and use
\blockquote[bla...]{\lipsum*[1]...}
instead of
\blockquote{\lipsum*[1]...}\footnote{bla...}
Complete MWE
\documentclass{scrartcl}
\usepackage[english]{babel}
\usepackage{lmodern,csquotes,lipsum}
\renewcommand{\mkblockquote}[4]{\enquote{#1}#2\ifterm{\relax}{#3}#4}
\renewcommand{\mkcitation}[1]{\footnote{#1}}
\begin{document}
\lipsum*[1]
\blockquote[bla...]{\lipsum*[1]...}
\lipsum*[1]
\end{document}
Output
Update
Your issue in the update can be resolved in this way:
replace
\renewcommand{\mkcitation}[1]{\footnote{#1}}
with simply
\renewcommand{\mkcitation}[1]{#1}
and then use
\blockquote[\footnotemark]{\lipsum*[1]...}
\footnotetext{Says \cite[59]{companion}. See also \cite[59]{companion}.}
instead of
\blockquote[Says \cite[123]{xyz}. See also \cite[123]{xyz}.]{\lipsum*[1]...}
In this way, we've separated the \footnotemark
from the \footnotetext
and the problem doesn't arise.
Complete working MWE
\documentclass{scrartcl}
\usepackage[english]{babel}
\usepackage[style=authoryear]{biblatex}
\usepackage{lmodern,csquotes,lipsum}
\renewcommand{\mkblockquote}[4]{\enquote{#1}#2\ifterm{\relax}{#3}#4}
\renewcommand{\mkcitation}[1]{#1}
\addbibresource{biblatex-examples.bib}
\begin{document}
\lipsum*[1]
\blockquote[\footnotemark]{\lipsum*[1]...}
\footnotetext{Says \cite[59]{companion}. See also \cite[59]{companion}.}
\lipsum*[1]
\end{document}
Output
Best Answer
An alternative to
quotes
iscsquotes
from 2011, whilequotes
is from 1997 …