TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to create a LCM tree diagram which looks something like this:


Also what is the code to draw circles around numbers?

share|improve this question
Welcome to TeX.sx! – polyfunc Jan 27 '13 at 18:09
Thank you all from the bottom of my heart! I know my students will appreciate these worksheets that you guys helped designed – ElementarySchool Jan 30 '13 at 10:14

With my tikz-based package forest, this can be achieved in a very concise way:


\begin{forest} mark/.style={circle,draw=red}
share|improve this answer
+1 This forest package looks like serious business!... – Count Zero Jan 27 '13 at 21:06
@CountZero tnx! it did take a serious amount of time to write it ... :-) – Sašo Živanović Jan 27 '13 at 21:35
Congratulations and a big thank you for you contribution. Can you please add your details in here meta.tex.stackexchange.com/questions/1181/… ? You can use the proper icon for the dev-page. – percusse Jan 27 '13 at 22:25
Thanks. Added --- great idea having such a page! I didn't use the icon since forest-styles is only a style repository. – Sašo Živanović Jan 28 '13 at 0:27
@SašoŽivanović forest is indeed a very nice package. I'm wondering why you decided not to use the qtree .label syntax for node labels. I've got lots of legacy trees, so that switching to forest would take some effort. Would it be possible to support both styles? – Alan Munn Jan 28 '13 at 0:41

Tikz can do nice trees:



    \node {8} 
    child { node[circle,draw=red] {2} }
    child { node {4} 
      child { node[circle,draw=red] {2} }
      child { node[circle,draw=red] {2} }

share|improve this answer

Just to add the obligatory tikz-qtree solution:

\Tree [.8 [.\node[Red] (A){2}; ]
            [.\node [Red] (B) {2}; ]
            [.\node [Red] (C) {2};]]]

output of code

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.