# qtree and babel - escaping character no caught

I started using the package qtree to draw (simple) trees with LaTeX This package uses the ! to escape some commands/macros.

I tried framing part of the tree, copy/pasting the example in the documentation, but because of babel, loaded with french option, the ! is not caught and interpreted as a new leaf.

M(not)WE:

\documentclass[a4paper, 12pt, twoside]{report}
\usepackage[french]{babel}    % no problems with [english], [greek, english], [german]
\usepackage{qtree}
\begin{document}
\Tree [.IP [.NP Roses ] [ [.I^0 are ]
[.VP t [ [.V^0 turning ] [.NP pink ] ] ].VP !{\qframesubtree} ]]
\end{document}

• \shorthandoff{!} before the \Tree and \shorthandon{!} after it. – egreg Jan 20 '15 at 18:23
• Exactly right as usual, thanks a lot! Is it because in french a spacing is needed before the exclamation mark, hence it must be redefined in babel? (I thought about that but didn't know the shorthandoff/on commands, now I do :) ) Could you make it an answer so I can accept it? – luneart Jan 20 '15 at 18:56

You have to disable ! as a shorthand:
\documentclass[a4paper, 12pt, twoside]{report}