0

I have some code for uml diagram that produces UML diagram as pdf. I want to include these UML diagram in my lab report where these uml diagram are shown as figure. There is a solution that making the screen shot of those UML and then add these in document. But, I want to add those as raw latex code.

For example:

\documentclass{article}
\usepackage{pgf-umlcd}
\begin{document}
Some text.
\begin{figure}
\begin{tikzpicture}
  \begin{class}[text width = 8cm]{LaTexLanguageBehavior}{0,0}
    \attribute{$\sim$ com.alhelal.textpad}
    \attribute{$-$ uniqueInstance : LaTexLanguageBehavior}
    \operation{+ getUniqueInstance : LaTexLanguageBehavior}
    \operation{+ runCode(file : File) : BufferedReader}
    \operation{+ buildCode(file : File) : BufferedReader}
    \operation{+ setHighlightableText()}
    \operation{+ setAutoCompletableText()}
  \end{class}
  \node [above=3mm] at (current bounding box.north) {Singleton Pattern};
\end{tikzpicture}
\end{figure}
Some text.
\end{document} 
Schweinebacke
  • 26,336
alhelal
  • 2,451

0 Answers0