Hallo,

Mich würde interessieren warum ich hier bei meinem Beispiel einen weißen Rand habe. Warum kann das Latex die auszugebende Seite nicht an die Größe der TIKZ Zeichnung anpassen? (Ohne dass man den weißen Rand sieht?

Open in Online-Editor
Code, hier editierbar zum Übersetzen:
\documentclass[11pt,preview,border=3pt]{standalone}
\usepackage{tikz}
\usepackage[T1]{fontenc}
\usepackage[scaled]{uarial}
\renewcommand*\familydefault{\sfdefault}
\begin{document}
\newsavebox\Zeichnung
\begin{lrbox}{\Zeichnung}
\begin{tikzpicture}
\draw[fill opacity=0.7, fill=gray,gray](-3.7,-1.06)--(3.7,-1.06)--(3.7,3.7)--(-3.7,3.7)--(-3.7,-1.06);
\fill[black](-0.56,0.56)--(-0.56,1.352)--(-1.352,0.56)--(-0.56,0.56);
\fill[black](0.56,0.56)--(0.56,1.352)--(1.352,0.56)--(0.56,0.56);
\draw[dash pattern=on 5.5mm off 2mm on .5mm off 2mm, -,line width=1pt](0,0)--(-3.2,0);
\draw[dash pattern=on 5.5mm off 2mm on .5mm off 2mm, -,line width=2pt](0,0)--(0,3.2);
\draw[dash pattern=on 5.5mm off 2mm on .5mm off 2mm, -,line width=2pt](0,0)--(3.2,0);
\draw[red,line width=3pt](0,-0.56)--(-3.2,-0.56);
\draw[fill=red] (0,0) circle [radius=0.2cm];
\draw(0,-0.56)--(0,0.56);
\draw(0,0.56)--(-3.2,0.56);
\draw(-0.56,0)--(-0.56,3.2);
\draw(-0.56,0)--(0.56,0);
\draw(0.56,0)--(0.56,3.2);
\draw(0,0.56)--(3.2,0.56);
\draw(0,0.56)--(0,-0.56);
\draw(0,-0.56)--(3.2,-0.56);
\fill[red](-1.592,0.56)circle (0.06);
\draw[red](-1.592,0.56)--(-1.592,0.96);
\node[above left,rotate=0,red] at (-1.592,0.96){$0$};
\fill[red](-0.56,1.592)circle (0.06);
\draw[red](-0.56,1.592)--(-0.96,1.592);
\node[above left,rotate=0,red] at (-0.96,1.592){$1$};
\fill[red](0.56,1.592)circle (0.06);
\draw[red](0.56,1.592)--(0.96,1.592);
\node[above right,rotate=0,red] at (0.96,1.592){$2$};
\fill[red](1.592,0.56)circle (0.06);
\draw[red](1.592,0.56)--(1.592,0.96);
\node[above right,rotate=0,red] at (1.592,0.96){$3$};
\draw[->,blue,line width=2pt]( 0,0)--(-2.22,0)node[above]{$y$};
\draw[->,blue,line width=2pt]( 0,0)--(0,2.22)node[left]{$z$};
\end{tikzpicture}
\end{lrbox}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

gefragt 24 Sep '15, 09:40

basel's gravatar image

basel
12961723
Akzeptiert-Rate: 0%

bearbeitet 24 Sep '15, 09:50

saputello's gravatar image

saputello
11.1k174365


Du fügst mit border=3pt einen weißen Rand ein. Dann kommt noch ein Leerzeichen nach der lrbox hinzu. Und schließlich fügst Du die Box in einen Node ein, der um seinen Inhalt inner sep setzt. Das \useasboundigbox ist eine zusätzliche Fehlerquelle. Wenn man das alles korrigiert, erhält man die Zeichnung ohne Rand.

alt text

Open in Online-Editor
Code, hier editierbar zum Übersetzen:
\documentclass[11pt]{standalone}
\usepackage{tikz}
\usepackage[T1]{fontenc}
\usepackage[scaled]{uarial}
\renewcommand*\familydefault{\sfdefault}
\begin{document}
\newsavebox\Zeichnung
\begin{lrbox}{\Zeichnung}
\begin{tikzpicture}
\draw[fill opacity=0.7, fill=gray,gray](-3.7,-1.06)--(3.7,-1.06)--(3.7,3.7)--(-3.7,3.7)--(-3.7,-1.06);
\fill[black](-0.56,0.56)--(-0.56,1.352)--(-1.352,0.56)--(-0.56,0.56);
\fill[black](0.56,0.56)--(0.56,1.352)--(1.352,0.56)--(0.56,0.56);
\draw[dash pattern=on 5.5mm off 2mm on .5mm off 2mm, -,line width=1pt](0,0)--(-3.2,0);
\draw[dash pattern=on 5.5mm off 2mm on .5mm off 2mm, -,line width=2pt](0,0)--(0,3.2);
\draw[dash pattern=on 5.5mm off 2mm on .5mm off 2mm, -,line width=2pt](0,0)--(3.2,0);
\draw[red,line width=3pt](0,-0.56)--(-3.2,-0.56);
\draw[fill=red] (0,0) circle [radius=0.2cm];
\draw(0,-0.56)--(0,0.56);
\draw(0,0.56)--(-3.2,0.56);
\draw(-0.56,0)--(-0.56,3.2);
\draw(-0.56,0)--(0.56,0);
\draw(0.56,0)--(0.56,3.2);
\draw(0,0.56)--(3.2,0.56);
\draw(0,0.56)--(0,-0.56);
\draw(0,-0.56)--(3.2,-0.56);
\fill[red](-1.592,0.56)circle (0.06);
\draw[red](-1.592,0.56)--(-1.592,0.96);
\node[above left,rotate=0,red] at (-1.592,0.96){$0$};
\fill[red](-0.56,1.592)circle (0.06);
\draw[red](-0.56,1.592)--(-0.96,1.592);
\node[above left,rotate=0,red] at (-0.96,1.592){$1$};
\fill[red](0.56,1.592)circle (0.06);
\draw[red](0.56,1.592)--(0.96,1.592);
\node[above right,rotate=0,red] at (0.96,1.592){$2$};
\fill[red](1.592,0.56)circle (0.06);
\draw[red](1.592,0.56)--(1.592,0.96);
\node[above right,rotate=0,red] at (1.592,0.96){$3$};
\draw[->,blue,line width=2pt]( 0,0)--(-2.22,0)node[above]{$y$};
\draw[->,blue,line width=2pt]( 0,0)--(0,2.22)node[left]{$z$};
\end{tikzpicture}
\end{lrbox}%
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Wenn Du die Zeichnung aber sowieso nur für sich haben möchtest, dann kannst Du Dir die lrbox auch gleich noch sparen:

Open in Online-Editor
Code, hier editierbar zum Übersetzen:
\documentclass[11pt,tikz]{standalone}
\usepackage[T1]{fontenc}
\usepackage[scaled]{uarial}
\renewcommand*\familydefault{\sfdefault}
\begin{document}
\begin{tikzpicture}
\draw[fill opacity=0.7, fill=gray,gray](-3.7,-1.06)--(3.7,-1.06)--(3.7,3.7)--(-3.7,3.7)--(-3.7,-1.06);
\fill[black](-0.56,0.56)--(-0.56,1.352)--(-1.352,0.56)--(-0.56,0.56);
\fill[black](0.56,0.56)--(0.56,1.352)--(1.352,0.56)--(0.56,0.56);
\draw[dash pattern=on 5.5mm off 2mm on .5mm off 2mm, -,line width=1pt](0,0)--(-3.2,0);
\draw[dash pattern=on 5.5mm off 2mm on .5mm off 2mm, -,line width=2pt](0,0)--(0,3.2);
\draw[dash pattern=on 5.5mm off 2mm on .5mm off 2mm, -,line width=2pt](0,0)--(3.2,0);
\draw[red,line width=3pt](0,-0.56)--(-3.2,-0.56);
\draw[fill=red] (0,0) circle [radius=0.2cm];
\draw(0,-0.56)--(0,0.56);
\draw(0,0.56)--(-3.2,0.56);
\draw(-0.56,0)--(-0.56,3.2);
\draw(-0.56,0)--(0.56,0);
\draw(0.56,0)--(0.56,3.2);
\draw(0,0.56)--(3.2,0.56);
\draw(0,0.56)--(0,-0.56);
\draw(0,-0.56)--(3.2,-0.56);
\fill[red](-1.592,0.56)circle (0.06);
\draw[red](-1.592,0.56)--(-1.592,0.96);
\node[above left,rotate=0,red] at (-1.592,0.96){$0$};
\fill[red](-0.56,1.592)circle (0.06);
\draw[red](-0.56,1.592)--(-0.96,1.592);
\node[above left,rotate=0,red] at (-0.96,1.592){$1$};
\fill[red](0.56,1.592)circle (0.06);
\draw[red](0.56,1.592)--(0.96,1.592);
\node[above right,rotate=0,red] at (0.96,1.592){$2$};
\fill[red](1.592,0.56)circle (0.06);
\draw[red](1.592,0.56)--(1.592,0.96);
\node[above right,rotate=0,red] at (1.592,0.96){$3$};
\draw[->,blue,line width=2pt]( 0,0)--(-2.22,0)node[above]{$y$};
\draw[->,blue,line width=2pt]( 0,0)--(0,2.22)node[left]{$z$};
\end{tikzpicture}
\end{document}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Hinweis: Ich habe den Inhalt der Zeichnung jetzt einfach übernommen. Aber, wie ich Dir schon wiederholt gesagt und gezeigt habe, würde ich die Zeichnung selbst ohne das wiederholte Eintippen der konkreten Koordinatenwerte erstellen. Wenn Du einen Punkt in Deiner Zeichnung nur etwas verschieben möchtest, musst Du jede Zeile einzeln kontrollieren und ändern, was aufwändig und fehleranfällig ist.

Permanenter link

beantwortet 24 Sep '15, 10:41

esdd's gravatar image

esdd
17.8k294257
Akzeptiert-Rate: 62%

bearbeitet 24 Sep '15, 10:48

Deine Antwort
[Vorschau ausblenden]

Folgen dieser Frage

Per E-Mail:

Wenn sie sich anmelden, kommen Sie für alle Updates hier in Frage

Per RSS:

Antworten

Antworten und Kommentare

Frage-Themen:

×731
×4

gestellte Frage: 24 Sep '15, 09:40

Frage wurde gesehen: 7,025 Mal

zuletzt geändert: 24 Sep '15, 10:48

Willkommen, erstes Mal hier? Schau mal unter FAQ!

×