TransWikia.com

Unequal fonts between TikZ graph and body text

TeX - LaTeX Asked by Elzevirs on February 20, 2021

Is there a way to standardize the appearance of fonts since they appear in one way in the text, i.e.

enter image description here

and in another way on the graph, i.e.

"On the graph.png"

?

Here is the code:

%** MainS.tex**
documentclass{article}
usepackage[italian]{babel} 
usepackage{lmodern}
usepackage{amsmath,amssymb,amsthm}
usepackage{bm}
usepackage{mathrsfs}
usepackage{bbm}  
usepackage{hyperref} 
usepackage{graphicx}
usepackage{xcolor}  
usepackage{pgfplots}   
usepackage{tikz}
usetikzlibrary{arrows.meta,spy,positioning,patterns}
usepackage{anyfontsize}

begin{document}

Let's consider the vector $bm{hat{x}}$ of the following figure
begin{figure}[h]
begin{tikzpicture}[spy using outlines={circle, magnification=8, size=5.75cm, connect spies}] 

draw [line width=.005pt,-{Latex[width=.25pt, length=.55pt]}] (9.83,6.67) -- ++(.22,.015)
node[pos=0.7,inner
sep=.25pt,above]{fontsize{.75}{20}selectfont $bm{hat{x}}$}; %X

spy [red] on (10.095,6.725) in node at (15,2.7);

end{tikzpicture}
caption{The vector $bm{hat{x}}$.}
label{fig:vectx}
end{figure}
end{document}

Any suggestions?

One Answer

Changing fontsize is not the same as scaling. If you want scaling, you can use scalebox like this:

documentclass[tikz, border=1 cm]{standalone}
usepackage{bm}
usepackage{tikz}
begin{document}
   begin{tikzpicture} 
   /node{$bm{hat{x}}$};
   /node{scalebox{0.5}{$bm{hat{x}}$}};
   /node{fontsize{.75}{20}selectfont $bm{hat{x}}$};
end{tikzpicture}
end{document}

Xxx

Correct answer by hpekristiansen on February 20, 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