I'm creating an ER diagram with the TikZ ER library. The manual warns that although key attributes are conventionally underlined, it is hard to implement in TeX and the library uses italics instead. That's fine for me but my teachers probably won't accept the assignment with non-standard notations.
That's why I'm asking the TeX wizard community for a working solution :) Questions that may be relevant are:
MWE from the manual:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{er}
\begin{document}
\begin{tikzpicture}
\node[entity] (sheep) at (0,0) {Sheep}
child {node [key attribute] {name}};
\node[entity] (genome) at (2,0) {Genome};
\node[relationship] at (1,1.5) {has}
edge (sheep)
edge (genome);
\end{tikzpicture}
\end{document}

erlibrary indeed does not provide automatically a tool to make key attributes underlined. You may want to\underline{attribute}or switch totikz-er2which provides a\keycommand. More information could be found in Drawing relationships between elements of a database. – Claudio Fiandrino Sep 28 '13 at 13:17