Text FormattingTrees and tikZ

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
revberaldo
Posts: 9
Joined: Sat Feb 13, 2010 3:37 pm

Trees and tikZ

Post by revberaldo »

Hello,

Is there a way to easily reproduce this?

Thank you in advance.


EDIT: I've found Tikz package and now I'm trying to use it. Take a loot at this message (in this very topic) to see my new doubts.
Attachments
reproduzir.png
reproduzir.png (16.9 KiB) Viewed 4334 times
Last edited by revberaldo on Sat May 15, 2010 5:22 pm, edited 3 times in total.
Blog (in Portuguese)
Twitter (almost completely in Portuguese, eventually in English or Esperanto)

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

CrazyHorse
Posts: 351
Joined: Sat Aug 02, 2008 8:47 am

Trees and tikZ

Post by CrazyHorse »

revberaldo wrote: Is there a way to easyly reproduce this?
see http://tug.org/PSTricks/main.cgi?file=pst-tree/pst-tree
and http://mirror.ctan.org/graphics/pstrick ... /pst-tree/
for the package documentation

Herbert
revberaldo
Posts: 9
Joined: Sat Feb 13, 2010 3:37 pm

Trees and tikZ

Post by revberaldo »

I took a look at pst-tree but then I found Tikz. Anyway, the output isn't what I was expecting.

My code:

Code: Select all

\documentclass[11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[frenchb,brazilian]{babel}
\usepackage[osf]{libertine}
\usepackage{tikz}
\usetikzlibrary{trees,arrows,positioning}

\begin{document}

\begin{tikzpicture}[grow=right]
  \node {\textsc{Relações Sociais}}
    child {node {Pirâmide social}}
    child {node {Trapézio (hierarquia, cargos, patentes)}}
    child {node {Status como suprema missão}}
    child {node {Olhar moralista}
  };
\end{tikzpicture}

\end{document}
An image of the output is attached.

Also, is there a way to invert the nodes position, so that ``Pirâmide social'' would be the first one to appear and so on?
Attachments
trees.png
trees.png (27.88 KiB) Viewed 4324 times
Blog (in Portuguese)
Twitter (almost completely in Portuguese, eventually in English or Esperanto)
torbjorn t.
Posts: 162
Joined: Wed Jun 17, 2009 10:18 pm

Trees and tikZ

Post by torbjorn t. »

revberaldo wrote:Also, is there a way to invert the nodes position, so that ``Pirâmide social'' would be the first one to appear and so on?
You can simply reverse the order of the nodes in the code.

Here I've also changed the distance between the nodes, to get a better result.

Code: Select all

\documentclass[11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[frenchb,brazilian]{babel}
\usepackage[osf]{libertine}
\usepackage{tikz}
\usetikzlibrary{trees,arrows,positioning}

\begin{document}

\begin{tikzpicture}[grow=right,level distance=8em,sibling distance=2em,every node/.style={right}]
  \node {\textsc{Relações Sociais}}
    child {node {Olhar moralista}}
    child {node {Status como suprema missão}}
    child {node {Trapézio (hierarquia, cargos, patentes)}}
    child {node {Pirâmide social}};
\end{tikzpicture}

\end{document}
Edit: Fixed a typo.
revberaldo
Posts: 9
Joined: Sat Feb 13, 2010 3:37 pm

Re: Trees and tikZ

Post by revberaldo »

Hey!,

That works pretty well. I'm satisfied with the output.

Thank you!
Blog (in Portuguese)
Twitter (almost completely in Portuguese, eventually in English or Esperanto)
Post Reply