7

Excuse me for my english, is not my language. I have a document in LaTeX, the relevant code is

\documentclass[a4 paper, 12pt]{article}
\usepackage{tikz-qtree}
\usepackage{tikz}
\usepackage{pgf}
\begin{document}
\begin{tikzpicture}
\tikzset{grow'=right,level distance=60pt}
\tikzset{execute at begin node=\strut}
\tikzset{every tree node/.style={anchor=base west}}
\Tree [.¿$\leqslant 32$? [.¿$\leqslant 16$? [.¿$\leqslant 8$?  [.¿$\leqslant 4$? [.¿$\leqslant 2$?  [.¿$\leqslant 1$? ] [.¿$\leqslant 3$? ] ] [.¿$\leqslant 6$? [.¿$\leqslant 5$? ] [.¿$\leqslant 7$? ]   ] ]
[. ¿$\leqslant 12$? [.¿$\leqslant 10$? [.¿$\leqslant 9$? ] [.¿$\leqslant 11$? ]   ] [.¿$\leqslant 14$?  [.¿$\leqslant 13$? ] [.¿$\leqslant 15$? ]  ] ]   ] [.¿$\leqslant 24$? [.¿$\leqslant 20$? [.¿$\leqslant 18$?  [.¿$\leqslant 17$? ] [.¿$\leqslant 19$? ] ] [.¿$\leqslant 22$? [.¿$\leqslant 21$? ] [.¿$\leqslant 23$? ]  ]    ] [.¿$\leqslant 28$?  [.¿$\leqslant 26$?   [.¿$\leqslant 25$? ] [.¿$\leqslant 27$? ] ] [.¿$\leqslant 30$? [.¿$\leqslant 29$? ] [.¿$\leqslant 31$? ]]  ] ] ]
%
%
%
[.¿$\leqslant 48$? [.¿$\leqslant 40$?  [.¿$\leqslant 36$? [.¿$\leqslant 34$?  [.¿$\leqslant 33$? ] [.¿$\leqslant 35$? ] ] [.¿$\leqslant 38$? [.¿$\leqslant 37$? ] [.¿$\leqslant 39$? ]   ] ]
[. ¿$\leqslant 44$? [.¿$\leqslant 42$? [.¿$\leqslant 41$? ] [.¿$\leqslant 43$? ]   ] [.¿$\leqslant 46$?  [.¿$\leqslant 45$? ] [.¿$\leqslant 47$? ]  ] ]   ] [.¿$\leqslant 56$? [.¿$\leqslant 52$? [.¿$\leqslant 50$?  [.¿$\leqslant 49$? ] [.¿$\leqslant 51$? ] ] [.¿$\leqslant 54$? [.¿$\leqslant 53$? ] [.¿$\leqslant 55$? ]  ]    ] [.¿$\leqslant 60$?  [.¿$\leqslant 58$?   [.¿$\leqslant 57$? ] [.¿$\leqslant 59$? ] ] [.¿$\leqslant 62$? [.¿$\leqslant 61$? ] [.¿$\leqslant 63$? ]]  ] ] ]]
\end{tikzpicture}
\end{document}

I'm trying to translate it to ConTeXt, so I've put \usemodule[tikz] before \starttext, and I could obtain several TikZ pictures in my new ConTexT document. But I could not obtain this tree, cause I have not idea about how make work the analog of \usepackage{tikz-qtree} in ConTeXt. I'd appreciate all help, either about put tikz-qtree at work or about how to obtain the same tree without a sintactical nightmare.

9
  • Welcome! Have you tried loading tikz-qtree as a module or inputting tikz-qtree.tex etc.?
    – cfr
    Jul 26 '16 at 21:40
  • Please provide the code you have so far for the ConTeXt translation.
    – cfr
    Jul 26 '16 at 21:47
  • You can edit your question using the grey link at the bottom left of it edit.
    – cfr
    Jul 26 '16 at 21:50
  • It looks as if you could probably input the .tex files for tikz-qtree rather than using the LaTeX packages. Worth a try, anyway.
    – cfr
    Jul 26 '16 at 21:52
  • Thank you. The ConTeX code is \usemodule[tikz] \usemodule[tikz-qtree] \starttext \placefigure[left][arbol]{}{\hbox{\starttikzpicture[scale=0.8] (the same code as above, too long to put it here, beginning with "\tikzset{grow'=right,level distance=60pt}" and ending with "[.¿$\leqslant 63$? ]] ] ] ]]"). \stoptikzpicture}} \stoptext
    – Miguel
    Jul 26 '16 at 21:56
8

Most of the code in qtree-tikz is TeX code, which one exception: pgfsubpic.sty uses \begin{...} .. \end{...}, which is easy to circumvent. Here is an example from the qtree-tikz manual:

\usemodule[tikz]
\unprotect
\input pgfsubpic
\input pgftree
\input tikz-qtree
\protect

% Poor man's \begin{...} ... \end{...}
\define[1]\begin{\bgroup\csname#1\endcsname \let\end\latexend}
\define[1]\latexend{\csname end#1\endcsname\egroup}

\starttext
\starttikzpicture
\Tree [.S [.NP [.Det the ] [.N cat ] ]
      [.VP [.V sat ]
           [.PP [.P on ]
                [.NP [.Det the ] [.N mat ] ] ] ] ]
\stoptikzpicture
\stoptext

which gives:

enter image description here

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.