tikz 标签中的上标大小

tikz 标签中的上标大小

上标 (2) 的尺寸应该更小一些,我该如何解决这个问题?

\documentclass[border=5pt]{standalone}
\usepackage{sansmath}
\usepackage{tikz,pgfplots}     
\usetikzlibrary{angles, arrows.meta,    % new
                quotes}                 % new
\definecolor{lava}{rgb}{0.81, 0.06, 0.13}
\definecolor{myblue}{rgb}{0.0, 0.30, 0.60}
   \usepackage{amsmath,amsthm, amssymb, latexsym}
%ENEC250071

\begin{document}

  \begin{tikzpicture}[
ang/.style = {draw, Straight Barb-, anchor=west,
              angle radius = 8mm, angle eccentricity=1.25},
arr/.style = {cap=round,-Straight Barb},
dot/.style = {circle, fill, minimum size=3pt,inner sep=0pt},
every edge quotes/.style = {auto, font=\footnotesize, sloped},
every label/.style       = {inner sep=1pt},
                       font=\sffamily ]


% defining radius points
\coordinate (O) at (0,0);
\node (n2)    at (120:2.5) {};
\node (n1)  at ( -120:2.5) {};
\node (n3)    at (180:2.5) {};
\node (n4)    at (0:2.5) {};
    \path[draw=black, thick, arr] 
    (O) to  (n2.center);
\path[draw=black, thick, arr] 
    (O) to  (n1.center);
    
    \path[draw=black, thick, arr,dashed] 
    (n1) to  (n3.center);

    \path[draw=black, thick, arr,dashed] 
    (n2) to  (n3.center);
    
      \path[draw=black, thick, arr,dashed,lava] 
    (O) to  (n3.center); 
        
      \path[draw=black, thick, arr,dashed,myblue] 
    (O) to  (n4.center); 

\node[above] (n3)  at ( 180:1.25) {\tiny $  \mathbf{I}_{b}+\mathbf{I}_{c    }$};
\node[] (n0)  at ( 0:2.7) {};
\node[] (ny)  at ( 90:2.7) {};
% vector
    
    \path[draw=black] 
    (O) to  (n0.center);
        \path[draw=black] 
    (O) to  (ny.center);
        \path[draw=black] 
    (O) to  (n0.center);
    
  \node[right] ()  at ( 0:2.75) {\tiny X};  
    \node[above] ()  at ( 90:2.75) {\tiny Y}; 

% angle
\pic [ang, -Straight Barb, "\tiny $120^\circ$"] {angle = n0--O--n2};
\pic [ang, Straight Barb-, "\tiny $-120^\circ$"] {angle = n1--O--n0};
\node[below] at (n1) {\tiny $\mathbf{I}_{b}$};   
\node[above] at (n2) {\tiny $\mathbf{I}_{c}$};  

\node[] at (2.5,2.5){
$\tiny \begin{aligned}
\Vert \mathbf{I}_a \Vert^2=&\Vert \mathbf{I}_b \Vert^2+2\mathbf{I}_b . \mathbf{I}_c+\Vert \mathbf{I}_b \Vert^2,\\
=&\Vert \mathbf{I}_b \Vert^2+2 \cos(120^\circ) \Vert \mathbf{I}_b \Vert \Vert \mathbf{I}_c \Vert+\Vert \mathbf{I}_b \Vert^2 ,\\
=&\mathbf{I}^2+2 \cos(120^\circ)  (\mathbf{I})(\mathbf{I})+\mathbf{I}^2 ,\\
=&\mathbf{I}^2-\mathbf{I}^2+\mathbf{I}^2 ,\\
=&\mathbf{I}^2, \\
\Vert \mathbf{I}_a \Vert =&\mathbf{I}.\\
\end{aligned}$ };
    \end{tikzpicture}
\end{document}

答案1

我宁愿将数学中的字体大小从 增加到\tiny\scriptsize在这种情况下,上标/下标有可用的\tiny大小,因此它们看起来会更小。当然,您仍然可以选择考虑@Marijn 的评论。

题外话:我擅自修改了你的 MWE,在scriptsize你的图片中使用了数学字体。你可能会发现结果令人满意:

\documentclass[border=5pt]{standalone}
\usepackage{sansmath}
\usepackage{pgfplots}
\usetikzlibrary{angles, arrows.meta,    % new
                quotes}                 % new
\definecolor{lava}{rgb}{0.81, 0.06, 0.13}
\definecolor{myblue}{rgb}{0.0, 0.30, 0.60}
\usepackage{mathtools,amsthm, amssymb, latexsym}
\DeclarePairedDelimiter\norm{\lVert}{\rVert}

%ENEC250071

\begin{document}
    \begin{tikzpicture}[
     nodes = {font=\scriptsize},
ang/.style = {draw, Straight Barb-Straight Barb, anchor=west,
              angle radius = 8mm, angle eccentricity=1.1},
arr/.style = {cap=round, -{Straight Barb[angle=45:2pt 3]}},
dot/.style = {circle, fill, minimum size=3pt,inner sep=0pt},
every edge quotes/.style = {auto, font=\footnotesize, sloped},
every label/.style       = {inner sep=1pt},
                       font=\sffamily ]
% defining radius points
\coordinate (O);
\coordinate (n1)  at (-120:2.5);
\coordinate (n2)  at ( 120:2.5);
\coordinate (n3)  at ( 180:2.5);
\coordinate (n4)  at (   0:2.5);
%
\coordinate (nx)  at (   0:2.7);
\coordinate (ny)  at (  90:2.7);
% axis
\draw[very thin]    (O) to  (ny) node[above] {Y} 
                    (O) to  (nx) node[right] {X};
% vectors
\draw[thick, arr]   (O)  to  (n2) node[above] {$\mathbf{I}_{c}$};
\draw[thick, arr]   (O)  to  (n1) node[below] {$\mathbf{I}_{b}$};
\draw[thick, arr, dashed]   (n1) to  (n3);
\draw[thick, arr, dashed]   (n2) to  (n3);
\path[draw=lava, thick, arr, dashed] 
                    (O) to node[above] {$\mathbf{I}_{b}+\mathbf{I}_{c}$}   (n3);
\draw[thick, arr, dashed, myblue]   (O) to  (n4);
% angle
\pic [ang, "$ 120^\circ$"] {angle = nx--O--n2};
\pic [ang, "$-120^\circ$"] {angle = n1--O--nx};
% math description
\node[above right] at (0,1){$\begin{aligned}
    \norm{\mathbf{I}_a}^2 
    & = \norm{\mathbf{I}_b}^2 + 2\mathbf{I}_b\cdot \mathbf{I}_c + \norm{\mathbf{I}_b}^2,\\
    & = \norm{\mathbf{I}_b}^2+2 \cos(120^\circ) \norm{\mathbf{I}_b} \norm{\mathbf{I}_c} + \norm{\mathbf{I}_b}^2 ,\\
    & = \mathbf{I}^2+2 \cos(120^\circ)  (\mathbf{I})(\mathbf{I})+\mathbf{I}^2 ,\\
    & = \mathbf{I}^2-\mathbf{I}^2+\mathbf{I}^2 ,\\
    & = \mathbf{I}^2, \\
    \norm{\mathbf{I}_a} 
    & = \mathbf{I}.
                            \end{aligned}$ };
    \end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容