von Jaffet » Mo 5. Apr 2021, 11:49
Hallo Latex-Forum,
ich habe eine 10cm x 10cm große Fläche namens Port definiert.
In diese Fläche möchte ich nun ein Rechteck mit den Seitenmaßen a=9cm und b=5cm platzieren. Seltsamerweise füllt das schwarze Rechteck die gesamte Fläche Port aus, obwohl es per Definition kleiner ist als diese (siehe Minimalbeispiel).
\documentclass{scrartcl}
\usepackage{tikz}
\usetikzlibrary{positioning}
\tikzset{
ports/.style={
line width=1pt,
draw=black,
minimum width=10cm,
minimum height=10cm,
path picture={
\coordinate(Ursprung) at (path picture bounding box.south west);
%\draw[draw=black, thin] (Ursprung) grid (10,10);
\draw[fill=black] (Ursprung) rectangle (9cm,5cm);
}
}
}
\begin{document}
\begin{figure}
\begin{tikzpicture}
\node(Port) at (0,0) [ports]{};
\end{tikzpicture}
\caption{Ports}
\end{figure}
\end{document}
Hallo Latex-Forum,
ich habe eine 10cm x 10cm große Fläche namens Port definiert.
In diese Fläche möchte ich nun ein Rechteck mit den Seitenmaßen a=9cm und b=5cm platzieren. Seltsamerweise füllt das schwarze Rechteck die gesamte Fläche Port aus, obwohl es per Definition kleiner ist als diese (siehe Minimalbeispiel).
[code]
\documentclass{scrartcl}
\usepackage{tikz}
\usetikzlibrary{positioning}
\tikzset{
ports/.style={
line width=1pt,
draw=black,
minimum width=10cm,
minimum height=10cm,
path picture={
\coordinate(Ursprung) at (path picture bounding box.south west);
%\draw[draw=black, thin] (Ursprung) grid (10,10);
\draw[fill=black] (Ursprung) rectangle (9cm,5cm);
}
}
}
\begin{document}
\begin{figure}
\begin{tikzpicture}
\node(Port) at (0,0) [ports]{};
\end{tikzpicture}
\caption{Ports}
\end{figure}
\end{document}
[/code]