Upside-down syntax trees for linguistics with horizontal lines The Next CEO of Stack OverflowAdding words centered above other words with TikZHighlighting text through stacked colored underlinesArcs in linguistic functional structure (LFG)Aligning multiple TikZ trees with other nodesTikZ trees grow right typesets things “upside down”Making mixed trees with and without text-containing nodesTrees with nodes consisting of multiple linesTrees with only leaves in TikZUpside-down trees in forestwiggly lines in syntactic treesUsing native Tikz tree or forest?TikZ: path-style syntax upside-down tree for adpositional grammarstrees with straight spines, and not too much vertical space?

0 rank tensor vs 1D vector

Newlines in BSD sed vs gsed

Would this house-rule that treats advantage as a +1 to the roll instead (and disadvantage as -1) and allows them to stack be balanced?

Flying from Cape Town to England and return to another province

Can a Bladesinger Wizard use Bladesong with a Hand Crossbow?

Can we say or write : "No, it'sn't"?

Should I tutor a student who I know has cheated on their homework?

Is it okay to majorly distort historical facts while writing a fiction story?

Can MTA send mail via a relay without being told so?

Is it convenient to ask the journal's editor for two additional days to complete a review?

Easy to read palindrome checker

Why don't programming languages automatically manage the synchronous/asynchronous problem?

Does soap repel water?

How a 64-bit process virtual address space is divided in Linux?

Math-accent symbol over parentheses enclosing accented symbol (amsmath)

Is it my responsibility to learn a new technology in my own time my employer wants to implement?

Rotate a column

How to count occurrences of text in a file?

Why isn't the Mueller report being released completely and unredacted?

Why is my new battery behaving weirdly?

Why do airplanes bank sharply to the right after air-to-air refueling?

What happened in Rome, when the western empire "fell"?

A Man With a Stainless Steel Endoskeleton (like The Terminator) Fighting Cloaked Aliens Only He Can See

Does it make sense to invest money on space investigation?



Upside-down syntax trees for linguistics with horizontal lines



The Next CEO of Stack OverflowAdding words centered above other words with TikZHighlighting text through stacked colored underlinesArcs in linguistic functional structure (LFG)Aligning multiple TikZ trees with other nodesTikZ trees grow right typesets things “upside down”Making mixed trees with and without text-containing nodesTrees with nodes consisting of multiple linesTrees with only leaves in TikZUpside-down trees in forestwiggly lines in syntactic treesUsing native Tikz tree or forest?TikZ: path-style syntax upside-down tree for adpositional grammarstrees with straight spines, and not too much vertical space?










8















I know that syntax analysis can be done in Latex using using TikZ, but the tree-structure that produces isn't really used in my country. Here, we mostly use straight lines instead of hierarchy trees.



Here's an example what I want to achieve. I don't know where to start from.



Is there any (more or less) easy way to do it? Any idea?



enter image description here




Edit:



Even though all solutions provided until the moment are right, it would be nice to modify the following characteristics of the different diagrams you've proposed:



  • The sentence that is being analysed ("La novela que me ha regalado mi hermana...") should be on top of the graphic and all words must be in the same line; "la" can't be immediately over "Det" and "está" shouldn't be immediately over "N/V".


  • All the syntax functions of the differents words ("OP", "S/SN", "PN/SV", "Det"...) should be centered with the respective lines they have above (or at least near to the center but without having to change manually the spacing).


  • It should be possible to modify the height of the diagram.










share|improve this question



















  • 1





    Could you please supply some code? I realise you don't know how to draw the diagram but at least provide the document framework and the text which needs to go into the diagram. This makes it a lot easier to try out a solution than trying to start from scratch.

    – cfr
    Apr 19 '14 at 21:43











  • See essex.ac.uk/linguistics/external/clmt/latex4ling.

    – cfr
    Apr 19 '14 at 21:54











  • Out of curiosity, were you able to figure out solutions to the three items under your “Edit” section?

    – hftf
    May 2 '14 at 19:37











  • Not really, but your answer fits almost what I want to do. However, it would be nice to solve them.

    – JnxF
    May 2 '14 at 20:51















8















I know that syntax analysis can be done in Latex using using TikZ, but the tree-structure that produces isn't really used in my country. Here, we mostly use straight lines instead of hierarchy trees.



Here's an example what I want to achieve. I don't know where to start from.



Is there any (more or less) easy way to do it? Any idea?



enter image description here




Edit:



Even though all solutions provided until the moment are right, it would be nice to modify the following characteristics of the different diagrams you've proposed:



  • The sentence that is being analysed ("La novela que me ha regalado mi hermana...") should be on top of the graphic and all words must be in the same line; "la" can't be immediately over "Det" and "está" shouldn't be immediately over "N/V".


  • All the syntax functions of the differents words ("OP", "S/SN", "PN/SV", "Det"...) should be centered with the respective lines they have above (or at least near to the center but without having to change manually the spacing).


  • It should be possible to modify the height of the diagram.










share|improve this question



















  • 1





    Could you please supply some code? I realise you don't know how to draw the diagram but at least provide the document framework and the text which needs to go into the diagram. This makes it a lot easier to try out a solution than trying to start from scratch.

    – cfr
    Apr 19 '14 at 21:43











  • See essex.ac.uk/linguistics/external/clmt/latex4ling.

    – cfr
    Apr 19 '14 at 21:54











  • Out of curiosity, were you able to figure out solutions to the three items under your “Edit” section?

    – hftf
    May 2 '14 at 19:37











  • Not really, but your answer fits almost what I want to do. However, it would be nice to solve them.

    – JnxF
    May 2 '14 at 20:51













8












8








8


2






I know that syntax analysis can be done in Latex using using TikZ, but the tree-structure that produces isn't really used in my country. Here, we mostly use straight lines instead of hierarchy trees.



Here's an example what I want to achieve. I don't know where to start from.



Is there any (more or less) easy way to do it? Any idea?



enter image description here




Edit:



Even though all solutions provided until the moment are right, it would be nice to modify the following characteristics of the different diagrams you've proposed:



  • The sentence that is being analysed ("La novela que me ha regalado mi hermana...") should be on top of the graphic and all words must be in the same line; "la" can't be immediately over "Det" and "está" shouldn't be immediately over "N/V".


  • All the syntax functions of the differents words ("OP", "S/SN", "PN/SV", "Det"...) should be centered with the respective lines they have above (or at least near to the center but without having to change manually the spacing).


  • It should be possible to modify the height of the diagram.










share|improve this question
















I know that syntax analysis can be done in Latex using using TikZ, but the tree-structure that produces isn't really used in my country. Here, we mostly use straight lines instead of hierarchy trees.



Here's an example what I want to achieve. I don't know where to start from.



Is there any (more or less) easy way to do it? Any idea?



enter image description here




Edit:



Even though all solutions provided until the moment are right, it would be nice to modify the following characteristics of the different diagrams you've proposed:



  • The sentence that is being analysed ("La novela que me ha regalado mi hermana...") should be on top of the graphic and all words must be in the same line; "la" can't be immediately over "Det" and "está" shouldn't be immediately over "N/V".


  • All the syntax functions of the differents words ("OP", "S/SN", "PN/SV", "Det"...) should be centered with the respective lines they have above (or at least near to the center but without having to change manually the spacing).


  • It should be possible to modify the height of the diagram.







tikz-pgf tikz-trees linguistics trees forest






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Apr 13 '15 at 1:36









hftf

1,73311229




1,73311229










asked Apr 19 '14 at 21:30









JnxFJnxF

5161416




5161416







  • 1





    Could you please supply some code? I realise you don't know how to draw the diagram but at least provide the document framework and the text which needs to go into the diagram. This makes it a lot easier to try out a solution than trying to start from scratch.

    – cfr
    Apr 19 '14 at 21:43











  • See essex.ac.uk/linguistics/external/clmt/latex4ling.

    – cfr
    Apr 19 '14 at 21:54











  • Out of curiosity, were you able to figure out solutions to the three items under your “Edit” section?

    – hftf
    May 2 '14 at 19:37











  • Not really, but your answer fits almost what I want to do. However, it would be nice to solve them.

    – JnxF
    May 2 '14 at 20:51












  • 1





    Could you please supply some code? I realise you don't know how to draw the diagram but at least provide the document framework and the text which needs to go into the diagram. This makes it a lot easier to try out a solution than trying to start from scratch.

    – cfr
    Apr 19 '14 at 21:43











  • See essex.ac.uk/linguistics/external/clmt/latex4ling.

    – cfr
    Apr 19 '14 at 21:54











  • Out of curiosity, were you able to figure out solutions to the three items under your “Edit” section?

    – hftf
    May 2 '14 at 19:37











  • Not really, but your answer fits almost what I want to do. However, it would be nice to solve them.

    – JnxF
    May 2 '14 at 20:51







1




1





Could you please supply some code? I realise you don't know how to draw the diagram but at least provide the document framework and the text which needs to go into the diagram. This makes it a lot easier to try out a solution than trying to start from scratch.

– cfr
Apr 19 '14 at 21:43





Could you please supply some code? I realise you don't know how to draw the diagram but at least provide the document framework and the text which needs to go into the diagram. This makes it a lot easier to try out a solution than trying to start from scratch.

– cfr
Apr 19 '14 at 21:43













See essex.ac.uk/linguistics/external/clmt/latex4ling.

– cfr
Apr 19 '14 at 21:54





See essex.ac.uk/linguistics/external/clmt/latex4ling.

– cfr
Apr 19 '14 at 21:54













Out of curiosity, were you able to figure out solutions to the three items under your “Edit” section?

– hftf
May 2 '14 at 19:37





Out of curiosity, were you able to figure out solutions to the three items under your “Edit” section?

– hftf
May 2 '14 at 19:37













Not really, but your answer fits almost what I want to do. However, it would be nice to solve them.

– JnxF
May 2 '14 at 20:51





Not really, but your answer fits almost what I want to do. However, it would be nice to solve them.

– JnxF
May 2 '14 at 20:51










4 Answers
4






active

oldest

votes


















11














Here’s a solution that uses the excellent forest package.



documentclass[tikz,border=5pt]standalone
usepackageforest

% Node shape adapted from http://www.texample.net/tikz/examples/data-flow-diagram/
makeatletter pgfdeclareshapemyunderline
inheritsavedanchors[from=rectangle]
inheritanchorborder[from=rectangle]
foreach from in
center,base,north,north east,east,south east,south,south west,west,north west
inheritanchor[from=rectangle]from

backgroundpath
southwest pgf@xa=pgf@x pgf@ya=pgf@y
northeast pgf@xb=pgf@x pgf@yb=pgf@y
% This can be improved by removing magic numbers
pgfpathmovetopgfpointpgf@xapgf@ya+1.75em
pgfpathlinetopgfpointpgf@xbpgf@ya+1.75em

makeatother

begindocument
beginforest
for tree=
fit=band, % Isolates space above this node from siblings’ descendants
no edge,
% Uncomment the line below for the dotted edges
% edge=dotted, semithick, gray!50, shorten <=8pt, parent anchor=north,
% This can be improved by reducing space between levels where edges are drawn
inner sep=0pt, outer sep=0pt,
l sep=0pt, s sep=6pt, text depth=0.5em, grow'=north,
where level=0 % No style for dummy root node
where n children=0
font=bfseries,tier=word % Leaves in bold on the same tier
font=small,tikz=node[draw, thick, myunderline, fit to=tree] ; % Non-leaves


% This can be improved by removing the need for a parent and sibling of the actual root
[,phantom[,phantom][OP
[S/SN
[Det [La] ]
[N/Sust [novela] ]
[CN/SAdj/Prop Sub Adj
[PV/SV,
[textitnexo [que] ]
[CI/SN [me] ]
[N/V [ha regalado] ]
]
[S/SN
[Det [mi] ]
[N [hermana] ]
]
]
]
[PN/SV
[N/V [est'a] ]
[Attrib/SAdj
[N [ambientada] ]
]
[CCL/SPrep
[E [en] ]
[T/SN
[N [Australiarlap.] ]
]
]
]
]]
endforest
enddocument






And here’s another version with faint dotted edges:







You can render the same structure in a more conventional appearance just by changing options:



for tree=
edge=dotted, semithick, gray!80, shorten <=1pt,shorten >=3pt,
parent anchor=south, child anchor=north,
inner sep=0pt, outer ysep=2pt,
text depth=0.5em,
where n children=0font=bfseries,tier=wordfont=small







So you can see why one might prefer using forest instead of bussproofs or semantics. Also, the forest tree syntax is much simpler, and is not “backwards” as seen in cfr’s answer.



Take a look at the forest manual for more style options.



2019 edit:
fit to tree option syntax has been modified to fit to=tree






share|improve this answer




















  • 1





    Nice solution. BTW, how can I reduce the vertical height of the diagram? I've tried l sep with negative values without success. Thank you

    – JnxF
    Apr 20 '14 at 14:39







  • 2





    Very slick solution. I wish I understood forest. I don't see why my solution is 'backwards' though. You are analysing the sentence so that's where you are starting, surely? In that sense, your solution seems to be 'backwards' if anything. Still very nice, though - especially being able to easily turn it upside down like that.

    – cfr
    Apr 20 '14 at 17:10











  • @JnxF I also tried playing with l sep, inner ysep, outer ysep, and the like with no success, but I thought my solution answered your question enough to still post it. You could post a new question, or just wait for other people who know more about forest to stop by.

    – hftf
    Apr 20 '14 at 20:16











  • @cfr I guess it depends on your perspective :). In my experience, trees are usually specified parent-first — that’s how the syntax (heh) of most of the various tree packages I’ve tried (forest, tikz-qtree, qtree, synttree, “plain” TikZ) work. It would be trivial to replace forest with any of those if you wanted to, but harder to switch to bussproofs or semantics since they are specified child-first.

    – hftf
    Apr 20 '14 at 20:29











  • @htft I don't considerate necessary to ask another question. I've just edited this one.

    – JnxF
    Apr 20 '14 at 23:13


















7














For example:



documentclassstandalone
usepackage[inference]semantic
usepackage[utf8]inputenc
usepackage[T1]fontenc

begindocument

setpremisesend0pt
setpremisesspace1pt
setnamespace0pt
inference%
inference%
inferencemboxLaDet
&
inferencemboxnovelaN/Sust
&
inference%
inference%
inferencemboxquenexo
&
inferencemboxmeCI/SN
&
inferencemboxha regaladoN/V

PV/SV
&
inference%
inferencemboxmiDet
&
inferencemboxhermanaN

S/SN

CN/SAdj/Prop. Sub. Adj

S/SN
&
inference%
inferencemboxestáN/V
&
inference%
inferencemboxambientadaN

Attrib/SAdj
&
inference%
inferencemboxenE
&
inference%
inferencemboxAustraliaN

T/SN

CCL/SPrep

PN/SV

OP

enddocument


Tree






share|improve this answer

























  • I have absolutely no idea what exactly the OP wants, or how semantic works, but it seems to me a key part is that the lines are the same length as the word(s) they refer to, and yours don't seem to have that. Is that adjustable?

    – Jānis Lazovskis
    Apr 20 '14 at 0:30











  • I mean the words in the sentence above the picture, for example "nexo" refers to "que", "CI/SN" to "me", "N/V" to "ha regalado" and "PV/SV" to "que me ha regalado". You haven't included the sentence in your answer, even though the lines more or less line up with the words they refer to. I'm just under the impression that the lines being the same length as the words is key, since this is a linguistics question and the words below seem to describe parts of the sentence above.

    – Jānis Lazovskis
    Apr 20 '14 at 1:06











  • @JānisL Yes. Sorry. I deleted my comment because I realised what you meant. I am not sure you can (straightforwardly) do that with semantic but you can put the words right above the relevant analysis (see edit) so that it is obvious what goes with what. This is the way semantic is used on the LaTeX for Linguists site and this option looked like the closest match to the image the OP posted. Another possibility would be to adapt a package intended for typesetting similar kinds of proofs in formal logic. (bussproofs is maybe the best known.) But this seemed a little more promising here...

    – cfr
    Apr 20 '14 at 1:22











  • prftree might be a better option, now.

    – cfr
    Apr 13 '15 at 1:50











  • Is there any way to get one of those packages (semantic, bussproofs, prftree) to align the uppermost row at the top together?

    – hftf
    Apr 13 '15 at 15:51


















3














Here's a different way... based on my answer at Highlighting text through stacked colored underlines



documentclassarticle
usepackagestackengine
newlengthtmpln
newlengthlunderset
newlengthrulethick
lunderset=1baselineskiprelax
rulethick=.8ptrelax
defstackalignmentl
newcommandnunderline[3][1]setbox0=hbox#2tmpln=wd0%
stackunder[#1lunderset-rulethick]strut#2%
smashraisebox-.6baselineskipmakebox[0pt][l]scriptsize #3%
ruletmplnrulethick%
letNunnunderline
letHShspace
begindocument
NunNunNun[3]LaDet%
NunNun[4] %
NunNunNun[3]novelaN/Sust%
NunNun[4] %
NunNunNunNunNun queitshape nexo%
NunNunNunNun[2] %
NunNunNunNunNun meCI/SN%
NunNunNunNun[2] PV/SVCN/SAdj/Prop. Sub. AdjS/SN%
NunNunNunNunNun ha%
NunNunNunNunNun %
NunNunNunNunNun regaladoN/V%
NunNunNun[3] %
NunNunNunNunNun miDet%
NunNunNunNun[2] %
NunNunNunNunNun hermanaHS5exNS/SNOP%
Nun[5] %
NunNunNun[3]est'aN/V%
NunNun[4] %
NunNunNunNun[2]ambientadaHS7exNAttrib/SAdjHS7exPN/SV%
NunNun[4] %
NunNunNunNun[2]enEHS4exCCL/SPrep%
NunNunNun[3] %
NunNunNunNunNun AustraliaHS6exNHS3exT/SN%
enddocument


enter image description here






share|improve this answer
































    2














    For completeness, and in partial response to a query in the comments on my other answer, here is the tree set with prftree. As can be seen, this no more lends itself to typesetting this kind of tree than semantic. If anybody wants to typeset natural deduction proofs of this kind for logic, though, it looks like a really nice package with a lot of convenience commands, flexible customisation and a nice syntax. The tree here is very verbose because none of the convenience commands are appropriate: this is definitely a package intended for symbolic logic. The result is very, very slightly closer to the target tree in some ways than with semantic but the improvement is marginal, at best, and the result is even further from the target in other aspects.



    My conclusion is that none of bussproofs, semantic and prftree are well-suited to typesetting this kind of tree. The forest and stackengine solutions are definitely superior relative to the question desiderata.



    However, for logic, these package are superior to the other solutions offered here. They are designed for that purpose and will produce trees more easily and with less hassle. prftree looks especially good, even though this is the first time I've used it. The alignments and spacings are designed to work correctly out-of-the-box for logic, and prftree allows you to specify the tree using standard rules of inference, which makes it more readable, less verbose and more intuitive. My conclusion above is not, therefore, intended as a criticism of these packages. They just aren't designed for this sort of tree.



    documentclass[landscape]article
    usepackage[utf8]inputenc
    usepackage[T1]fontenc
    usepackageprftree,geometry,mathtools
    begindocument

    [
    prftree%
    prftree%
    prftreetextLaDet
    %
    prftreetextnovelaN/Sust
    %
    prftree%
    prftree%
    prftreetextquenexo
    %
    prftreetextmeCI/SN
    %
    prftreetextha regaladoN/V

    PV/SV
    %
    prftree%
    prftreetextmiDet
    %
    prftreetexthermanaN
    S/SN

    CN/SAdj/Prop. Sub. Adj

    S/SN

    prftree%
    prftreetextestáN/V
    %
    prftree%
    prftreetextambientadaN

    Attrib/SAdj
    %
    prftree%
    prftreetextenE
    %
    prftree%
    prftreetextAustraliaN

    T/SN

    CCL/SPrep

    PN/SV

    OP
    ]

    enddocument


    <code>prftree</code> proof






    share|improve this answer

























    • Another thing is that they all seem to default to math mode :o)

      – hftf
      Apr 14 '15 at 14:40











    • @hftf Again, given their purpose, that makes sense ;).

      – cfr
      Apr 14 '15 at 16:56











    • @cfr cannot you force the main sentence vertical alignment?

      – JFernan
      2 hours ago











    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "85"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f172415%2fupside-down-syntax-trees-for-linguistics-with-horizontal-lines%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    4 Answers
    4






    active

    oldest

    votes








    4 Answers
    4






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    11














    Here’s a solution that uses the excellent forest package.



    documentclass[tikz,border=5pt]standalone
    usepackageforest

    % Node shape adapted from http://www.texample.net/tikz/examples/data-flow-diagram/
    makeatletter pgfdeclareshapemyunderline
    inheritsavedanchors[from=rectangle]
    inheritanchorborder[from=rectangle]
    foreach from in
    center,base,north,north east,east,south east,south,south west,west,north west
    inheritanchor[from=rectangle]from

    backgroundpath
    southwest pgf@xa=pgf@x pgf@ya=pgf@y
    northeast pgf@xb=pgf@x pgf@yb=pgf@y
    % This can be improved by removing magic numbers
    pgfpathmovetopgfpointpgf@xapgf@ya+1.75em
    pgfpathlinetopgfpointpgf@xbpgf@ya+1.75em

    makeatother

    begindocument
    beginforest
    for tree=
    fit=band, % Isolates space above this node from siblings’ descendants
    no edge,
    % Uncomment the line below for the dotted edges
    % edge=dotted, semithick, gray!50, shorten <=8pt, parent anchor=north,
    % This can be improved by reducing space between levels where edges are drawn
    inner sep=0pt, outer sep=0pt,
    l sep=0pt, s sep=6pt, text depth=0.5em, grow'=north,
    where level=0 % No style for dummy root node
    where n children=0
    font=bfseries,tier=word % Leaves in bold on the same tier
    font=small,tikz=node[draw, thick, myunderline, fit to=tree] ; % Non-leaves


    % This can be improved by removing the need for a parent and sibling of the actual root
    [,phantom[,phantom][OP
    [S/SN
    [Det [La] ]
    [N/Sust [novela] ]
    [CN/SAdj/Prop Sub Adj
    [PV/SV,
    [textitnexo [que] ]
    [CI/SN [me] ]
    [N/V [ha regalado] ]
    ]
    [S/SN
    [Det [mi] ]
    [N [hermana] ]
    ]
    ]
    ]
    [PN/SV
    [N/V [est'a] ]
    [Attrib/SAdj
    [N [ambientada] ]
    ]
    [CCL/SPrep
    [E [en] ]
    [T/SN
    [N [Australiarlap.] ]
    ]
    ]
    ]
    ]]
    endforest
    enddocument






    And here’s another version with faint dotted edges:







    You can render the same structure in a more conventional appearance just by changing options:



    for tree=
    edge=dotted, semithick, gray!80, shorten <=1pt,shorten >=3pt,
    parent anchor=south, child anchor=north,
    inner sep=0pt, outer ysep=2pt,
    text depth=0.5em,
    where n children=0font=bfseries,tier=wordfont=small







    So you can see why one might prefer using forest instead of bussproofs or semantics. Also, the forest tree syntax is much simpler, and is not “backwards” as seen in cfr’s answer.



    Take a look at the forest manual for more style options.



    2019 edit:
    fit to tree option syntax has been modified to fit to=tree






    share|improve this answer




















    • 1





      Nice solution. BTW, how can I reduce the vertical height of the diagram? I've tried l sep with negative values without success. Thank you

      – JnxF
      Apr 20 '14 at 14:39







    • 2





      Very slick solution. I wish I understood forest. I don't see why my solution is 'backwards' though. You are analysing the sentence so that's where you are starting, surely? In that sense, your solution seems to be 'backwards' if anything. Still very nice, though - especially being able to easily turn it upside down like that.

      – cfr
      Apr 20 '14 at 17:10











    • @JnxF I also tried playing with l sep, inner ysep, outer ysep, and the like with no success, but I thought my solution answered your question enough to still post it. You could post a new question, or just wait for other people who know more about forest to stop by.

      – hftf
      Apr 20 '14 at 20:16











    • @cfr I guess it depends on your perspective :). In my experience, trees are usually specified parent-first — that’s how the syntax (heh) of most of the various tree packages I’ve tried (forest, tikz-qtree, qtree, synttree, “plain” TikZ) work. It would be trivial to replace forest with any of those if you wanted to, but harder to switch to bussproofs or semantics since they are specified child-first.

      – hftf
      Apr 20 '14 at 20:29











    • @htft I don't considerate necessary to ask another question. I've just edited this one.

      – JnxF
      Apr 20 '14 at 23:13















    11














    Here’s a solution that uses the excellent forest package.



    documentclass[tikz,border=5pt]standalone
    usepackageforest

    % Node shape adapted from http://www.texample.net/tikz/examples/data-flow-diagram/
    makeatletter pgfdeclareshapemyunderline
    inheritsavedanchors[from=rectangle]
    inheritanchorborder[from=rectangle]
    foreach from in
    center,base,north,north east,east,south east,south,south west,west,north west
    inheritanchor[from=rectangle]from

    backgroundpath
    southwest pgf@xa=pgf@x pgf@ya=pgf@y
    northeast pgf@xb=pgf@x pgf@yb=pgf@y
    % This can be improved by removing magic numbers
    pgfpathmovetopgfpointpgf@xapgf@ya+1.75em
    pgfpathlinetopgfpointpgf@xbpgf@ya+1.75em

    makeatother

    begindocument
    beginforest
    for tree=
    fit=band, % Isolates space above this node from siblings’ descendants
    no edge,
    % Uncomment the line below for the dotted edges
    % edge=dotted, semithick, gray!50, shorten <=8pt, parent anchor=north,
    % This can be improved by reducing space between levels where edges are drawn
    inner sep=0pt, outer sep=0pt,
    l sep=0pt, s sep=6pt, text depth=0.5em, grow'=north,
    where level=0 % No style for dummy root node
    where n children=0
    font=bfseries,tier=word % Leaves in bold on the same tier
    font=small,tikz=node[draw, thick, myunderline, fit to=tree] ; % Non-leaves


    % This can be improved by removing the need for a parent and sibling of the actual root
    [,phantom[,phantom][OP
    [S/SN
    [Det [La] ]
    [N/Sust [novela] ]
    [CN/SAdj/Prop Sub Adj
    [PV/SV,
    [textitnexo [que] ]
    [CI/SN [me] ]
    [N/V [ha regalado] ]
    ]
    [S/SN
    [Det [mi] ]
    [N [hermana] ]
    ]
    ]
    ]
    [PN/SV
    [N/V [est'a] ]
    [Attrib/SAdj
    [N [ambientada] ]
    ]
    [CCL/SPrep
    [E [en] ]
    [T/SN
    [N [Australiarlap.] ]
    ]
    ]
    ]
    ]]
    endforest
    enddocument






    And here’s another version with faint dotted edges:







    You can render the same structure in a more conventional appearance just by changing options:



    for tree=
    edge=dotted, semithick, gray!80, shorten <=1pt,shorten >=3pt,
    parent anchor=south, child anchor=north,
    inner sep=0pt, outer ysep=2pt,
    text depth=0.5em,
    where n children=0font=bfseries,tier=wordfont=small







    So you can see why one might prefer using forest instead of bussproofs or semantics. Also, the forest tree syntax is much simpler, and is not “backwards” as seen in cfr’s answer.



    Take a look at the forest manual for more style options.



    2019 edit:
    fit to tree option syntax has been modified to fit to=tree






    share|improve this answer




















    • 1





      Nice solution. BTW, how can I reduce the vertical height of the diagram? I've tried l sep with negative values without success. Thank you

      – JnxF
      Apr 20 '14 at 14:39







    • 2





      Very slick solution. I wish I understood forest. I don't see why my solution is 'backwards' though. You are analysing the sentence so that's where you are starting, surely? In that sense, your solution seems to be 'backwards' if anything. Still very nice, though - especially being able to easily turn it upside down like that.

      – cfr
      Apr 20 '14 at 17:10











    • @JnxF I also tried playing with l sep, inner ysep, outer ysep, and the like with no success, but I thought my solution answered your question enough to still post it. You could post a new question, or just wait for other people who know more about forest to stop by.

      – hftf
      Apr 20 '14 at 20:16











    • @cfr I guess it depends on your perspective :). In my experience, trees are usually specified parent-first — that’s how the syntax (heh) of most of the various tree packages I’ve tried (forest, tikz-qtree, qtree, synttree, “plain” TikZ) work. It would be trivial to replace forest with any of those if you wanted to, but harder to switch to bussproofs or semantics since they are specified child-first.

      – hftf
      Apr 20 '14 at 20:29











    • @htft I don't considerate necessary to ask another question. I've just edited this one.

      – JnxF
      Apr 20 '14 at 23:13













    11












    11








    11







    Here’s a solution that uses the excellent forest package.



    documentclass[tikz,border=5pt]standalone
    usepackageforest

    % Node shape adapted from http://www.texample.net/tikz/examples/data-flow-diagram/
    makeatletter pgfdeclareshapemyunderline
    inheritsavedanchors[from=rectangle]
    inheritanchorborder[from=rectangle]
    foreach from in
    center,base,north,north east,east,south east,south,south west,west,north west
    inheritanchor[from=rectangle]from

    backgroundpath
    southwest pgf@xa=pgf@x pgf@ya=pgf@y
    northeast pgf@xb=pgf@x pgf@yb=pgf@y
    % This can be improved by removing magic numbers
    pgfpathmovetopgfpointpgf@xapgf@ya+1.75em
    pgfpathlinetopgfpointpgf@xbpgf@ya+1.75em

    makeatother

    begindocument
    beginforest
    for tree=
    fit=band, % Isolates space above this node from siblings’ descendants
    no edge,
    % Uncomment the line below for the dotted edges
    % edge=dotted, semithick, gray!50, shorten <=8pt, parent anchor=north,
    % This can be improved by reducing space between levels where edges are drawn
    inner sep=0pt, outer sep=0pt,
    l sep=0pt, s sep=6pt, text depth=0.5em, grow'=north,
    where level=0 % No style for dummy root node
    where n children=0
    font=bfseries,tier=word % Leaves in bold on the same tier
    font=small,tikz=node[draw, thick, myunderline, fit to=tree] ; % Non-leaves


    % This can be improved by removing the need for a parent and sibling of the actual root
    [,phantom[,phantom][OP
    [S/SN
    [Det [La] ]
    [N/Sust [novela] ]
    [CN/SAdj/Prop Sub Adj
    [PV/SV,
    [textitnexo [que] ]
    [CI/SN [me] ]
    [N/V [ha regalado] ]
    ]
    [S/SN
    [Det [mi] ]
    [N [hermana] ]
    ]
    ]
    ]
    [PN/SV
    [N/V [est'a] ]
    [Attrib/SAdj
    [N [ambientada] ]
    ]
    [CCL/SPrep
    [E [en] ]
    [T/SN
    [N [Australiarlap.] ]
    ]
    ]
    ]
    ]]
    endforest
    enddocument






    And here’s another version with faint dotted edges:







    You can render the same structure in a more conventional appearance just by changing options:



    for tree=
    edge=dotted, semithick, gray!80, shorten <=1pt,shorten >=3pt,
    parent anchor=south, child anchor=north,
    inner sep=0pt, outer ysep=2pt,
    text depth=0.5em,
    where n children=0font=bfseries,tier=wordfont=small







    So you can see why one might prefer using forest instead of bussproofs or semantics. Also, the forest tree syntax is much simpler, and is not “backwards” as seen in cfr’s answer.



    Take a look at the forest manual for more style options.



    2019 edit:
    fit to tree option syntax has been modified to fit to=tree






    share|improve this answer















    Here’s a solution that uses the excellent forest package.



    documentclass[tikz,border=5pt]standalone
    usepackageforest

    % Node shape adapted from http://www.texample.net/tikz/examples/data-flow-diagram/
    makeatletter pgfdeclareshapemyunderline
    inheritsavedanchors[from=rectangle]
    inheritanchorborder[from=rectangle]
    foreach from in
    center,base,north,north east,east,south east,south,south west,west,north west
    inheritanchor[from=rectangle]from

    backgroundpath
    southwest pgf@xa=pgf@x pgf@ya=pgf@y
    northeast pgf@xb=pgf@x pgf@yb=pgf@y
    % This can be improved by removing magic numbers
    pgfpathmovetopgfpointpgf@xapgf@ya+1.75em
    pgfpathlinetopgfpointpgf@xbpgf@ya+1.75em

    makeatother

    begindocument
    beginforest
    for tree=
    fit=band, % Isolates space above this node from siblings’ descendants
    no edge,
    % Uncomment the line below for the dotted edges
    % edge=dotted, semithick, gray!50, shorten <=8pt, parent anchor=north,
    % This can be improved by reducing space between levels where edges are drawn
    inner sep=0pt, outer sep=0pt,
    l sep=0pt, s sep=6pt, text depth=0.5em, grow'=north,
    where level=0 % No style for dummy root node
    where n children=0
    font=bfseries,tier=word % Leaves in bold on the same tier
    font=small,tikz=node[draw, thick, myunderline, fit to=tree] ; % Non-leaves


    % This can be improved by removing the need for a parent and sibling of the actual root
    [,phantom[,phantom][OP
    [S/SN
    [Det [La] ]
    [N/Sust [novela] ]
    [CN/SAdj/Prop Sub Adj
    [PV/SV,
    [textitnexo [que] ]
    [CI/SN [me] ]
    [N/V [ha regalado] ]
    ]
    [S/SN
    [Det [mi] ]
    [N [hermana] ]
    ]
    ]
    ]
    [PN/SV
    [N/V [est'a] ]
    [Attrib/SAdj
    [N [ambientada] ]
    ]
    [CCL/SPrep
    [E [en] ]
    [T/SN
    [N [Australiarlap.] ]
    ]
    ]
    ]
    ]]
    endforest
    enddocument






    And here’s another version with faint dotted edges:







    You can render the same structure in a more conventional appearance just by changing options:



    for tree=
    edge=dotted, semithick, gray!80, shorten <=1pt,shorten >=3pt,
    parent anchor=south, child anchor=north,
    inner sep=0pt, outer ysep=2pt,
    text depth=0.5em,
    where n children=0font=bfseries,tier=wordfont=small







    So you can see why one might prefer using forest instead of bussproofs or semantics. Also, the forest tree syntax is much simpler, and is not “backwards” as seen in cfr’s answer.



    Take a look at the forest manual for more style options.



    2019 edit:
    fit to tree option syntax has been modified to fit to=tree







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited 9 mins ago









    JFernan

    414514




    414514










    answered Apr 20 '14 at 4:21









    hftfhftf

    1,73311229




    1,73311229







    • 1





      Nice solution. BTW, how can I reduce the vertical height of the diagram? I've tried l sep with negative values without success. Thank you

      – JnxF
      Apr 20 '14 at 14:39







    • 2





      Very slick solution. I wish I understood forest. I don't see why my solution is 'backwards' though. You are analysing the sentence so that's where you are starting, surely? In that sense, your solution seems to be 'backwards' if anything. Still very nice, though - especially being able to easily turn it upside down like that.

      – cfr
      Apr 20 '14 at 17:10











    • @JnxF I also tried playing with l sep, inner ysep, outer ysep, and the like with no success, but I thought my solution answered your question enough to still post it. You could post a new question, or just wait for other people who know more about forest to stop by.

      – hftf
      Apr 20 '14 at 20:16











    • @cfr I guess it depends on your perspective :). In my experience, trees are usually specified parent-first — that’s how the syntax (heh) of most of the various tree packages I’ve tried (forest, tikz-qtree, qtree, synttree, “plain” TikZ) work. It would be trivial to replace forest with any of those if you wanted to, but harder to switch to bussproofs or semantics since they are specified child-first.

      – hftf
      Apr 20 '14 at 20:29











    • @htft I don't considerate necessary to ask another question. I've just edited this one.

      – JnxF
      Apr 20 '14 at 23:13












    • 1





      Nice solution. BTW, how can I reduce the vertical height of the diagram? I've tried l sep with negative values without success. Thank you

      – JnxF
      Apr 20 '14 at 14:39







    • 2





      Very slick solution. I wish I understood forest. I don't see why my solution is 'backwards' though. You are analysing the sentence so that's where you are starting, surely? In that sense, your solution seems to be 'backwards' if anything. Still very nice, though - especially being able to easily turn it upside down like that.

      – cfr
      Apr 20 '14 at 17:10











    • @JnxF I also tried playing with l sep, inner ysep, outer ysep, and the like with no success, but I thought my solution answered your question enough to still post it. You could post a new question, or just wait for other people who know more about forest to stop by.

      – hftf
      Apr 20 '14 at 20:16











    • @cfr I guess it depends on your perspective :). In my experience, trees are usually specified parent-first — that’s how the syntax (heh) of most of the various tree packages I’ve tried (forest, tikz-qtree, qtree, synttree, “plain” TikZ) work. It would be trivial to replace forest with any of those if you wanted to, but harder to switch to bussproofs or semantics since they are specified child-first.

      – hftf
      Apr 20 '14 at 20:29











    • @htft I don't considerate necessary to ask another question. I've just edited this one.

      – JnxF
      Apr 20 '14 at 23:13







    1




    1





    Nice solution. BTW, how can I reduce the vertical height of the diagram? I've tried l sep with negative values without success. Thank you

    – JnxF
    Apr 20 '14 at 14:39






    Nice solution. BTW, how can I reduce the vertical height of the diagram? I've tried l sep with negative values without success. Thank you

    – JnxF
    Apr 20 '14 at 14:39





    2




    2





    Very slick solution. I wish I understood forest. I don't see why my solution is 'backwards' though. You are analysing the sentence so that's where you are starting, surely? In that sense, your solution seems to be 'backwards' if anything. Still very nice, though - especially being able to easily turn it upside down like that.

    – cfr
    Apr 20 '14 at 17:10





    Very slick solution. I wish I understood forest. I don't see why my solution is 'backwards' though. You are analysing the sentence so that's where you are starting, surely? In that sense, your solution seems to be 'backwards' if anything. Still very nice, though - especially being able to easily turn it upside down like that.

    – cfr
    Apr 20 '14 at 17:10













    @JnxF I also tried playing with l sep, inner ysep, outer ysep, and the like with no success, but I thought my solution answered your question enough to still post it. You could post a new question, or just wait for other people who know more about forest to stop by.

    – hftf
    Apr 20 '14 at 20:16





    @JnxF I also tried playing with l sep, inner ysep, outer ysep, and the like with no success, but I thought my solution answered your question enough to still post it. You could post a new question, or just wait for other people who know more about forest to stop by.

    – hftf
    Apr 20 '14 at 20:16













    @cfr I guess it depends on your perspective :). In my experience, trees are usually specified parent-first — that’s how the syntax (heh) of most of the various tree packages I’ve tried (forest, tikz-qtree, qtree, synttree, “plain” TikZ) work. It would be trivial to replace forest with any of those if you wanted to, but harder to switch to bussproofs or semantics since they are specified child-first.

    – hftf
    Apr 20 '14 at 20:29





    @cfr I guess it depends on your perspective :). In my experience, trees are usually specified parent-first — that’s how the syntax (heh) of most of the various tree packages I’ve tried (forest, tikz-qtree, qtree, synttree, “plain” TikZ) work. It would be trivial to replace forest with any of those if you wanted to, but harder to switch to bussproofs or semantics since they are specified child-first.

    – hftf
    Apr 20 '14 at 20:29













    @htft I don't considerate necessary to ask another question. I've just edited this one.

    – JnxF
    Apr 20 '14 at 23:13





    @htft I don't considerate necessary to ask another question. I've just edited this one.

    – JnxF
    Apr 20 '14 at 23:13











    7














    For example:



    documentclassstandalone
    usepackage[inference]semantic
    usepackage[utf8]inputenc
    usepackage[T1]fontenc

    begindocument

    setpremisesend0pt
    setpremisesspace1pt
    setnamespace0pt
    inference%
    inference%
    inferencemboxLaDet
    &
    inferencemboxnovelaN/Sust
    &
    inference%
    inference%
    inferencemboxquenexo
    &
    inferencemboxmeCI/SN
    &
    inferencemboxha regaladoN/V

    PV/SV
    &
    inference%
    inferencemboxmiDet
    &
    inferencemboxhermanaN

    S/SN

    CN/SAdj/Prop. Sub. Adj

    S/SN
    &
    inference%
    inferencemboxestáN/V
    &
    inference%
    inferencemboxambientadaN

    Attrib/SAdj
    &
    inference%
    inferencemboxenE
    &
    inference%
    inferencemboxAustraliaN

    T/SN

    CCL/SPrep

    PN/SV

    OP

    enddocument


    Tree






    share|improve this answer

























    • I have absolutely no idea what exactly the OP wants, or how semantic works, but it seems to me a key part is that the lines are the same length as the word(s) they refer to, and yours don't seem to have that. Is that adjustable?

      – Jānis Lazovskis
      Apr 20 '14 at 0:30











    • I mean the words in the sentence above the picture, for example "nexo" refers to "que", "CI/SN" to "me", "N/V" to "ha regalado" and "PV/SV" to "que me ha regalado". You haven't included the sentence in your answer, even though the lines more or less line up with the words they refer to. I'm just under the impression that the lines being the same length as the words is key, since this is a linguistics question and the words below seem to describe parts of the sentence above.

      – Jānis Lazovskis
      Apr 20 '14 at 1:06











    • @JānisL Yes. Sorry. I deleted my comment because I realised what you meant. I am not sure you can (straightforwardly) do that with semantic but you can put the words right above the relevant analysis (see edit) so that it is obvious what goes with what. This is the way semantic is used on the LaTeX for Linguists site and this option looked like the closest match to the image the OP posted. Another possibility would be to adapt a package intended for typesetting similar kinds of proofs in formal logic. (bussproofs is maybe the best known.) But this seemed a little more promising here...

      – cfr
      Apr 20 '14 at 1:22











    • prftree might be a better option, now.

      – cfr
      Apr 13 '15 at 1:50











    • Is there any way to get one of those packages (semantic, bussproofs, prftree) to align the uppermost row at the top together?

      – hftf
      Apr 13 '15 at 15:51















    7














    For example:



    documentclassstandalone
    usepackage[inference]semantic
    usepackage[utf8]inputenc
    usepackage[T1]fontenc

    begindocument

    setpremisesend0pt
    setpremisesspace1pt
    setnamespace0pt
    inference%
    inference%
    inferencemboxLaDet
    &
    inferencemboxnovelaN/Sust
    &
    inference%
    inference%
    inferencemboxquenexo
    &
    inferencemboxmeCI/SN
    &
    inferencemboxha regaladoN/V

    PV/SV
    &
    inference%
    inferencemboxmiDet
    &
    inferencemboxhermanaN

    S/SN

    CN/SAdj/Prop. Sub. Adj

    S/SN
    &
    inference%
    inferencemboxestáN/V
    &
    inference%
    inferencemboxambientadaN

    Attrib/SAdj
    &
    inference%
    inferencemboxenE
    &
    inference%
    inferencemboxAustraliaN

    T/SN

    CCL/SPrep

    PN/SV

    OP

    enddocument


    Tree






    share|improve this answer

























    • I have absolutely no idea what exactly the OP wants, or how semantic works, but it seems to me a key part is that the lines are the same length as the word(s) they refer to, and yours don't seem to have that. Is that adjustable?

      – Jānis Lazovskis
      Apr 20 '14 at 0:30











    • I mean the words in the sentence above the picture, for example "nexo" refers to "que", "CI/SN" to "me", "N/V" to "ha regalado" and "PV/SV" to "que me ha regalado". You haven't included the sentence in your answer, even though the lines more or less line up with the words they refer to. I'm just under the impression that the lines being the same length as the words is key, since this is a linguistics question and the words below seem to describe parts of the sentence above.

      – Jānis Lazovskis
      Apr 20 '14 at 1:06











    • @JānisL Yes. Sorry. I deleted my comment because I realised what you meant. I am not sure you can (straightforwardly) do that with semantic but you can put the words right above the relevant analysis (see edit) so that it is obvious what goes with what. This is the way semantic is used on the LaTeX for Linguists site and this option looked like the closest match to the image the OP posted. Another possibility would be to adapt a package intended for typesetting similar kinds of proofs in formal logic. (bussproofs is maybe the best known.) But this seemed a little more promising here...

      – cfr
      Apr 20 '14 at 1:22











    • prftree might be a better option, now.

      – cfr
      Apr 13 '15 at 1:50











    • Is there any way to get one of those packages (semantic, bussproofs, prftree) to align the uppermost row at the top together?

      – hftf
      Apr 13 '15 at 15:51













    7












    7








    7







    For example:



    documentclassstandalone
    usepackage[inference]semantic
    usepackage[utf8]inputenc
    usepackage[T1]fontenc

    begindocument

    setpremisesend0pt
    setpremisesspace1pt
    setnamespace0pt
    inference%
    inference%
    inferencemboxLaDet
    &
    inferencemboxnovelaN/Sust
    &
    inference%
    inference%
    inferencemboxquenexo
    &
    inferencemboxmeCI/SN
    &
    inferencemboxha regaladoN/V

    PV/SV
    &
    inference%
    inferencemboxmiDet
    &
    inferencemboxhermanaN

    S/SN

    CN/SAdj/Prop. Sub. Adj

    S/SN
    &
    inference%
    inferencemboxestáN/V
    &
    inference%
    inferencemboxambientadaN

    Attrib/SAdj
    &
    inference%
    inferencemboxenE
    &
    inference%
    inferencemboxAustraliaN

    T/SN

    CCL/SPrep

    PN/SV

    OP

    enddocument


    Tree






    share|improve this answer















    For example:



    documentclassstandalone
    usepackage[inference]semantic
    usepackage[utf8]inputenc
    usepackage[T1]fontenc

    begindocument

    setpremisesend0pt
    setpremisesspace1pt
    setnamespace0pt
    inference%
    inference%
    inferencemboxLaDet
    &
    inferencemboxnovelaN/Sust
    &
    inference%
    inference%
    inferencemboxquenexo
    &
    inferencemboxmeCI/SN
    &
    inferencemboxha regaladoN/V

    PV/SV
    &
    inference%
    inferencemboxmiDet
    &
    inferencemboxhermanaN

    S/SN

    CN/SAdj/Prop. Sub. Adj

    S/SN
    &
    inference%
    inferencemboxestáN/V
    &
    inference%
    inferencemboxambientadaN

    Attrib/SAdj
    &
    inference%
    inferencemboxenE
    &
    inference%
    inferencemboxAustraliaN

    T/SN

    CCL/SPrep

    PN/SV

    OP

    enddocument


    Tree







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Apr 20 '14 at 1:17

























    answered Apr 19 '14 at 22:22









    cfrcfr

    158k8191391




    158k8191391












    • I have absolutely no idea what exactly the OP wants, or how semantic works, but it seems to me a key part is that the lines are the same length as the word(s) they refer to, and yours don't seem to have that. Is that adjustable?

      – Jānis Lazovskis
      Apr 20 '14 at 0:30











    • I mean the words in the sentence above the picture, for example "nexo" refers to "que", "CI/SN" to "me", "N/V" to "ha regalado" and "PV/SV" to "que me ha regalado". You haven't included the sentence in your answer, even though the lines more or less line up with the words they refer to. I'm just under the impression that the lines being the same length as the words is key, since this is a linguistics question and the words below seem to describe parts of the sentence above.

      – Jānis Lazovskis
      Apr 20 '14 at 1:06











    • @JānisL Yes. Sorry. I deleted my comment because I realised what you meant. I am not sure you can (straightforwardly) do that with semantic but you can put the words right above the relevant analysis (see edit) so that it is obvious what goes with what. This is the way semantic is used on the LaTeX for Linguists site and this option looked like the closest match to the image the OP posted. Another possibility would be to adapt a package intended for typesetting similar kinds of proofs in formal logic. (bussproofs is maybe the best known.) But this seemed a little more promising here...

      – cfr
      Apr 20 '14 at 1:22











    • prftree might be a better option, now.

      – cfr
      Apr 13 '15 at 1:50











    • Is there any way to get one of those packages (semantic, bussproofs, prftree) to align the uppermost row at the top together?

      – hftf
      Apr 13 '15 at 15:51

















    • I have absolutely no idea what exactly the OP wants, or how semantic works, but it seems to me a key part is that the lines are the same length as the word(s) they refer to, and yours don't seem to have that. Is that adjustable?

      – Jānis Lazovskis
      Apr 20 '14 at 0:30











    • I mean the words in the sentence above the picture, for example "nexo" refers to "que", "CI/SN" to "me", "N/V" to "ha regalado" and "PV/SV" to "que me ha regalado". You haven't included the sentence in your answer, even though the lines more or less line up with the words they refer to. I'm just under the impression that the lines being the same length as the words is key, since this is a linguistics question and the words below seem to describe parts of the sentence above.

      – Jānis Lazovskis
      Apr 20 '14 at 1:06











    • @JānisL Yes. Sorry. I deleted my comment because I realised what you meant. I am not sure you can (straightforwardly) do that with semantic but you can put the words right above the relevant analysis (see edit) so that it is obvious what goes with what. This is the way semantic is used on the LaTeX for Linguists site and this option looked like the closest match to the image the OP posted. Another possibility would be to adapt a package intended for typesetting similar kinds of proofs in formal logic. (bussproofs is maybe the best known.) But this seemed a little more promising here...

      – cfr
      Apr 20 '14 at 1:22











    • prftree might be a better option, now.

      – cfr
      Apr 13 '15 at 1:50











    • Is there any way to get one of those packages (semantic, bussproofs, prftree) to align the uppermost row at the top together?

      – hftf
      Apr 13 '15 at 15:51
















    I have absolutely no idea what exactly the OP wants, or how semantic works, but it seems to me a key part is that the lines are the same length as the word(s) they refer to, and yours don't seem to have that. Is that adjustable?

    – Jānis Lazovskis
    Apr 20 '14 at 0:30





    I have absolutely no idea what exactly the OP wants, or how semantic works, but it seems to me a key part is that the lines are the same length as the word(s) they refer to, and yours don't seem to have that. Is that adjustable?

    – Jānis Lazovskis
    Apr 20 '14 at 0:30













    I mean the words in the sentence above the picture, for example "nexo" refers to "que", "CI/SN" to "me", "N/V" to "ha regalado" and "PV/SV" to "que me ha regalado". You haven't included the sentence in your answer, even though the lines more or less line up with the words they refer to. I'm just under the impression that the lines being the same length as the words is key, since this is a linguistics question and the words below seem to describe parts of the sentence above.

    – Jānis Lazovskis
    Apr 20 '14 at 1:06





    I mean the words in the sentence above the picture, for example "nexo" refers to "que", "CI/SN" to "me", "N/V" to "ha regalado" and "PV/SV" to "que me ha regalado". You haven't included the sentence in your answer, even though the lines more or less line up with the words they refer to. I'm just under the impression that the lines being the same length as the words is key, since this is a linguistics question and the words below seem to describe parts of the sentence above.

    – Jānis Lazovskis
    Apr 20 '14 at 1:06













    @JānisL Yes. Sorry. I deleted my comment because I realised what you meant. I am not sure you can (straightforwardly) do that with semantic but you can put the words right above the relevant analysis (see edit) so that it is obvious what goes with what. This is the way semantic is used on the LaTeX for Linguists site and this option looked like the closest match to the image the OP posted. Another possibility would be to adapt a package intended for typesetting similar kinds of proofs in formal logic. (bussproofs is maybe the best known.) But this seemed a little more promising here...

    – cfr
    Apr 20 '14 at 1:22





    @JānisL Yes. Sorry. I deleted my comment because I realised what you meant. I am not sure you can (straightforwardly) do that with semantic but you can put the words right above the relevant analysis (see edit) so that it is obvious what goes with what. This is the way semantic is used on the LaTeX for Linguists site and this option looked like the closest match to the image the OP posted. Another possibility would be to adapt a package intended for typesetting similar kinds of proofs in formal logic. (bussproofs is maybe the best known.) But this seemed a little more promising here...

    – cfr
    Apr 20 '14 at 1:22













    prftree might be a better option, now.

    – cfr
    Apr 13 '15 at 1:50





    prftree might be a better option, now.

    – cfr
    Apr 13 '15 at 1:50













    Is there any way to get one of those packages (semantic, bussproofs, prftree) to align the uppermost row at the top together?

    – hftf
    Apr 13 '15 at 15:51





    Is there any way to get one of those packages (semantic, bussproofs, prftree) to align the uppermost row at the top together?

    – hftf
    Apr 13 '15 at 15:51











    3














    Here's a different way... based on my answer at Highlighting text through stacked colored underlines



    documentclassarticle
    usepackagestackengine
    newlengthtmpln
    newlengthlunderset
    newlengthrulethick
    lunderset=1baselineskiprelax
    rulethick=.8ptrelax
    defstackalignmentl
    newcommandnunderline[3][1]setbox0=hbox#2tmpln=wd0%
    stackunder[#1lunderset-rulethick]strut#2%
    smashraisebox-.6baselineskipmakebox[0pt][l]scriptsize #3%
    ruletmplnrulethick%
    letNunnunderline
    letHShspace
    begindocument
    NunNunNun[3]LaDet%
    NunNun[4] %
    NunNunNun[3]novelaN/Sust%
    NunNun[4] %
    NunNunNunNunNun queitshape nexo%
    NunNunNunNun[2] %
    NunNunNunNunNun meCI/SN%
    NunNunNunNun[2] PV/SVCN/SAdj/Prop. Sub. AdjS/SN%
    NunNunNunNunNun ha%
    NunNunNunNunNun %
    NunNunNunNunNun regaladoN/V%
    NunNunNun[3] %
    NunNunNunNunNun miDet%
    NunNunNunNun[2] %
    NunNunNunNunNun hermanaHS5exNS/SNOP%
    Nun[5] %
    NunNunNun[3]est'aN/V%
    NunNun[4] %
    NunNunNunNun[2]ambientadaHS7exNAttrib/SAdjHS7exPN/SV%
    NunNun[4] %
    NunNunNunNun[2]enEHS4exCCL/SPrep%
    NunNunNun[3] %
    NunNunNunNunNun AustraliaHS6exNHS3exT/SN%
    enddocument


    enter image description here






    share|improve this answer





























      3














      Here's a different way... based on my answer at Highlighting text through stacked colored underlines



      documentclassarticle
      usepackagestackengine
      newlengthtmpln
      newlengthlunderset
      newlengthrulethick
      lunderset=1baselineskiprelax
      rulethick=.8ptrelax
      defstackalignmentl
      newcommandnunderline[3][1]setbox0=hbox#2tmpln=wd0%
      stackunder[#1lunderset-rulethick]strut#2%
      smashraisebox-.6baselineskipmakebox[0pt][l]scriptsize #3%
      ruletmplnrulethick%
      letNunnunderline
      letHShspace
      begindocument
      NunNunNun[3]LaDet%
      NunNun[4] %
      NunNunNun[3]novelaN/Sust%
      NunNun[4] %
      NunNunNunNunNun queitshape nexo%
      NunNunNunNun[2] %
      NunNunNunNunNun meCI/SN%
      NunNunNunNun[2] PV/SVCN/SAdj/Prop. Sub. AdjS/SN%
      NunNunNunNunNun ha%
      NunNunNunNunNun %
      NunNunNunNunNun regaladoN/V%
      NunNunNun[3] %
      NunNunNunNunNun miDet%
      NunNunNunNun[2] %
      NunNunNunNunNun hermanaHS5exNS/SNOP%
      Nun[5] %
      NunNunNun[3]est'aN/V%
      NunNun[4] %
      NunNunNunNun[2]ambientadaHS7exNAttrib/SAdjHS7exPN/SV%
      NunNun[4] %
      NunNunNunNun[2]enEHS4exCCL/SPrep%
      NunNunNun[3] %
      NunNunNunNunNun AustraliaHS6exNHS3exT/SN%
      enddocument


      enter image description here






      share|improve this answer



























        3












        3








        3







        Here's a different way... based on my answer at Highlighting text through stacked colored underlines



        documentclassarticle
        usepackagestackengine
        newlengthtmpln
        newlengthlunderset
        newlengthrulethick
        lunderset=1baselineskiprelax
        rulethick=.8ptrelax
        defstackalignmentl
        newcommandnunderline[3][1]setbox0=hbox#2tmpln=wd0%
        stackunder[#1lunderset-rulethick]strut#2%
        smashraisebox-.6baselineskipmakebox[0pt][l]scriptsize #3%
        ruletmplnrulethick%
        letNunnunderline
        letHShspace
        begindocument
        NunNunNun[3]LaDet%
        NunNun[4] %
        NunNunNun[3]novelaN/Sust%
        NunNun[4] %
        NunNunNunNunNun queitshape nexo%
        NunNunNunNun[2] %
        NunNunNunNunNun meCI/SN%
        NunNunNunNun[2] PV/SVCN/SAdj/Prop. Sub. AdjS/SN%
        NunNunNunNunNun ha%
        NunNunNunNunNun %
        NunNunNunNunNun regaladoN/V%
        NunNunNun[3] %
        NunNunNunNunNun miDet%
        NunNunNunNun[2] %
        NunNunNunNunNun hermanaHS5exNS/SNOP%
        Nun[5] %
        NunNunNun[3]est'aN/V%
        NunNun[4] %
        NunNunNunNun[2]ambientadaHS7exNAttrib/SAdjHS7exPN/SV%
        NunNun[4] %
        NunNunNunNun[2]enEHS4exCCL/SPrep%
        NunNunNun[3] %
        NunNunNunNunNun AustraliaHS6exNHS3exT/SN%
        enddocument


        enter image description here






        share|improve this answer















        Here's a different way... based on my answer at Highlighting text through stacked colored underlines



        documentclassarticle
        usepackagestackengine
        newlengthtmpln
        newlengthlunderset
        newlengthrulethick
        lunderset=1baselineskiprelax
        rulethick=.8ptrelax
        defstackalignmentl
        newcommandnunderline[3][1]setbox0=hbox#2tmpln=wd0%
        stackunder[#1lunderset-rulethick]strut#2%
        smashraisebox-.6baselineskipmakebox[0pt][l]scriptsize #3%
        ruletmplnrulethick%
        letNunnunderline
        letHShspace
        begindocument
        NunNunNun[3]LaDet%
        NunNun[4] %
        NunNunNun[3]novelaN/Sust%
        NunNun[4] %
        NunNunNunNunNun queitshape nexo%
        NunNunNunNun[2] %
        NunNunNunNunNun meCI/SN%
        NunNunNunNun[2] PV/SVCN/SAdj/Prop. Sub. AdjS/SN%
        NunNunNunNunNun ha%
        NunNunNunNunNun %
        NunNunNunNunNun regaladoN/V%
        NunNunNun[3] %
        NunNunNunNunNun miDet%
        NunNunNunNun[2] %
        NunNunNunNunNun hermanaHS5exNS/SNOP%
        Nun[5] %
        NunNunNun[3]est'aN/V%
        NunNun[4] %
        NunNunNunNun[2]ambientadaHS7exNAttrib/SAdjHS7exPN/SV%
        NunNun[4] %
        NunNunNunNun[2]enEHS4exCCL/SPrep%
        NunNunNun[3] %
        NunNunNunNunNun AustraliaHS6exNHS3exT/SN%
        enddocument


        enter image description here







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Apr 13 '17 at 12:36









        Community

        1




        1










        answered Apr 20 '14 at 16:38









        Steven B. SegletesSteven B. Segletes

        160k9204413




        160k9204413





















            2














            For completeness, and in partial response to a query in the comments on my other answer, here is the tree set with prftree. As can be seen, this no more lends itself to typesetting this kind of tree than semantic. If anybody wants to typeset natural deduction proofs of this kind for logic, though, it looks like a really nice package with a lot of convenience commands, flexible customisation and a nice syntax. The tree here is very verbose because none of the convenience commands are appropriate: this is definitely a package intended for symbolic logic. The result is very, very slightly closer to the target tree in some ways than with semantic but the improvement is marginal, at best, and the result is even further from the target in other aspects.



            My conclusion is that none of bussproofs, semantic and prftree are well-suited to typesetting this kind of tree. The forest and stackengine solutions are definitely superior relative to the question desiderata.



            However, for logic, these package are superior to the other solutions offered here. They are designed for that purpose and will produce trees more easily and with less hassle. prftree looks especially good, even though this is the first time I've used it. The alignments and spacings are designed to work correctly out-of-the-box for logic, and prftree allows you to specify the tree using standard rules of inference, which makes it more readable, less verbose and more intuitive. My conclusion above is not, therefore, intended as a criticism of these packages. They just aren't designed for this sort of tree.



            documentclass[landscape]article
            usepackage[utf8]inputenc
            usepackage[T1]fontenc
            usepackageprftree,geometry,mathtools
            begindocument

            [
            prftree%
            prftree%
            prftreetextLaDet
            %
            prftreetextnovelaN/Sust
            %
            prftree%
            prftree%
            prftreetextquenexo
            %
            prftreetextmeCI/SN
            %
            prftreetextha regaladoN/V

            PV/SV
            %
            prftree%
            prftreetextmiDet
            %
            prftreetexthermanaN
            S/SN

            CN/SAdj/Prop. Sub. Adj

            S/SN

            prftree%
            prftreetextestáN/V
            %
            prftree%
            prftreetextambientadaN

            Attrib/SAdj
            %
            prftree%
            prftreetextenE
            %
            prftree%
            prftreetextAustraliaN

            T/SN

            CCL/SPrep

            PN/SV

            OP
            ]

            enddocument


            <code>prftree</code> proof






            share|improve this answer

























            • Another thing is that they all seem to default to math mode :o)

              – hftf
              Apr 14 '15 at 14:40











            • @hftf Again, given their purpose, that makes sense ;).

              – cfr
              Apr 14 '15 at 16:56











            • @cfr cannot you force the main sentence vertical alignment?

              – JFernan
              2 hours ago















            2














            For completeness, and in partial response to a query in the comments on my other answer, here is the tree set with prftree. As can be seen, this no more lends itself to typesetting this kind of tree than semantic. If anybody wants to typeset natural deduction proofs of this kind for logic, though, it looks like a really nice package with a lot of convenience commands, flexible customisation and a nice syntax. The tree here is very verbose because none of the convenience commands are appropriate: this is definitely a package intended for symbolic logic. The result is very, very slightly closer to the target tree in some ways than with semantic but the improvement is marginal, at best, and the result is even further from the target in other aspects.



            My conclusion is that none of bussproofs, semantic and prftree are well-suited to typesetting this kind of tree. The forest and stackengine solutions are definitely superior relative to the question desiderata.



            However, for logic, these package are superior to the other solutions offered here. They are designed for that purpose and will produce trees more easily and with less hassle. prftree looks especially good, even though this is the first time I've used it. The alignments and spacings are designed to work correctly out-of-the-box for logic, and prftree allows you to specify the tree using standard rules of inference, which makes it more readable, less verbose and more intuitive. My conclusion above is not, therefore, intended as a criticism of these packages. They just aren't designed for this sort of tree.



            documentclass[landscape]article
            usepackage[utf8]inputenc
            usepackage[T1]fontenc
            usepackageprftree,geometry,mathtools
            begindocument

            [
            prftree%
            prftree%
            prftreetextLaDet
            %
            prftreetextnovelaN/Sust
            %
            prftree%
            prftree%
            prftreetextquenexo
            %
            prftreetextmeCI/SN
            %
            prftreetextha regaladoN/V

            PV/SV
            %
            prftree%
            prftreetextmiDet
            %
            prftreetexthermanaN
            S/SN

            CN/SAdj/Prop. Sub. Adj

            S/SN

            prftree%
            prftreetextestáN/V
            %
            prftree%
            prftreetextambientadaN

            Attrib/SAdj
            %
            prftree%
            prftreetextenE
            %
            prftree%
            prftreetextAustraliaN

            T/SN

            CCL/SPrep

            PN/SV

            OP
            ]

            enddocument


            <code>prftree</code> proof






            share|improve this answer

























            • Another thing is that they all seem to default to math mode :o)

              – hftf
              Apr 14 '15 at 14:40











            • @hftf Again, given their purpose, that makes sense ;).

              – cfr
              Apr 14 '15 at 16:56











            • @cfr cannot you force the main sentence vertical alignment?

              – JFernan
              2 hours ago













            2












            2








            2







            For completeness, and in partial response to a query in the comments on my other answer, here is the tree set with prftree. As can be seen, this no more lends itself to typesetting this kind of tree than semantic. If anybody wants to typeset natural deduction proofs of this kind for logic, though, it looks like a really nice package with a lot of convenience commands, flexible customisation and a nice syntax. The tree here is very verbose because none of the convenience commands are appropriate: this is definitely a package intended for symbolic logic. The result is very, very slightly closer to the target tree in some ways than with semantic but the improvement is marginal, at best, and the result is even further from the target in other aspects.



            My conclusion is that none of bussproofs, semantic and prftree are well-suited to typesetting this kind of tree. The forest and stackengine solutions are definitely superior relative to the question desiderata.



            However, for logic, these package are superior to the other solutions offered here. They are designed for that purpose and will produce trees more easily and with less hassle. prftree looks especially good, even though this is the first time I've used it. The alignments and spacings are designed to work correctly out-of-the-box for logic, and prftree allows you to specify the tree using standard rules of inference, which makes it more readable, less verbose and more intuitive. My conclusion above is not, therefore, intended as a criticism of these packages. They just aren't designed for this sort of tree.



            documentclass[landscape]article
            usepackage[utf8]inputenc
            usepackage[T1]fontenc
            usepackageprftree,geometry,mathtools
            begindocument

            [
            prftree%
            prftree%
            prftreetextLaDet
            %
            prftreetextnovelaN/Sust
            %
            prftree%
            prftree%
            prftreetextquenexo
            %
            prftreetextmeCI/SN
            %
            prftreetextha regaladoN/V

            PV/SV
            %
            prftree%
            prftreetextmiDet
            %
            prftreetexthermanaN
            S/SN

            CN/SAdj/Prop. Sub. Adj

            S/SN

            prftree%
            prftreetextestáN/V
            %
            prftree%
            prftreetextambientadaN

            Attrib/SAdj
            %
            prftree%
            prftreetextenE
            %
            prftree%
            prftreetextAustraliaN

            T/SN

            CCL/SPrep

            PN/SV

            OP
            ]

            enddocument


            <code>prftree</code> proof






            share|improve this answer















            For completeness, and in partial response to a query in the comments on my other answer, here is the tree set with prftree. As can be seen, this no more lends itself to typesetting this kind of tree than semantic. If anybody wants to typeset natural deduction proofs of this kind for logic, though, it looks like a really nice package with a lot of convenience commands, flexible customisation and a nice syntax. The tree here is very verbose because none of the convenience commands are appropriate: this is definitely a package intended for symbolic logic. The result is very, very slightly closer to the target tree in some ways than with semantic but the improvement is marginal, at best, and the result is even further from the target in other aspects.



            My conclusion is that none of bussproofs, semantic and prftree are well-suited to typesetting this kind of tree. The forest and stackengine solutions are definitely superior relative to the question desiderata.



            However, for logic, these package are superior to the other solutions offered here. They are designed for that purpose and will produce trees more easily and with less hassle. prftree looks especially good, even though this is the first time I've used it. The alignments and spacings are designed to work correctly out-of-the-box for logic, and prftree allows you to specify the tree using standard rules of inference, which makes it more readable, less verbose and more intuitive. My conclusion above is not, therefore, intended as a criticism of these packages. They just aren't designed for this sort of tree.



            documentclass[landscape]article
            usepackage[utf8]inputenc
            usepackage[T1]fontenc
            usepackageprftree,geometry,mathtools
            begindocument

            [
            prftree%
            prftree%
            prftreetextLaDet
            %
            prftreetextnovelaN/Sust
            %
            prftree%
            prftree%
            prftreetextquenexo
            %
            prftreetextmeCI/SN
            %
            prftreetextha regaladoN/V

            PV/SV
            %
            prftree%
            prftreetextmiDet
            %
            prftreetexthermanaN
            S/SN

            CN/SAdj/Prop. Sub. Adj

            S/SN

            prftree%
            prftreetextestáN/V
            %
            prftree%
            prftreetextambientadaN

            Attrib/SAdj
            %
            prftree%
            prftreetextenE
            %
            prftree%
            prftreetextAustraliaN

            T/SN

            CCL/SPrep

            PN/SV

            OP
            ]

            enddocument


            <code>prftree</code> proof







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Apr 13 '17 at 12:35









            Community

            1




            1










            answered Apr 14 '15 at 14:28









            cfrcfr

            158k8191391




            158k8191391












            • Another thing is that they all seem to default to math mode :o)

              – hftf
              Apr 14 '15 at 14:40











            • @hftf Again, given their purpose, that makes sense ;).

              – cfr
              Apr 14 '15 at 16:56











            • @cfr cannot you force the main sentence vertical alignment?

              – JFernan
              2 hours ago

















            • Another thing is that they all seem to default to math mode :o)

              – hftf
              Apr 14 '15 at 14:40











            • @hftf Again, given their purpose, that makes sense ;).

              – cfr
              Apr 14 '15 at 16:56











            • @cfr cannot you force the main sentence vertical alignment?

              – JFernan
              2 hours ago
















            Another thing is that they all seem to default to math mode :o)

            – hftf
            Apr 14 '15 at 14:40





            Another thing is that they all seem to default to math mode :o)

            – hftf
            Apr 14 '15 at 14:40













            @hftf Again, given their purpose, that makes sense ;).

            – cfr
            Apr 14 '15 at 16:56





            @hftf Again, given their purpose, that makes sense ;).

            – cfr
            Apr 14 '15 at 16:56













            @cfr cannot you force the main sentence vertical alignment?

            – JFernan
            2 hours ago





            @cfr cannot you force the main sentence vertical alignment?

            – JFernan
            2 hours ago

















            draft saved

            draft discarded
















































            Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f172415%2fupside-down-syntax-trees-for-linguistics-with-horizontal-lines%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Isabella Eugénie Boyer Biographie | Références | Menu de navigationmodifiermodifier le codeComparator to Compute the Relative Value of a U.S. Dollar Amount – 1774 to Present.

            Lioubotyn Sommaire Géographie | Histoire | Population | Notes et références | Liens externes | Menu de navigationlubotin.kharkov.uamodifier« Recensements et estimations de la population depuis 1897 »« Office des statistiques d'Ukraine : population au 1er janvier 2010, 2011 et 2012 »« Office des statistiques d'Ukraine : population au 1er janvier 2011, 2012 et 2013 »Informations officiellesCartes topographiquesCarte routièrem

            Mpande kaSenzangakhona Biographie | Références | Menu de navigationmodifierMpande kaSenzangakhonavoir la liste des auteursm