EDIT (Now with 3 solutions)
qtree
+ tikzmark
If you just need to draw arrows later, you can use tikzmark
with qtree
. At least, the following seems to work:
\documentclass{article}
\usepackage{qtree,tikz}
\usetikzlibrary{tikzmark,calc}
\begin{document}
\Tree [ [ [ {\tikzmark{a}$\sqrt{\textsc{Root}}$\tikzmark{b}} {\scshape Voice} ] [.{\scshape Asp} ] ] [.{\scshape {\tikzmark{c}Tns\tikzmark{d}}} ] ]
\begin{tikzpicture}[overlay, remember picture]
\draw [->, shorten >=5pt, shorten <=5pt] ($(pic cs:a)!1/2!(pic cs:b)$) .. controls +(1,-2) and +(-1,-2) .. ($(pic cs:c)!1/2!(pic cs:d)$);
\end{tikzpicture}
\end{document}
forest
I would also use Forest, but would definitely recommend the linguistics
library which provides nice empty nodes
and suitable edges out-of-the-box. To align the terminal nodes, you can add a phantom with zero width but appropriate height.
For example,
\documentclass{standalone}
\usepackage[linguistics]{forest}
\begin{document}
\begin{forest}
nice empty nodes,
for tree={
font=\scshape,
},
before typesetting nodes={
where n children=0{
+content=\makebox[0pt]{\phantom{$\sqrt{X}$}},
}{}
}
[
[
[
[$\sqrt{\textsc{Root}}$]
[Voice]
]
[Asp]
]
[Tns]
]
\end{forest}
\end{document}
tikz-qtree
If you prefer to stick with tikz-qtree
, you should wait to see what Alan Munn can come up with. I've only ever used qtree
and forest
, so the best I can do with tikz-qtree
is
\documentclass[border=10pt]{standalone}
\usepackage{tikz-qtree}
\begin{document}
\newlength\widesttreenodewidth
\settowidth{\widesttreenodewidth}{$\sqrt{\textsc{Root}}$}
\newlength\highesttreenodeht
\settoheight{\highesttreenodeht}{$\sqrt{\textsc{Root}}$}
\newlength\deepesttreenodedpth
\settodepth{\deepesttreenodedpth}{$\sqrt{\textsc{Root}}$}
\tikzset{
every tree node/.append style={text width=\widesttreenodewidth, text depth=\deepesttreenodedpth, text height=\highesttreenodeht, text centered},
execute at begin node=\makebox[0pt]{\phantom{$\sqrt{X}$}},
}
\Tree [ [ [ $\sqrt{\textsc{Root}}$ {\scshape Voice} ] [.{\scshape Asp} ] ] [.{\scshape Tns} ] ]
\end{document}
Note
Forest does take some time to learn and the syntax is a bit different, so it is not something to attempt at the end of a large project, deadline looming, for sure.
In the file sn-jnl.cls
(An authoring template for Springer Journal articles) it is established
It may be distributed and/or modified under the conditions of the
LaTeX Project Public License, either version 1.3c of this license or
(at your option) any later version.
The LaTeX Project Public License
- If you are not the Current Maintainer of the Work, you may modify your copy of the Work, thus creating a Derived Work based on the Work,
and compile this Derived Work, thus creating a Compiled Work based on
the Derived Work.
As an exercise of patching commands, following the examples in https://tex.stackexchange.com/a/152811/161015
it might be possible to change the heading to something else making a proper reference to the author(s)/owner(s).
Add after the comment in the template sn-article.tex
`
%%<additional latex packages if required can be included here>
\usepackage{etoolbox}
\makeatletter
\patchcmd{\ps@headings}%% Regular Pages Style
{\hbox to \hsize{\hfill Springer Nature 2021 \LaTeX\ template\hfill}}
{\hbox to \hsize{\hfill Based on Springer Nature \LaTeX\ template\hfill}}
{}
{}
\patchcmd{\ps@titlepage}%% Opening Page Style
{\hbox to \hsize{\hfill Springer Nature 2021 \LaTeX\ template\hfill}}
{\hbox to \hsize{\hfill Based on Springer Nature \LaTeX\ template\hfill}}
{}
{}
\makeatother
UPDATED to remove
Springer Nature etc. from every page see
from every page
Best Answer
There are two things going on here. As noted in the comments, the
[referee]
option of the class loadssetspace
and sets the spacing to\doublespacing
. But the class also redefines\raggedright
which results in extra space being inserted above node labels, because theqtree
labels are created using the{flushleft}
environment (which is defined as a list using\raggedright
).The class should absolutely not have clobbered the kernel definition of
\raggedright
but since it's almost impossible to get publishers to change their class files, here's a general solution which solves at least part of the underlying problem by fixing the{flushleft}
environment itself. This will solve your glossing problem too, since theclgoss4e
glossing macros thatlinguex
uses also uses the{flushleft}
environment. It will also solve any similar problems with any package that uses the{flushleft}
environment.With the restored definition of
{flushleft}
we only need to add\singlespacing
to the\qtreeinithook
macro to make sure that the rest of the tree is single spaced. I've also added some extra space after trees; you can remove this if you don't need it.