LaTeX forum ⇒ Graphics, Figures & TablesLabel 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

Postby c_d_hofer » Tue Oct 29, 2013 12:20 pm

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:
  1. \documentclass[11pt]{article}
  2. \usepackage[T1]{fontenc}
  3. \usepackage{tikz}
  4. \usetikzlibrary{er}
  5.  
  6. \begin{document}
  7. \tikzstyle{every entity} = [draw=blue, fill=blue!20]
  8. \begin{tikzpicture}
  9. \node[entity] (person) {Person};
  10. \end{tikzpicture}
  11. \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:

User avatar
Johannes_B
Site Moderator
Posts: 4044
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Tue Oct 29, 2013 12:32 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

Postby c_d_hofer » Tue Oct 29, 2013 12:53 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.

User avatar
Johannes_B
Site Moderator
Posts: 4044
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Tue Oct 29, 2013 1:04 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

Postby c_d_hofer » Tue Oct 29, 2013 1:18 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 :D )


Return to “Graphics, Figures & Tables”

Who is online

Users browsing this forum: No registered users and 4 guests