CircuiTikZ 中的镜像天线符号

CircuiTikZ 中的镜像天线符号

我想将左到右改为antenna从右到左,因为接收器需要发射天线的镜像。

这是我的简化代码

\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{tikz}
\usepackage{circuitikz}
\usetikzlibrary{positioning}
\usetikzlibrary{shapes,arrows}
\tikzstyle{block} = [draw, fill=white, rectangle, 
    minimum height=3em, minimum width=4em]
\tikzstyle{input} = [coordinate]
\tikzstyle{output} = [coordinate]
\tikzstyle{pinstyle} = [pin edge={to-,t,black}]
%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\begin{tikzpicture}[auto, node distance=2cm,>=latex']
\node[block](tx){transmitter};
\node[antenna,right of =tx,xshift=-0.8 cm] {};
\node[block,right of =tx,xshift=5 cm](rx){reciver};
\node[antenna,left of =rx] {};
\end{tikzpicture}
\end{document}

答案1

您可以使用xscale=-1沿-方向镜像天线x

下面是精炼的代码,其中我使用了positioning库的正确语法,而\tikzset不是tikzstyle(已弃用)。

\documentclass[12pt,a4paper]{article}
\usepackage{circuitikz}
\usetikzlibrary{positioning}
\usetikzlibrary{shapes,arrows}
\tikzset{block/.style = {draw, fill=white, rectangle,
                  minimum height=3em, minimum width=2cm},
        input/.style = {coordinate},
        output/.style = {coordinate},
        pinstyle/.style = {pin edge={to-,t,black}}
    }
%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\begin{tikzpicture}[auto, node distance=2cm,>=latex']
\node[block](tx){transmitter};
\node[antenna] at (tx.east) {};
\node[block,right = 5cm of tx](rx){receiver};
\node[antenna,xscale=-1] at (rx.west) {};
\end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容