如何使独立图形与投影仪的字体格式相匹配?

如何使独立图形与投影仪的字体格式相匹配?

考虑以下 MWE:

\documentclass{beamer}

\usepackage{tikz}
\usepackage{pgfplots} % loads tikz which loads pgf
\usepackage[american,siunitx]{circuitikz}
\usetikzlibrary{arrows,calc,positioning,fit}

\begin{document}

\begin{frame}
Time division multiple access (TDMA): \(Nk + n\)

\begin{circuitikz}

    %%% antenna
    \node[shape=antenna, xscale=-1, at={(-0.5,3)}](antenna){};
    
    %%% adder
    \node[draw, thick, shape=circle, minimum size=2pt, at={([xshift=50pt]antenna.south)}](adder){\(+\)};
    
    %%% noise
    \node[below=of adder, yshift=5pt] (noise) {\(n(t)\)};
    
    %%% h(t)
    \node[draw, shape=rectangle, thick, minimum width=28pt, minimum height=28pt, at={([xshift=50pt]adder.east)}](h_t){\(h \left( t \right)\)};
    
    %%% wiring
    \draw[->] (antenna.south) to (adder.west);
    \draw[->,>=stealth] (noise) to (adder.south);
    \draw[->,>=stealth] (adder.east) to (h_t.west);
    %%% sampler
    \draw[] (h_t.east) to ++(30pt,0pt) to ++(15pt,15pt);
    \coordinate (sampler_end) at ($(h_t.east) + (30pt,0pt) + (21.21pt,0pt)$);
    \draw[->] ($(sampler_end) + (-20pt,15pt)$) to[bend left]
        node[above, yshift=5pt](){\(t = (kN+n)T_s\)}
    ($(sampler_end) + (-7pt,0pt)$);
    
    \draw[->] (sampler_end) to
        node[pos=0.5, right, pos=1]() {\(x\left[ kN + n \right]\)}
    ++(30pt,0pt);
\end{circuitikz}

\end{frame}

\end{document}

这得出

在此处输入图片描述

我正在学习独立包以便正确使用它。但是,当我将其放在单独的文件中时,独立包会生成具有不同文本格式的不同图形。

\documentclass{standalone}
\usepackage{tikz}
\usepackage{pgfplots} % loads tikz which loads pgf
\usepackage[american,siunitx]{circuitikz}
\usetikzlibrary{arrows,calc,positioning,fit}

\begin{document}  

\begin{circuitikz}

%%% antenna
\node[shape=antenna, xscale=-1, at={(-0.5,3)}](antenna){};

%%% adder
\node[draw, thick, shape=circle, minimum size=2pt, at={([xshift=50pt]antenna.south)}](adder){\(+\)};

%%% noise
\node[below=of adder, yshift=5pt] (noise) {\(n(t)\)};

%%% h(t)
\node[draw, shape=rectangle, thick, minimum width=28pt, minimum height=28pt, at={([xshift=50pt]adder.east)}](h_t){\(h \left( t \right)\)};

%%% wiring
\draw[->] (antenna.south) to (adder.west);
\draw[->,>=stealth] (noise) to (adder.south);
\draw[->,>=stealth] (adder.east) to (h_t.west);
%%% sampler
\draw[] (h_t.east) to ++(30pt,0pt) to ++(15pt,15pt);
\coordinate (sampler_end) at ($(h_t.east) + (30pt,0pt) + (21.21pt,0pt)$);
\draw[->] ($(sampler_end) + (-20pt,15pt)$) to[bend left]
    node[above, yshift=5pt](){\(t = (kN+n)T_s\)}
($(sampler_end) + (-7pt,0pt)$);

\draw[->] (sampler_end) to
    node[pos=0.5, right, pos=1]() {\(x\left[ kN + n \right]\)}
++(30pt,0pt);


\end{circuitikz}
\end{document}

在此处输入图片描述

如何使独立图形与投影仪的字体格式相匹配?

答案1

standalone类别具有方便的beamer选项,它将为您提供所需的无衬线字体(它还将禁用裁剪页面,但您可以使用同名选项将其添加回来)。

\documentclass[beamer,crop]{standalone}
\usepackage{tikz}
\usepackage{pgfplots} % loads tikz which loads pgf
\usepackage[american,siunitx]{circuitikz}
\usetikzlibrary{arrows,calc,positioning,fit}

\begin{document}  

\begin{circuitikz}

%%% antenna
\node[shape=antenna, xscale=-1, at={(-0.5,3)}](antenna){};

%%% adder
\node[draw, thick, shape=circle, minimum size=2pt, at={([xshift=50pt]antenna.south)}](adder){\(+\)};

%%% noise
\node[below=of adder, yshift=5pt] (noise) {\(n(t)\)};

%%% h(t)
\node[draw, shape=rectangle, thick, minimum width=28pt, minimum height=28pt, at={([xshift=50pt]adder.east)}](h_t){\(h \left( t \right)\)};

%%% wiring
\draw[->] (antenna.south) to (adder.west);
\draw[->,>=stealth] (noise) to (adder.south);
\draw[->,>=stealth] (adder.east) to (h_t.west);
%%% sampler
\draw[] (h_t.east) to ++(30pt,0pt) to ++(15pt,15pt);
\coordinate (sampler_end) at ($(h_t.east) + (30pt,0pt) + (21.21pt,0pt)$);
\draw[->] ($(sampler_end) + (-20pt,15pt)$) to[bend left]
    node[above, yshift=5pt](){\(t = (kN+n)T_s\)}
($(sampler_end) + (-7pt,0pt)$);

\draw[->] (sampler_end) to
    node[pos=0.5, right, pos=1]() {\(x\left[ kN + n \right]\)}
++(30pt,0pt);


\end{circuitikz}
\end{document}

在此处输入图片描述

相关内容