1

The problem is, when I'm compiling the grafic(s) as a standalone, latex inserts a blank page. By defining the documentclass as an article this doesn't happen. (How can i fix this [and why is it happening?] I have to use standalone.) Thank you in advance.

Here is my code:

enter image description here

\documentclass[tikz] {standalone}
\usepackage{tikz}
\usetikzlibrary{decorations.markings}
\begin{document}
    \begin{figure}
        \begin{tikzpicture} [scale=1]
%       
        \tikzset{->-/.style={decoration={
            markings,
            mark=at position .5 with {\arrow{>}}},postaction={decorate}}}
%       
        \coordinate (0) at (0,0);
%       
        \fill (0) circle (0.5mm) node [below=1.5mm, right=0.5mm] {$x^*$};
        %       
        \draw (0) -- (-11mm,11.5mm);    
        \draw (0) circle (16mm) node [left=4.5 mm, above=4.8mm] {$\eta$};
        %
        \coordinate (1) at (-0.5,-0.5);
        \coordinate (2) at (-2.5,-3);
        \coordinate (3) at (0,-4);
        \coordinate (4) at (3,-3.5);
        \coordinate (5) at (4.5, 0);
        \coordinate (6) at (2.5,3.5);
        \coordinate (7) at (-0.5,3.5);
        \coordinate (8) at (-2,3.5);
        \coordinate (9) at (-4,1.5);
        \coordinate (10) at (-3.2,0);
        \coordinate (11) at (-1,0);
        \coordinate (12) at (-0.2,0);
        %
        \draw [line width=0.8] (1) to [out=180,in=130] (2); 
        \draw [line width=0.8] (2) to [out=310,in=210] (3);
        \draw [line width=0.8] (3) to [out=30,in=170] (4);
        \draw [line width=0.8] (4) to [out=350,in=220] (5);
        \draw [line width=0.8] (5) to [out=40,in=290] (6);
        \draw [line width=0.8] (6) to [out=110,in=80] (7);
        \draw [line width=0.8] (7) to [out=260,in=340] (8);
        \draw [line width=0.8] (8) to [out=160,in=140] (9);
        \draw [line width=0.8] (9) to [out=320,in=170] (10);
        \draw [->-, line width=0.8] (10) to [out=350,in=140] (11);
        \draw [->-, line width=0.8] (11) to [out=320,in=180] (12);
        %       
        \fill (1) circle (0.5mm) node [right=0.5, below=0.5mm]{$x$};
%       
        \end{tikzpicture}
    \end{figure}
\end{document}
  • 4
    Don't use the figure environment. – Ulrike Fischer Apr 27 '18 at 20:08
  • Solved it perfect and way easier then i thought, thank you very much! – Don Ky Apr 27 '18 at 20:10
  • @UlrikeFischer -- i think this one is worth an answer. although the solution was obvious to me, it probably won't be to someone using standalone for the first time. so this question shouldn't be lost (unless there's already a duplicate; i haven't looked). – barbara beeton Apr 28 '18 at 19:00
3

Don't use the figure environment with the standalone class. It doesn't make sense and has the side effect to create a blank page.

| improve this answer | |

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.