pgf-umlcd:類別圖中的文字寬度錯誤

pgf-umlcd:類別圖中的文字寬度錯誤

嘗試使用 繪製包類圖時pgf-umlcd,由於類別寬度的參數而出現錯誤text width,我不知道需要哪個包來解決問題。

這是範例程式碼:

\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}

謝謝

答案1

如果您將可選參數放在正確的位置(即緊接在 之後),則會有所幫助\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}

相關內容