I'm not sure how you are trying to attach files, but it doesn't seem to be
working, so I'm going to try to see if I understand what you want. But I
think the best thing is to work out with a generic example and then you can
apply it to your particular tableau.

First, let us start with a complete binary tree with two levels of depth:

\begin{tikzpicture}
\node {A}
child {node {A1}
 child {node {A11}}
 child {node {A12}}}
child {node {A2}
 child {node {A21}}
 child {node {A22}}};
\end{tikzpicture}

As you see, the root is introduced with the first "\node", and each subtree
is introduced with "child { ... }". The root of a subtree is the first
"node" in it: "child { node {B} ... }". Additional sub-subtrees follow the
same syntax, with "child" immediately after the node: "child { node {B}
child { node {C} ... } ...". The structure of the text has the same
structure of the tree you are trying to write.

If you try the example above you'll see that nodes A12 and A21 overlap.
This can be fixed by setting a separation between siblings in each level,
by providing some options at the top, as follows:

\begin{tikzpicture}
[level 1/.style={sibling distance=2cm},
 level 2/.style={sibling distance=1cm}]
\node {A}
child {node {A1}
 child {node {A11}}
 child {node {A12}}}
child {node {A2}
 child {node {A21}}
 child {node {A22}}};
\end{tikzpicture}

Now, you can also make the tree "grow" in other directions, by adding
"[grow=<direction>]" after the root, where direction can be for example
"up", "down", "left" or "right". For example:

\begin{tikzpicture}
[level 1/.style={sibling distance=2cm},
 level 2/.style={sibling distance=1cm}]
\node {A} [grow=right]
child {node {A1}
 child {node {A11}}
 child {node {A12}}}
child {node {A2}
 child {node {A21}}
 child {node {A22}}};
\end{tikzpicture}

Now, you can modify some edges by adding options to specific branches with
the following syntax "child [<options>] { ... }". Options available include
"dashed", "dotted", "thick", "thin", "very thick", "very thin", "red",
"blue", "green", ..., and even arrow heads such as "->", "->>", and more
fancy styles like: "|->" or ">>->>" For example:

\begin{tikzpicture}
[level 1/.style={sibling distance=2cm},
 level 2/.style={sibling distance=1cm}]
\node {A} [grow=right]
child {node {A1}
 child {node {A11}}
 child [dotted] {node {A12}}}
child {node {A2}
 child [dashed, thick, blue, |->] {node {A21}}
 child {node {A22}}};
\end{tikzpicture}

So one possibility is to draw edges with the same colour as the background,
typically "white". But, this is not necessarity good, and if instead of
having an edge with a different style, you want no edge at all, then the
syntax is a bit different: "child {node {X} edge from parent[draw=none] ...
}". For example:

\begin{tikzpicture}
[level 1/.style={sibling distance=2cm},
 level 2/.style={sibling distance=1cm}]
\node {A} [grow=right]
child {node {A1} edge from parent[draw=none]
 child {node {A11}}
 child {node {A12}}}
child {node {A2}
 child {node {A21} edge from parent[draw=none]}
 child {node {A22}}};
\end{tikzpicture}

And of course, remember the [missing] option to get rid of children:

\begin{tikzpicture}
[level 1/.style={sibling distance=2cm},
 level 2/.style={sibling distance=1cm}]
\node {A} [grow=right]
child {node {A1} edge from parent[draw=none]
 child {node {A11}}
 child {node {A12}}}
child {node {A2}
 child {node {A21} edge from parent[draw=none]}
 child [missing] {node {A22}}};
\end{tikzpicture}


Finally, you can replace the node's text A, A11, etc. with whatever you
want. In particular, in LaTeX, formulae are written in "math mode", which
goes inside $...$.

If this doesn't help you might want to try again attaching the file to the
message.



On Tue, Oct 29, 2013 at 10:53 AM, William Hanson <whan...@umn.edu> wrote:

> Well, that didn't work either.  Sorry for the big message with all the
> junk.  I hope some of you will be able to open the attachment.
>
> Bill
>
>
> On Tue, Oct 29, 2013 at 9:49 AM, William Hanson <whan...@umn.edu> wrote:
>
>> Dear All,
>>
>> Many thanks to Ernesto Posse for the very detailed and helpful response.
>> However, what I'm trying to do is eliminate *all* the lines between
>> nodes *except* those that indicate a genuine branching of the tree.  In
>> other words, I want the overall structure of the tree to look like the
>> following (which I tried to attach to my previous messages, but which
>> apparently could not be opened).  As usual, any and all help is appreciated.
>>
>> Bill
>>
>>
>>
>>
>>
>>
>> On Mon, Oct 28, 2013 at 3:45 PM, Ernesto Posse <epo...@cs.queensu.ca>wrote:
>>
>>> I'm unable to see your attachment, but if I understand what you want,
>>> the simplest approach is to create "phantom" nodes in the tree. This can be
>>> achieved with "child [missing]" as in the following examples:
>>>
>>> First, a simple tree with two nodes: A and B; A is the root, and B is
>>> directly below it:
>>>
>>> \begin{tikzpicture}
>>>
>>> \node {A}
>>>
>>>        child {node {B}};
>>>
>>> \end{tikzpicture}
>>>
>>> Then with node B towards the left:
>>>
>>> \begin{tikzpicture}
>>>
>>> \node {A}
>>>
>>>        child {node {B}}
>>>
>>>        child [missing];
>>>
>>> \end{tikzpicture}
>>>
>>> and now, with B towards the right:
>>>
>>> \begin{tikzpicture}
>>>
>>> \node {A}
>>>        child [missing]
>>>
>>>        child {node {B}};
>>>
>>> \end{tikzpicture}
>>>
>>> Now, with your example (I changed the numbers in the nodes, for
>>> reference):
>>>
>>> \begin{tikzpicture}
>>>
>>> \node {$1.~\neg ((p \lor (p \land q)) \limp p)$}
>>>
>>>        child {node {$2.~ p \lor (p \land q)$}
>>>
>>>               child [missing]
>>>
>>>               child {node {$3.~ \neg p $}
>>>
>>>                      child {node {$4.~ \ p $}}
>>>
>>>                      child {node {$5.~ p \land q$}
>>>
>>>                             child [missing]
>>>
>>>                             child {node {$6.~ p $}
>>>
>>>                                    child {node {$7.~ q $}}
>>>
>>>                                    child [missing]}}}}
>>>
>>>        child [missing];
>>>
>>> \end{tikzpicture}
>>>
>>>
>>> As indicated in the examples above, the position of the "child
>>> [missing]" relative to its siblings determines where you get the child
>>> nodes. Of course you can also add any number of missing children, which
>>> increases the angle:
>>>
>>>
>>> \begin{tikzpicture}
>>>
>>> \node {A}
>>>        child [missing]
>>>        child [missing]
>>>
>>>        child {node {B}};
>>>
>>> \end{tikzpicture}
>>>
>>> Furthermore, you can control the distance between sibling nodes:
>>>
>>> \begin{tikzpicture}[sibling distance=4cm]
>>>
>>> \node {A}
>>>
>>>        child {node {B}}
>>>
>>>        child {node {C}};
>>>
>>> \end{tikzpicture}
>>>
>>>
>>> and even the distance between levels:
>>>
>>>
>>> \begin{tikzpicture}[sibling distance=4cm,level distance=5cm]
>>>
>>> \node {A}
>>>
>>>        child {node {B}}
>>>
>>>        child {node {C}};
>>>
>>> \end{tikzpicture}
>>>
>>>
>>> On Mon, Oct 28, 2013 at 4:06 PM, William Hanson <whan...@umn.edu> wrote:
>>>
>>>> Dear LyX Colleagues,
>>>>
>>>> I'm still trying to create tableau proofs, which are branching columns
>>>> of text, as illustrated in the attachment.
>>>>
>>>> Ernesto Posse's sample tableau (below) is helpful, but it contains two
>>>> features I don't want:
>>>>
>>>> 1.  Two sentences at a node, separated by commas.  I want just one
>>>> sentence at each node, as in the attached sample.  I've been figured out
>>>> how to solve this problem by modifying Ernesto's code as follows:
>>>>
>>>> \def\land{\wedge}
>>>> \def\lor{\vee}
>>>> \def\limp{\to}
>>>> \begin{tikzpicture}
>>>> \node {$1\neg ((p \lor (p \land q)) \limp p)$}
>>>> child {node {$ 1 p \lor (p \land q)$}
>>>> child {node {$1 \neg p $}
>>>> child {node {$1 \ p $}}
>>>> child {node {$1 p \land q$}
>>>> child {node {$1 p $}
>>>> child {node {$1 q $}}}}}};
>>>> \end{tikzpicture}
>>>>
>>>> 2.  But the foregoing code retains another feature I don't want:
>>>> vertical lines from node to node when there is no branching.  I want only
>>>> the (approximately) 45 degree (and 315 degree) lines that indicate
>>>> branching, as on the attached sample.
>>>>
>>>> I've used LyX for several years, but I don't know LaTeX.
>>>>
>>>> Any and all help appreciated.
>>>>
>>>> Bill
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> [image: Sample 
>>>> Tableau.pdf]<https://mail.google.com/mail/u/0/?ui=2&ik=fcb7343f58&view=att&th=141e0e8e8016ae7f&attid=0.1&disp=safe&realattid=f_hn3bnlm80&zw>
>>>> *Sample Tableau.pdf*
>>>> 146K   
>>>> View<https://docs.google.com/viewer?a=v&pid=gmail&attid=0.1&thid=141e0e8e8016ae7f&mt=application/pdf&authuser=0&url=https://mail.google.com/mail/u/0/?ui%3D2%26ik%3Dfcb7343f58%26view%3Datt%26th%3D141e0e8e8016ae7f%26attid%3D0.1%26disp%3Dsafe%26realattid%3Df_hn3bnlm80%26zw&sig=AHIEtbQpDR5qvKd2TSh_O5cOhrpoG-Owmg>
>>>> Download<https://mail.google.com/mail/u/0/?ui=2&ik=fcb7343f58&view=att&th=141e0e8e8016ae7f&attid=0.1&disp=safe&realattid=f_hn3bnlm80&zw>
>>>>
>>>> Ernesto Posse <epo...@cs.queensu.ca>
>>>> Oct 22 (6 days ago)
>>>>
>>>>  to me, lyx-users
>>>> Hello. The easiest (and nicest) way to do this is using the tikz
>>>> package: in the preamble put
>>>>
>>>> \usepackage{tikz}
>>>>
>>>> and then, wherever you want the tableau, put in a TeX box the following:
>>>>
>>>> \def\land{\wedge}
>>>>
>>>> \def\lor{\vee}
>>>>
>>>> \def\limp{\to}
>>>>
>>>> \begin{tikzpicture}
>>>>
>>>> \node {$\{\neg ((p \lor (p \land q)) \limp p)\}$}
>>>>
>>>>     child {node {$\{p \lor (p \land q), \neg p\}$}
>>>>
>>>>         child {node {$\{p\}$}}
>>>>
>>>>         child {node {$\{p \land q\}$}
>>>>
>>>>             child {node {$\{p,q\}$}}}};
>>>>
>>>> \end{tikzpicture}
>>>>
>>>>
>>>> Note that the structure of the tree depends on the grouping braces {
>>>> ... }.
>>>>
>>>>
>>>>  Richard Heck <rgh...@lyx.org>
>>>> Oct 22 (6 days ago)
>>>>
>>>> to Ernesto, me, lyx-users
>>>>  There are lots of useful resources about this here:
>>>>     http://www.logicmatters.net/latex-for-logicians/trees/
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>> --
>>> Ernesto Posse
>>>
>>> Modelling and Analysis in Software Engineering
>>> School of Computing
>>> Queen's University - Kingston, Ontario, Canada
>>>
>>
>>
>


-- 
Ernesto Posse

Modelling and Analysis in Software Engineering
School of Computing
Queen's University - Kingston, Ontario, Canada

Reply via email to