# Latex: Font Size

Split from:

https://forum.plantuml.net/10761/latex-export-limitations?state=comment-10774&show=10774#c10774

When a skinparam is used to set a font size in latex, this is disregarded.

Latex handles font sizing "strangely", in that usually users don't set a font other than the base fonts and then all fonts are proportions of that font.

This test uml:

@startuml
skinparam legendFontSize 8
skinparam activityFontSize 14

:A;

legend right
legend text
endlegend

@enduml

Renders like this in a normal render:

In latex it renders like this: https://www.overleaf.com/read/gdnstsqtjhsw - i.e. no font scaling takes place.

From this latex code:

\documentclass{standalone}
\usepackage{tikz}
\usepackage{aeguill}
\begin{document}
% generated by Plantuml 1.2020.01beta10
\definecolor{plantucolor0000}{RGB}{254,254,206}
\definecolor{plantucolor0001}{RGB}{168,0,54}
\definecolor{plantucolor0002}{RGB}{0,0,0}
\definecolor{plantucolor0003}{RGB}{221,221,221}
\begin{tikzpicture}[yscale=-1
]
\draw[color=plantucolor0001,fill=plantucolor0000,line width=1.5pt] (40.1481pt,25.1778pt) arc (180:270:15.1778pt) -- (55.3259pt,10pt) -- (55.3259pt,10pt
) arc (270:360:15.1778pt) -- (70.5037pt,25.1778pt) -- (70.5037pt,28.791pt) arc (0:90:15.1778pt) -- (55.3259pt,43.9688pt) -- (55.3259pt,43.9688pt) arc (
90:180:15.1778pt) -- (40.1481pt,28.791pt) -- cycle;
\node at (50.1481pt,20pt)[below right,color=black]{A};
\draw[color=black,fill=plantucolor0003,line width=1.0pt] (18pt,60.9688pt) arc (180:270:10pt) -- (28pt,50.9688pt) -- (80.6519pt,50.9688pt) arc (270:360:
10pt) -- (90.6519pt,60.9688pt) -- (90.6519pt,62.6094pt) arc (0:90:10pt) -- (80.6519pt,72.6094pt) -- (28pt,72.6094pt) arc (90:180:10pt) -- (18pt,62.6094
pt) -- cycle;
\node at (24pt,55.9688pt)[below right,color=black]{legend text};
\end{tikzpicture}
\end{document}

It is possible to set a specific font size in latex.

In effect... if you had a node with the text 'This is some text'  you can make your node look like this: \node at (0pt,0pt)[below right,color=black]{\fontsize{8pt}{9.6pt}\selectfont{legend text}};

The first value (set above at 8pt) is the font size, the next (9.6) is a line spacing.  Line space in latex is usually 1.2 times the text size.

There is an example latex file on the same link as above (called amended) - its not perfect - the 'A' isn't centered in the node.  That could be a font choice issue.

\usepackage{fontspec}
\setsansfont{Arial}
To the preamble, and then add: {\textsf } around the node - you'll get Arial as your font so can match the java font a bit easier.    Node looks like:

\node at (0pt,0pt)[below right,color=black]{{\textsf\fontsize{8pt}{9.6pt}\selectfont{legend text}}};
(Without the fontspec - you'll at least get a sans font!)
I'm not sure why A is not centering. The positioning maths is beyond me!
 Your name to display (optional): Email me at this address if my answer is selected or commented on: Privacy: Your email address will only be used for sending these notifications. Anti-spam verification: [Antispam2 Feature: please please wait 1 or 2 minutes (this message will disappear) before pressing the button otherwise it will fail](--------) To avoid this verification in future, please log in or register.