## LaTeX forum ⇒ Graphics, Figures & Tables ⇒ Label Alignment in ER Diagram Topic is solved

Information and discussion about graphics, figures & tables in LaTeX documents.
c_d_hofer
Posts: 3
Joined: Tue Oct 29, 2013 12:07 pm

### Label Alignment in ER Diagram

Hi community!

I want to make an ER diagram using TikZ with its er library. Unfortunately I have a problem with the alignment of the node labels.

The label seems to use a different alignment than the node, i.e. the label is some units right of the place it supposed to be, and even not in the node. Here is my code:
\documentclass[11pt]{article}\usepackage[T1]{fontenc}\usepackage{tikz}\usetikzlibrary{er} \begin{document}   \tikzstyle{every entity} = [draw=blue, fill=blue!20]   \begin{tikzpicture}     \node[entity] (person) {Person};   \end{tikzpicture}\end{document}

I have already completely reinstalled LaTeX but it didn't work out. Thank you so far and I hope you can help me with this task.
Last edited by c_d_hofer on Tue Oct 29, 2013 12:39 pm, edited 1 time in total.

Tags:

Johannes_B
Site Moderator
Posts: 4109
Joined: Thu Nov 01, 2012 4:08 pm
Good minimal example, but i am not sure what you are trying to achieve. Please click on "Open in writeLaTeX" just above the code you posted to see the output.

Is your TeX distribution (TeX Live oder MiKTeX) up to date?
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

c_d_hofer
Posts: 3
Joined: Tue Oct 29, 2013 12:07 pm
Thank you for the quick response!

Okay, that's weird. The "Open in writeLaTeX" compiles the code just fine and shows exactly what I want to have. When I compile it on my machine, the label is moved to the right for some units. But this holds only for the DVI file. When I convert the DVI to PDF the output is just fine again.

Since I will work with the PDF it seems that I have no actual problem at all, although I never have experienced that the DVI is different to the converted PDF.

By the way, I have installed "texlive-full" from the Ubuntu repository.

Johannes_B
Site Moderator
Posts: 4109
Joined: Thu Nov 01, 2012 4:08 pm
The DVI format isn't actually meant to be viewed. Convert to PDF using dvips and ps2pdf or dvipdfmx, or use pdflatex in the first place.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

c_d_hofer
Posts: 3
Joined: Tue Oct 29, 2013 12:07 pm
Thanks for the tip. From now on I will use pdfLaTeX. So far I have only done a lot of mathematical stuff and obviously have misused the DVI format as preview since it is the output format of the "latex" command. Until now I never had problems with this approach. Allright, so I learned something new (for the price of shooting down twice my work environment )