2

Trying to draw a package classes diagram with pgf-umlcd, I have got an error because of text width parameter for the class width, I don't know which package I need to solve the problem.

Here is a sample code:

\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usepackage{pgf-umlcd}

\begin{document}

\begin{tikzpicture}
\begin{package}{Package}
\begin{class}{Class}[text width=5cm]{1 ,1}
...
\end {class}
\end{package}
\end{tikzpicture}
\end{document}

Thanks

2
  • 1
    My recommendation: If you do not have too many class diagrams already switch to the more powerful tikz-uml package (perso.ensta-paristech.fr/~kielbasi/tikzuml).
    – TeXnician
    Feb 24, 2018 at 14:30
  • if you think so, I will switch them, thank you for the advice
    – Hind Dev
    Feb 24, 2018 at 14:39

1 Answer 1

2

Helps if you put the optional argument in the correct place, i.e. immediately after \begin{class}.

\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usepackage{pgf-umlcd}

\begin{document}

\begin{tikzpicture}
\begin{package}{Package}
\begin{class}[text width=5cm]{Class}{1 ,1}
...
\end {class}
\end{package}
\end{tikzpicture}
\end{document}
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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