# Display the Young lattice using Sage and Latex

Hi everyone,

I'm trying to follow http://doc.sagemath.org/html/en/thema... to generate pictures of Young's lattice. Unfortunately I seem to be getting LaTeX code which won't compile.

I'm using Sage 7.4 (run locally not on the cloud), pdfTeX, Version 3.1415926-2.5-1.40.14 and I have the TKZ packages installed. Running sage locally or on the cloud seems to generate the same LaTeX output. I get the same errors on 2 different computers, both running OpenSUSE 42.1. I've tried generating the LaTeX code using the sagecloud, but as far as I can tell it generates the same source code and I can't compile it.

The code I input is:

```
level = 6
elements = [b for n in range(level) for b in Partitions(n)]
ord = lambda x,y: y.contains(x)
Y = Poset((elements,ord), facade=True)
H = Y.hasse_diagram()
view(H) # optional - dot2tex graphviz
```

I'd like to attach error logs and the latex source code generated by "latex(H)", but apparently I do not have enough karma to do so. The error messages are basically many repetitions of the following snippet.

```
! Illegal parameter number in definition of \cmdGR@vertex@L.
<to be read again>
1
l.136 }$},x=1.0389cm,y=1.8082cm]{v1}
You meant to type ## instead of #, right?
Or maybe a } was forgotten somewhere earlier, and things
are all screwed up? I'm going to assume that you meant ##.
```

**Edit:** fidbc had the excellent idea of uploading my error log and latex source to pastebin, so here they are.

- Error log: http://pastebin.com/9CC2LvPr
- LaTeX code generated by sage: http://pastebin.com/Wpj7BDiq
- LaTeX code with preamble: http://pastebin.com/M1mxavNv

I am trying to compile the LaTeX code with the following packages: "tikz", "tkz-graph", "tkz-berge", "tkz-arith" and for tikz I am also loading the "arrows" and "shapes" libraries. Am I missing any necessary libraries?

Generated TikZ code works for me. Have you tried including the TikZ package in the LaTeX document preamble (

`\usepackage{tikz}`

)? Maybe posting a link to the code uploaded to some other site would be useful? Eg pastebin.Excellent advice regarding pastebin! I've edited the question accordingly.

It seems like the error arises from the labels of the nodes in the diagram, not entirely sure what is going on. Also, it should be noted that the LaTeX string returned by

`latex(H)`

when executed in cloud.sagemath is different, please see here. That output seems to compile without issues.The latex code you linked to compiles for me too. How odd, I was certain cloud.sagemath did not produce code that worked for me, yet now it does (both your code and what cloud.sagemath produce for me, work).

I wonder why my local installation of sage produces different LaTeX code.