I have a problem regarding the package qtree in combination with the Springer Nature Template. Once I put my paper in this template, the trees appear in a weird shape: the nodes appear separated, the tree image overlaps with the text. Does anyone know the solution to this issue?
\documentclass[referee,sn-basic]{sn-jnl}
\usepackage{graphicx}
\usepackage{stmaryrd}
\usepackage{graphicx}
\usepackage{qtree,tree-dvips}
\usepackage{linguex}
\begin{document}
\ex. \Tree [.A \qroof{something here}.DP [.B C ]]
\end{document}
In the documentation of qtree, it says:
Qtree will not work with journal style X Any number of things could be going wrong, of course, but start by checking if the journal’s style redefines the tabular environment. Qtree makes internal calls to tabular, so this is a frequent source of problems. Usually the style’s writer has saved the original definition of \tabular under a different name, so all you need to do is arrange for the original definition to be restored during the calls to \Tree. You can define \qtreeinithook to carry out the necessary redefinitions. It is called at the beginning of each call to \Tree, with local scope (so that any redefinitions it makes are automatically canceled at the end of the call to \Tree). For example, the JNLE style (nle.sty) saves the standard commands to begin and end a table as \oldtabular and \endoldtabular, respectively, and the replacement macros result in r e a l l y w i d e trees.
The following will restore the original definitions for calls to \Tree only. \def\qtreeinithook{\let\tabular=\oldtabular \let\endtabular=\endoldtabular}
However, I don't know how to find the commands in the style file of the journal to define the qtreeinithook.
\documentclass{standalone}\usepackage{qtree}\begin{document}\Tree [your tree here]\end{document}
, compile that into a pdf, and then use that pdf in your main document using\documentclass{sn-jnl}\usepackage{graphicx}\usepackage{linguex}\begin{document}\ex. \includegraphics{mytree.pdf}\end{document}
.\qtreeinithook
: a partial solution is to set\def\qtreeinithook{\singlespacing}
, this already reduces the separation between the nodes. However, the spacing is still too big, I have been trying to find which part ofsn-jnl.cls
Is responsible for this but so far no luck (it doesn't help that the class is 1700+ lines of code...)