TransWikia.com

Superscripts size in tikz label

TeX - LaTeX Asked on April 28, 2021

The size of the superscripts (2) should be smaller, how can I fix that?

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+2mathbf{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}

One Answer

I would rather increase font size in math from tiny to scriptsize. In this case for sub/super scripts is available tiny size, so their will looks smaller. Of course you still have option to consider @Marijn comment.

Off-topic: I took a liberty and wee bit correct your MWE where I use scriptsize fonts for math in your image. You may find result satisfactory:

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}
DeclarePairedDelimiternorm{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 + 2mathbf{I}_bcdot 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}

enter image description here

Correct answer by Zarko on April 28, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP