TeX - LaTeX Asked by Tadhg Ó Conaill on January 7, 2021
I’ve been working with gb4e to manage numbered examples for a long time, but I was wondering it was possible to incorporate movement lines, or if I should use some other package. More concretely, I would like to generate something like the below:
I don't know about the best way to create the bracketed structures, but here I show how to insert the so-called movement lines: connect[direction]{left-end}{mid-text}{right-end}
. Here is the MWE.
documentclass{article}
usepackage{stackengine,amssymb}
defstacktype{L}
newsaveboxtmpbox
defrlht{3ex} defrlwd{.8pt} defrloffset{3pt}
newcommandvstrut[1][x]{%
defstacktype{S}%
if x#1%
smash{makebox[0pt]{rule{rlwd}{rlht}}}%
else%
smash{makebox[0pt]{stackon[-5pt]{rule{rlwd}{rlht}}%
{hspace{.5dimexprrlwdrelax}$blacktriangle$}}}%
fi%
}
newcommandconR[2][x]{%
saveboxtmpbox{#2}%
stackunder[dimexprrlht-rlwdrelax+rloffset]{usebox{tmpbox}}{%
rule{.5wdtmpbox}{0pt}vstrut[#1]rule{.5wdtmpbox}{rlwd}}%
}
newcommandconL[2][x]{%
saveboxtmpbox{#2}%
stackunder[dimexprrlht-rlwdrelax+rloffset]{usebox{tmpbox}}{%
rule{.5wdtmpbox}{rlwd}vstrut[#1]rule{.5wdtmpbox}{0pt}}%
}
newcommandconM[1]{%
saveboxtmpbox{#1}%
stackunder[dimexprrlht-rlwdrelax+rloffset]{usebox{tmpbox}}{%
rule{wdtmpbox}{rlwd}}%
}
newcommandconnect[4][x]{%
if l#1conR[a]{#2}elseconR{#2}fi%
conM{#3}%
if r#1conL[a]{#4}elseconL{#4}fiignorespaces%
}
newcommandlb[1]{[$_mathrm{scriptscriptstyle#1},$}
begin{document}
lb{TP}itshape Seve%
connect[l]{r}{al riotsupshapelb{T}are]lb{VP}lb{V}believed]lb{TP}%
lb{T}to]lb{AUXP}lb{AUX}have]lb{VP}lb{V}occurred]lb{QP}}{t}%
upshape]]]]]]
end{document}
Answered by Steven B. Segletes on January 7, 2021
You know, actually there is an example of such a thing in the end of the gb4e
documentation.
documentclass{article}
usepackage{gb4e}
begin{document}
begin{exe}
exatcenter{arrowalign{
lb{TP} & emph{Seveal riots} & lb{T}are]lb{VP}lb{V}believed]lb{TP}lb{T}to]lb{AUXP}lb{AUX}have]lb{VP}lb{V}occurred]lb{QP}&emph{t}&]]]]]] cr
&fillrightpu&link1&fillleftvrule & cr}}
end{exe}
end{document}
But there is a problem with an alignment: number is between an arrow and an example… There is no such a problem with Steven B. Segletes’s solution. First I've tried to do it with tikz-dependency
, but there is the same alignment problem.
Answered by AGricola Moroz on January 7, 2021
Personally, I once used linguex
in conjunction with pst-jtree
. That gives you all the power you need. Please excuse that I shortened the example somewhat. The jtree
command has to be called once in the document before the example for some reason. Also note that the document has to be compiled as .ps
first.
documentclass[12pt]{article}
usepackage{linguex}
usepackage[usenames,dvipsnames]{pstricks}
usepackage{pst-xkey}
usepackage{epsfig}
usepackage{pst-jtree}
begin{document}
jtree
endjtree
exi. rnode{a1}{X} [CP $ldots$ [TP $ldots$ rnode{a2}{t} $ldots$]]
ncbar[angleA=270, angleB=270, linestyle=dashed]{<-}{a1}{a2}
end{document}
Answered by aslakr on January 7, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP