4

I draw two circles in a standalone environment using the following code, but they are always rendered on separate pages.

\documentclass[tikz,border=2pt]{standalone}
\usepackage{tikz}

\begin{document}
\begin{tikzpicture}
    \tikzstyle{open}=[circle,draw,minimum size=5mm]
    \node[open] (c1) at (0,0) {};
\end{tikzpicture}

\begin{tikzpicture}
    \tikzstyle{open}=[circle,draw,minimum size=5mm]
    \node[open] (c1) at (0,0) {};
\end{tikzpicture}
\end{document}

How to combine them (say vertically) and put them into one page?

1
  • Welcome. // Nice question, couldn't resolve it from the manual. However, two remarks: 1) You already load package tikz with the \documentclass statement. 2) As a bypass, you can create a \pic for each drawing and place them like you would place nodes in a single tikzpicture environment. See tikz.dev for details on \pic , i.e. tikz.dev/tikz-pics.
    – MS-SPO
    Dec 10, 2023 at 13:17

1 Answer 1

4

A solution is to remove the option tikz from \documentclass.

enter image description here

\documentclass[border=2pt]{standalone}
\usepackage{tikz}

\begin{document}
\begin{tikzpicture}
    \tikzstyle{open}=[circle,draw,minimum size=5mm]
    \node[open] (c1) at (0,0) {};
\end{tikzpicture}

\begin{tikzpicture}
    \tikzstyle{open}=[circle,draw,minimum size=5mm]
    \node[open] (c1) at (0,0) {};
\end{tikzpicture}
\end{document}
3
  • 1
    How to put them vertically instead? Dec 10, 2023 at 13:30
  • 2
    @ZhengyuanYue Use \documentclass[border=2pt,varwidth]{standalone} to get a vertical layout Dec 10, 2023 at 13:31
  • You could put them into a minipage or tabular. Dec 10, 2023 at 20:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .