Tikz 文档边距和方向

Tikz 文档边距和方向

这是我的代码:

\documentclass[tikz,border=3.14mm]{standalone}
\usepackage{amssymb, graphicx}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{float}
\usepackage{enumitem}
\usepackage{amsfonts,bm}
\usepackage{diagbox}
\usepackage[makeroom]{cancel}
\usepackage{pgfplots}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows.meta, positioning}
\usepackage{verbatim}
\usepackage[american,siunitx]{circuitikz}
\usepackage[export]{adjustbox}
\usepackage{mathtools}
\DeclarePairedDelimiter\ceil{\lceil}{\rceil}
\DeclarePairedDelimiter\floor{\lfloor}{\rfloor}
\usepackage{units}
\usepackage{relsize}
\usepackage[margin=1in, landscape]{geometry}
\usepackage{changepage}

%\makeatletter
%\def\pgfaddtoshape#1#2{% https://tex.stackexchange.com/a/14772/38080
%   \begingroup
%   \def\pgf@sm@shape@name{#1}%
%   \let\anchor\pgf@sh@anchor
%   #2%
%   \endgroup
%}
% we need to add an anchor to muxdemux
%\pgfaddtoshape{muxdemux}{
%   \anchor{top left ext}{%
%       \topleft\advance\pgf@x by -\extshift
%}}
%\makeatother

\makeatletter 
% based on
% https://tex.stackexchange.com/a/38995/121799
% https://tex.stackexchange.com/a/76216
% https://tex.stackexchange.com/a/59168/194703
% https://tex.stackexchange.com/q/448920/194703
\tikzset{
    reuse path/.code={\pgfsyssoftpath@setcurrentpath{#1}}
}
\tikzset{protect/.style={save path=\tmprotect},
    even odd clip/.code={\pgfseteorule},
    protect last node/.code={
        \clip[overlay,even odd clip,reuse path=\tmprotect]
        (-16383.99999pt,-16383.99999pt) rectangle (16383.99999pt,16383.99999pt);
}}
\makeatother
\begin{document}
    \begin{center}  
        \begin{adjustwidth}{1.5em}{0em} 
            \begin{circuitikz}[scale = 0.6, transform shape]
                \tikzset{mux 4by1/.style={muxdemux,
                        muxdemux def={Lh=4, NL=4, Rh=2,
                            NB=2, w=2, square pins=1}}};
                \draw(0, 0) node[draw, minimum width = 1.25cm, minimum height = 5 cm] (buff1){};
                \draw(10, 0) node[draw, minimum width = 1.25cm, minimum height = 5 cm] (buff2){};
                \draw($(buff1.north east)!1/3!(buff1.south east)$) coordinate(nearBuff1) -- node[pos=0.4, yshift = 0.15cm] {\footnotesize Hello} (nearBuff1 -| buff2.west);
                \draw($(buff1.north east)!2/3!(buff1.south east)$) coordinate(nearBuff2);
                \draw($(nearBuff2)!2/5!(nearBuff2 -| buff2.west)$) node[yshift = 0.15cm] {\footnotesize Hello};
                \draw(nearBuff2) -- (nearBuff2 -| buff2.west);
            \end{circuitikz}
        \end{adjustwidth}
    \end{center}
\end{document}

输出:

在此处输入图片描述

示波器center不起作用。tikz图形总是触及 pdf 文件的顶部边缘。如何使该tikz图形位于 pdf 文件的中间?

相关内容