# Big quotes drawn with TiKz does not compile

## My problem

Sorry to give such a long code but my problem appears in it.

I don't see why the first long code given below does not work : more precisely, the problem comes from the big quotes drawn using TiKz. I've just adapted the secund code by changing some names. Any clue to fix my long code ?

## The bugging code

\documentclass[10pt,a4paper,french]{article}
\usepackage[utf8]{inputenc}
\usepackage{fancyvrb}

\setlength{\parindent}{0cm}

\newcommand\bracket[1]{(#1)}

\newcommand\latex{\verb}
\DefineVerbatimEnvironment{Latex}{Verbatim}{numbers=left,numbersep=2mm}

% == PACKAGES USED == %

\usepackage{pgfkeys}

\usepackage[x11names,svgnames]{xcolor}
\usepackage{mdframed}
\usepackage{tikz}

\usepackage{babel}
\usepackage{csquotes}

% == DEF : quote == %

\makeatletter
% Inline mode
\renewcommand\quote{%
\@ifstar{\@quoteStar}{\@quoteNoStar}%
}
\newcommand\@quoteStar[2][]{%
\textquote*[#1]{\textit{#2}}
}
\newcommand\@quoteNoStar[2][]{%
\textquote[#1]{\textit{#2}}
}

% Default settings for quoting blocks
\definecolor{bigQuoteColorNormal}{named}{black}
\definecolor{bigQuoteColorBack}{named}{LightBlue1}

\newlength{\bigQuoteBorderWidth}
\setlength{\bigQuoteBorderWidth}{0pt}
\newlength{\bigQuoteInnerMargin}
\setlength{\bigQuoteInnerMargin}{2pt}
\newlength{\bigQuoteOuterMarginHorizontal}
\setlength{\bigQuoteOuterMarginHorizontal}{15pt}

% Frame for quoting blocks
\mdfdefinestyle{quoteFrameStyle}{
fontcolor         = bigQuoteColorNormal,%
backgroundcolor   = bigQuoteColorBack,%
linewidth         = \bigQuoteBorderWidth,%
leftmargin        = \bigQuoteOuterMarginHorizontal,%
rightmargin       = \bigQuoteOuterMarginHorizontal,%
innerleftmargin   = \bigQuoteInnerMargin,%
innerrightmargin  = \bigQuoteInnerMargin,%
innertopmargin    = \bigQuoteInnerMargin,%
innerbottommargin = \bigQuoteInnerMargin,%
}

% The big quotes
\newcommand*\bigQuotefont{\fontfamily{fxl}} % selects Libertine for quote font

\newcommand*{\bigQuoteOpening}{%
\tikz[%
remember picture,%
overlay,%
xshift=-15pt,%
yshift=-10pt%
]
\node (OQ) {\bigQuotefont\fontsize{60}{60}\selectfont};
\kern0pt
}
\newcommand*{\bigQuoteClosing}{%
\tikz[
remember picture,
overlay,
xshift=15pt,
yshift=-10pt
]
\node (CQ) {\bigQuotefont\fontsize{60}{60}\selectfont''};
}

% Block mode
\pgfkeys{
/quote/.is family,
/quote,
author/.initial = {},
title/.initial  = {},
editor/.initial = {}
}
\newenvironment{Quote}[1][]{%
% Management of the keys.
\pgfkeys{/quote, #1}
\pgfkeysgetvalue{/quote/author}{\@author}
\pgfkeysgetvalue{/quote/title}{\@title}
\pgfkeysgetvalue{/quote/editor}{\@editor}
% Let's go !
\medskip
\begin{mdframed}[style=quoteFrameStyle]
\quoteRefFormatBefore{\@author}%
{\@title}%
{\@editor}%
}{%
\quoteRefFormatAfter{\@author}%
{\@title}%
{\@editor}%
\end{mdframed}
\medskip
}
% 1  -->  Author
% 2  -->  Title
% 3  -->  Editor
\newcommand\quoteRefFormatBefore[3]{%
\bigQuoteOpening % Problem !!!
}
% 1  -->  Author
% 2  -->  Title
% 3  -->  Editor
\newcommand\quoteRefFormatAfter[3]{{
\footnotesize
\par\smallskip
\hfill #1
\par
\hfill \quote*{#2}
\par
\hfill {\scriptsize#3} \bigQuoteClosing % Problem !!!
}}
\makeatother

\begin{document}

\bigQuoteOpening

\end{document}


## Working code for big quotes

\documentclass[12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
%   \usepackage{libertine} % or any other font package (or none)
\usepackage[svgnames]{xcolor}
\usepackage{tikz}

% Make commands for the quotes
\newcommand*\quotefont{\fontfamily{fxl}} % selects Libertine for quote font

\newcommand*{\openquote}{%
\tikz[
remember picture,
overlay,
xshift=-15pt,
yshift=-10pt
]
\node (OQ) {\quotefont\fontsize{60}{60}\selectfont};
\kern0pt
}
\newcommand*{\closequote}{%
\tikz[
remember picture,
overlay,
xshift=15pt,
yshift=-10pt
]
\node (CQ) {\quotefont\fontsize{60}{60}\selectfont''};
}

% wrap everything in its own environment
\begin{quote}\openquote %
}{%
\hfill\closequote\end{quote} %
}

\usepackage{lipsum}
\newcommand*\bigQuotefont{\fontfamily{fxl}} % selects Libertine for quote font

\newcommand*{\bigQuoteClosing}{%
\tikz[
remember picture,
overlay,
xshift=15pt,
yshift=-10pt
]
\node (CQ) {\bigQuotefont\fontsize{60}{60}\selectfont''};
}
\begin{document}

\lipsum[1]

A common mistake that people make when trying to design something completely
foolproof is to underestimate the ingenuity of complete fools.\par\emph{Douglas Adams}

\lipsum[1]

\end{document}

-
I know it is same work, but you could have really tried to generate a minimal working example (MWE), i.e. removed all extra things. Actually in a good amount of cases people find the cause of the trouble while doing that. – Martin Scharrer Apr 17 '12 at 17:33
pgfkeys is loaded by TikZ – Alain Matthes Apr 17 '12 at 19:54

This seem to be [french]{babel} related. After I remove the package it starts working. However it isn't a issue with the quotes (which babel makes active for some languages) because the issue stays when I remove them.

Instead if you write \tikz[<options>]{\node (<name>) { .. };} instead of
\tikz[<options>] \node (<name>) { .. }; then it works as well with babel.

The reason why this is happening it that babel makes the ; an active character (like e.g. ~) and the \tikz macro looks for it as an end-marker. TikZ is smart enough programmed to recognize the situation when ; is active and adapts. The issue here is that the ; is changed by babel at the begin of the document (\begin{document}). In the preamble it is still normal! Because you store it there in an environment these ;s are not active (catcodes are fixes as soon the character are read the first time), and \tikz fails to find them. If you use \tikz { \node {..}; } it works because \tikz doesn't need to look for a ;. The inner rules to handle ; are different (I think TikZ checks always for an normal or active ;), so the inner \node {..}; works fine.

-
Thanks. I'll take care of this in the future. – projetmbc Apr 17 '12 at 17:42
@projetmbc: I tracked the issue further down and updated my answer. – Martin Scharrer Apr 17 '12 at 18:04
No problem with pgf 2.1 CVS but you need to add \usepackage[T1]{fontenc}in the two cases ! – Alain Matthes Apr 17 '12 at 20:15
Everything is clearier now. – projetmbc Apr 17 '12 at 22:05

With pgf 2.1 CVS, the first code works fine for me with

 \usepackage[frenchb]{babel}


but with

 \usepackage[T1]{fontenc}


And the second code doesn't work if you remove

 \usepackage[T1]{fontenc}


The main code but I removed some parts ...

\documentclass[10pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{libertine}
\usepackage{fancyvrb}
\usepackage[x11names,svgnames]{xcolor}
\usepackage{tikz}
\usepackage{mdframed}
\usepackage[frenchb]{babel}
\usepackage{csquotes}

....

% The big quotes
\newcommand*\bigQuotefont{\fontfamily{fxl}} % selects Libertine for quote font

\newcommand*{\bigQuoteOpening}{%
\tikz[%
remember picture,%
overlay,%
xshift=-15pt,%
yshift=-10pt%
]
\node (OQ) {\bigQuotefont\fontsize{60}{60}\selectfont};
\kern0pt
}
\newcommand*{\bigQuoteClosing}{%
\tikz[
remember picture,
overlay,
xshift=15pt,
yshift=-10pt
]
\node (CQ) {\bigQuotefont\fontsize{60}{60}\selectfont''};
}

...

\begin{document}

\bigQuoteOpening
A common mistake that people make when trying to design something completely
foolproof is to underestimate the ingenuity of complete fools.\par\emph{Douglas Adams}
\bigQuoteClosing

\end{document}


-