Eu tenho este seguinte documento tex:
\documentclass[10pt]{article}
\ExpandArgs{c}\newcommand{new@fontshape}{anything}
\usepackage{linguex}
\usepackage[russian,indonesian]{babel}
\usepackage[none]{hyphenat}
\usepackage{geometry}
\usepackage{setspace}
\usepackage{amssymb}
\usepackage{booktabs}
\usepackage{tikz}
\usepackage{tikz-qtree}
\usepackage{gb4e}
\primebars
\let\emptyset\varnothing
\geometry{
a4paper,
total={170mm,257mm},
left=20mm,
top=20mm,
}
\newcommand{\?}[1]{\foreignlanguage{russian}{#1}}
\begin{document}
\noindent {\LARGE \bf Uraian pohon sintaksis}\\
\begin{exe}
\ex{{\bf (RU)}
\tikzset{grow'=right}
\tikzset{every tree node/.style={align = left, anchor=base west}}
\tikzset{frontier/.style={distance from root=170pt}}
\tikzset{execute at begin node=\strut}
\Tree [.K [.FN {\?{\it Путин}\\ Putin} ] [.FV [.V {\?{\it опроверг}\\ membantah} ] [.FN [.FN [. N {\?{\it дискриминацию}\\ diskriminasi\textsc{.aku}} ] [.N {\?{\it геев}\\ gay\textsc{.jam.gen}} ] ] [.FV [.P {\?{\it в}\\ di} ] [.N\textsc{.part} {\?{\it России}\\ Rusia\textsc{.prep}} ] ] ] ] ] }
\end{exe}
\end{document}
Tudo correu bem até que as linhas se encontraram com palavras multilinhas. Como posso melhorar meu documento para que as palavras sejam distribuídas igualmente e as linhas fiquem todas retas?
Eu quero que as linhas sejam retas assim:
Eu tentei \tikzset{sibling distance=18pt}
argumentar, mas apenas aumentou a distância, não deixou as linhas retas:
Responder1
[EditarVeja tikz-qtree
a solução abaixo. Mas forest
é mais flexível.]
No forest
, é fácil formatar a árvore de acordo com sua vontade. Pelo que vale, aqui está uma forest
solução. Observe que, na minha máquina, seu código usa mf
fontes em vez de um formato escalável, o que provavelmente não é o que você deseja, mas pode ser uma função de minimizar o exemplo. Minimizei ainda mais o código para fins desta questão.
A sintaxe não é diferente de qtree
/ tikz-qtree
, mas não há pontos e os filhos precisam de colchetes mesmo na ausência de ramificação.
\documentclass[border=10pt,10pt]{standalone}
\usepackage[russian,indonesian]{babel}
\usepackage[linguistics]{forest}
\newcommand{\?}[1]{\foreignlanguage{russian}{#1}}
\begin{document}
\begin{forest}
for tree={%
grow=0,
anchor=base west,
},
where n children=0{%
tier=terminus,
calign with current edge,
align=left,
}{%
font=\scshape,
},
[K
[FV
[FN
[FV
[P [\?{\itshape в}\\ di] ]
[N.part [\?{\itshape России}\\ Rusia\textsc{.prep}] ]
]
[FN
[N [\?{\itshape геев}\\ gay\textsc{.jam.gen}] ]
[N [\?{\itshape дискриминацию}\\ diskriminasi\textsc{.aku}] ]
]
]
[V [\?{\itshape опроверг}\\membantah] ]
]
[FN [\?{\itshape Путин}\\ Putin ] ]
]
\end{forest}
\end{document}
Também atualizei comandos de fontes obsoletos.
Não vou postar uma foto porque um bug no Okular mais recente no X faz com que todas as minhas fotos pareçam horríveis, independentemente da saída real, então não há muito sentido. Desculpas pela omissão.
EDITAR
Se você quiser usar tikz-qtree
, definir anchor=west
em vez de anchor=base west
resolver o problema:
\documentclass[10pt]{article}
\usepackage{linguex}
\usepackage[russian,indonesian]{babel}
\usepackage{tikz-qtree}
\usepackage{gb4e}
\newcommand{\?}[1]{\foreignlanguage{russian}{#1}}
\begin{document}
\begin{exe}
\ex{{\bfseries (RU)}
\tikzset{%
grow'=right,
every tree node/.style={anchor=west,align=left},
frontier/.style={distance from root=170pt},
execute at begin node=\strut,
}
\begin{tikzpicture}
\Tree [.K [.FN {\?{\itshape Путин}\\ Putin} ] [.FV [.V {\?{\itshape опроверг}\\ membantah} ] [.FN [.FN [. N {\?{\itshape дискриминацию}\\ diskriminasi\textsc{.aku}} ] [.N {\?{\itshape геев}\\ gay\textsc{.jam.gen}} ] ] [.FV [.P {\?{\itshape в}\\ di} ] [.N\textsc{.part} {\?{\itshape России}\\ Rusia\textsc{.prep}} ] ] ] ] ]
\end{tikzpicture}%
}
\end{exe}
\end{document}
Não sei por que não pensei nisso em primeiro lugar....