将两个tikzpictures彼此相邻放置

时间:2020-03-05 05:28:11

标签: pdf latex tikz

我希望在LaTeX中有两个并排的技巧。有人知道这样做的可靠方法吗?我将发布代码和它的外观截图。如果没有,是否还有另一种并排创建维恩图的方法?谢谢!

% %%%%%%%%%%%%%%%%%%%
\section*{Question 1}
% %%%%%%%%%%%%%%%%%%%
{\bfseries Determine the relationship between $P = (A-B)-C$ and $Q = (A-C)-(B-C)$}

{\bfseries Answer: $P = Q$}

% %%%%%%%%%%%%%%%%%%%
\subsection*{Justification 1: Venn Diagram}
% %%%%%%%%%%%%%%%%%%%
\def\firstcircle{ (0.0, 0.0) circle (1.5)}
\def\secondcircle{(2.0, 0.0) circle (1.5)}
\def\thirdcircle{ (1.0,-1.5) circle (1.5)}
\def\rectangle{ (-1.5,-3.0) rectangle (3.5,1.0) }
\colorlet{circle edge}{black}
\colorlet{circle area}{blue!30}

\tikzset{filled/.style={fill=circle area, draw=circle edge, thick},
    outline/.style={draw=circle edge, thick}}

\begin{tikzpicture}
    \begin{scope}
        \fill[filled]  \firstcircle;
        \fill[white]  \secondcircle;
        \fill[white] \thirdcircle;
    \end{scope}
    \draw[outline] \firstcircle  node[left]  {$A$};
    \draw[outline] \secondcircle node[right] {$B$};
    \draw[outline] \thirdcircle  node[below] {$C$};
    \node[anchor=south] at (current bounding box.north) 
      {$P = (A - B) - C$};
\end{tikzpicture}

\begin{tikzpicture}
    \begin{scope}
        \fill[filled]  \firstcircle;
        \fill[white]  \secondcircle;
        \fill[white] \thirdcircle;
    \end{scope}
    \draw[outline] \firstcircle  node[left]  {$A$};
    \draw[outline] \secondcircle node[right] {$B$};
    \draw[outline] \thirdcircle  node[below] {$C$};
    \node[anchor=south] at (current bounding box.north) 
      {$Q = (A - C) - (B - C)$};
\end{tikzpicture}
\pagebreak

a

2 个答案:

答案 0 :(得分:3)

通过在两张图片之间留空行,可以强制将两张图片分开显示。对于乳胶,空行表示新段落的开始。

\documentclass{article}

\usepackage{tikz}

\begin{document}

% %%%%%%%%%%%%%%%%%%%
\section*{Question 1}
% %%%%%%%%%%%%%%%%%%%
{\bfseries Determine the relationship between $P = (A-B)-C$ and $Q = (A-C)-(B-C)$}

{\bfseries Answer: $P = Q$}

% %%%%%%%%%%%%%%%%%%%
\subsection*{Justification 1: Venn Diagram}
% %%%%%%%%%%%%%%%%%%%
\def\firstcircle{ (0.0, 0.0) circle (1.5)}
\def\secondcircle{(2.0, 0.0) circle (1.5)}
\def\thirdcircle{ (1.0,-1.5) circle (1.5)}
\def\rectangle{ (-1.5,-3.0) rectangle (3.5,1.0) }
\colorlet{circle edge}{black}
\colorlet{circle area}{blue!30}

\tikzset{filled/.style={fill=circle area, draw=circle edge, thick},
    outline/.style={draw=circle edge, thick}}

\begin{tikzpicture}
    \begin{scope}
        \fill[filled]  \firstcircle;
        \fill[white]  \secondcircle;
        \fill[white] \thirdcircle;
    \end{scope}
    \draw[outline] \firstcircle  node[left]  {$A$};
    \draw[outline] \secondcircle node[right] {$B$};
    \draw[outline] \thirdcircle  node[below] {$C$};
    \node[anchor=south] at (current bounding box.north) 
      {$P = (A - B) - C$};
\end{tikzpicture}
%
\begin{tikzpicture}
    \begin{scope}
        \fill[filled]  \firstcircle;
        \fill[white]  \secondcircle;
        \fill[white] \thirdcircle;
    \end{scope}
    \draw[outline] \firstcircle  node[left]  {$A$};
    \draw[outline] \secondcircle node[right] {$B$};
    \draw[outline] \thirdcircle  node[below] {$C$};
    \node[anchor=south] at (current bounding box.north) 
      {$Q = (A - C) - (B - C)$};
\end{tikzpicture}
\pagebreak

\end{document}

enter image description here

答案 1 :(得分:-2)

您总是可以画出巨大的 网格,我有这个确切的问题...然后我画了一个网格, 尤其是如果您的方案是大多数事物都保持不变的进度..但是对于每张新图像,有些事物会发生变化……就像卡通漫画一样……复制新图片时,只需更改坐标即可。 / p>

很容易将所有空间隔开并根据您的审美进行调整...

您甚至可以在网格上使用不同的步长。

绘制了总体方案后,将网格线更改为白色,并且它不会显示在呈现的pdf中。

希望有帮助