在两列文档中安装 tikz

在两列文档中安装 tikz

我的两列文档中有以下 tikzcd 图表”

\begin{center}
    \begin{tikzcd}[column sep=20,row sep=20]
       P: \prod_{i=1}^{WS}{G} \arrow[r,"RTL"] & \prod_{i=1}^{WS}{G} \arrow[r,"TPL"] 
        & \prod_{i=1}^{WS/2}{G} \arrow[r,"RTL"] & ... \arrow[r,"TPL"] & \prod_{i=1}^{WS/8}{G} \arrow[r,"RTL"] & \prod_{i=1}^{WS/8}{G}
    \end{tikzcd}
\end{center}
\begin{center}
    \begin{tikzcd}[column sep=20,row sep=20]
       D: \prod_{i=1}^{WS/8}{G} \arrow[r,"RTL"] & \prod_{i=1}^{WS/8}{G} \arrow[r,"TUPL"] 
        & \prod_{i=1}^{WS/4}{G} \arrow[r,"RTL"] & ... \arrow[r,"TUPL"] & \prod_{i=1}^{WS}{G} \arrow[r,"RTL"] & \prod_{i=1}^{WS}{G}
    \end{tikzcd}
\end{center}

它跨越多列并覆盖下一列,我怎样才能使前面的列向下移动或将 tikz 图表叠加到整个页面上?

答案1

这是一种方法。

1 您必须multicols在适当的位置中断环境并插入图表。

2 然后手动增加column sep直到图表达到 \textwidth。(它们太宽,仅适合一列)

3 最后添加两条水平线来标记阅读流程,否则读者会感到困惑。

4 重新启动multicols

\documentclass[10pt]{article}
\usepackage[
bottom=30mm,
top=30mm,
left=25mm,
right=25mm
]{geometry}

\usepackage{lipsum}
\usepackage{multicol}
\usepackage{tikz}
\usetikzlibrary{cd}

\begin{document}

\begin{multicols}{2}
    \section{section 1}
    \lipsum[1-9]        
\section{section 2}
\lipsum[1-2]
\end{multicols}

\noindent\rule{\textwidth}{0.5pt}

\begin{center}
    \begin{tikzcd}[column sep=40,row sep=20]
        P: \prod_{i=1}^{WS}{G} \arrow[r,"RTL"] & \prod_{i=1}^{WS}{G} \arrow[r,"TPL"] 
        & \prod_{i=1}^{WS/2}{G} \arrow[r,"RTL"] & ... \arrow[r,"TPL"] & \prod_{i=1}^{WS/8}{G} \arrow[r,"RTL"] & \prod_{i=1}^{WS/8}{G}
    \end{tikzcd}
\end{center}

\begin{center}
    \begin{tikzcd}[column sep=40,row sep=20]
        D: \prod_{i=1}^{WS/8}{G} \arrow[r,"RTL"] & \prod_{i=1}^{WS/8}{G} \arrow[r,"TUPL"] 
        & \prod_{i=1}^{WS/4}{G} \arrow[r,"RTL"] & ... \arrow[r,"TUPL"] & \prod_{i=1}^{WS}{G} \arrow[r,"RTL"] & \prod_{i=1}^{WS}{G}
    \end{tikzcd}
\end{center}
\noindent\rule{\textwidth}{0.5pt}

\begin{multicols}{2}   
    \lipsum[1-2]
\end{multicols}

\end{document}

出6

使用环境可获得类似的结果figure。使图表浮动,然后它们将被放置在页面顶部,如果您愿意的话。在某些情况下,这可能是一个有用的技巧。它需要一个标题和一个标签来在文本中进行引用。

文本块之间的空间可以作为眼睛的引导。

\begin{figure}[t]
    \begin{tikzcd}[column sep=40,row sep=20]
        P: \prod_{i=1}^{WS}{G} \arrow[r,"RTL"] & \prod_{i=1}^{WS}{G} \arrow[r,"TPL"] 
        & \prod_{i=1}^{WS/2}{G} \arrow[r,"RTL"] & ... \arrow[r,"TPL"] & \prod_{i=1}^{WS/8}{G} \arrow[r,"RTL"] & \prod_{i=1}^{WS/8}{G}
    \end{tikzcd}    
\caption{\textbf{First diagram}} \label{fig:D1}
\end{figure}

\begin{figure}[t]
    \begin{tikzcd}[column sep=40,row sep=20]
        D: \prod_{i=1}^{WS/8}{G} \arrow[r,"RTL"] & \prod_{i=1}^{WS/8}{G} \arrow[r,"TUPL"] 
        & \prod_{i=1}^{WS/4}{G} \arrow[r,"RTL"] & ... \arrow[r,"TUPL"] & \prod_{i=1}^{WS}{G} \arrow[r,"RTL"] & \prod_{i=1}^{WS}{G}
    \end{tikzcd}
    \caption{\textbf{Second diagram}} \label{fig:D2}
\end{figure}
\begin{multicols}{2}   
    As the Diagram \ref{fig:D1} shows, a more deeper approach is needed, like the chosen  in Diagram \ref{fig:D2}.      
    
    \lipsum[1-2]
\end{multicols}

添加\usepackage[figurename= Diagram]{caption}在序言中。

浮点型

相关内容