# Why is my prime symbol too low? And: Why are my subscripts not scaled accordingly when I use \scriptsize?

I have two (maybe simple) questions concerning the following LaTeX document

\documentclass{scrartcl}
\usepackage[ansinew]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{tikz}
\usepackage{pgfplots}
\usetikzlibrary{intersections, calc}

\makeatletter
\DeclareMathSizes{\@xipt}{\@xipt}{6}{5}
\makeatother

\begin{document}
This is a nice picture with $\underline{U}_\mathrm{N}$, $U_\mathrm{L}$, $\varphi_\mathrm{U}$ and $\varphi_\mathrm{L}.$

\begin{tikzpicture}
\def\angle{acos(0.95)}

\draw[->, name path=ul] (0,0) --  (5,0) coordinate (A) node[near end, anchor=north] {$U_\mathrm{L}$};
\draw[->, name path=ux] (A) -- +({90-\angle}:3) coordinate (B) node[midway, anchor=west] {$\mathrm{j} \, X_\mathrm{N} \, \underline{I}$};
\draw[->, name path=un] (0,0) -- (B) node[near end, anchor=south east] {$\underline{U}_\mathrm{N}$};
\draw[->, name path=i] (0,0) -- +({-\angle}:1.5) coordinate (C) node[near end, anchor=north east] {$\underline{I}$};

\path (0,0) let \p1 = ($(B)$) in +(15:{veclen(\x1,\y1)}) coordinate (D);
\draw[gray, dashed, name path=circ] let \p1 = ($(B)$) in (D) arc (15:50:{veclen(\x1,\y1)});

\draw[->, gray, name path=ii] (C) -- +({-\angle}:0.5) coordinate (CC) node[anchor=north east] {$\underline{I}'$};
\draw[->, gray, name path=uull] (0,0) -- (4,0) coordinate (AA) node[near end, anchor=south] {$U'_\mathrm{L}$};
\path[name path=uuxx] (AA) -- +({90-\angle}:8);
\draw[->, gray, name intersections={of=uuxx and circ}] (AA) -- (intersection-1) coordinate (BB);
\draw[->, gray, name path=uunn] (0,0) -- (BB) node[near end, anchor=south east] {$\underline{U}'_\mathrm{N}$};

\draw[->] (1,0) let \p1 = ($(B)$) in arc (0:{atan(\y1/\x1)}:1) node[midway, anchor=west] {\scriptsize{$\varphi_\mathrm{U}$}};
\draw[->] (1,0) let \p1 = ($(C)$) in arc (0:{atan(\y1/\x1)}:1) node[near end, anchor=west] {\scriptsize{$-\varphi_\mathrm{L}$}};
\end{tikzpicture}

\end{document}}

which yields something like the following:

1. Why is the prime symbol of $U'_\mathrm{L}$ in the tikzpicture lower than it is for the $\underline{U}'_\mathrm{N}$? (The latter prime positioning seems correct to me...) Obviously, this must have something to do with the \underline command - but what can I do to solve the problem of this prime symbol misplacement? Raising the prime symbol by writing $U^{'}_\mathrm{L}$ lifts it too high - and is most probably not the optimal way of solving this problem anyway.
2. I used \DeclareMathSizes{\@xipt}{\@xipt}{6}{5} to reduce the size of subscripts and subsubscripts in math mode. However, this seems not to work when I use \scriptsize{} in the math environment as one can see from the angle label: The U and the L in the angle labels are appreciably bigger than they are in the text line above the diagram. I guess that this is because of my "static" setting in \DeclareMathSizes{\@xipt}{\@xipt}{6}{5} where I set the sizes to the fixed values of 6 and 5? If so, how can I reduce the size of subscripts and subsubscripts in math mode in a more flexible way? Writing \DeclareMathSizes{\@xipt}{\@xipt}{0.8*\@xipt}{0.7*\@xipt} didn't work...
• You are requesting that subscripts when the main size is 11pt are at 6pt, so they're too small next to a 11pt sized symbol. Not too low: too small. – egreg Mar 17 '14 at 12:41
• Not sure this quite fixes your problem but you can at least make the prime marks consistent with $\smash{\underline{U}}'_\mathrm{L}$}. This makes TeX ignore the extra height generated by the \underline, but the prime marks are then both lower. – Thruston Mar 17 '14 at 12:42
• 80% of 11pt is 8.8pt, and the standard first level sub/superscript size for 11pt is 8pt. Of course you need arbitrarily scalable fonts for this to work (\usepackage{lmodern}, for instance); just do the math: \DeclareMathSizes{\@xipt}{\@xipt}{8.8}{7.7} (but these values are too big). – egreg Mar 17 '14 at 12:52
• @egreg Thanks for your comment! Ok, I understand it's a problem of "too small" instead of "too low" resulting from my custom math size declaration. But what simple thing can I do if I would like to have smaller subscripts while retaining normal sized superscripts? The trouble is that -- in my opinion -- standard sized capital letters in a subscript frequently look too big when they are used with a small letter main symbol. – Sven Rüberg Mar 17 '14 at 15:19

The prime symbols are not too low, they're too small: you're requesting that first level sub/superscripts are 6pt, which is too small next to an 11pt size symbol.

Computing 80% of 11pt gives 8.8pt, and the standard first level sub/superscript size for 11pt is 8pt. Of course you need arbitrarily scalable fonts for this to work (\usepackage{lmodern}, for instance); just do the math:

\DeclareMathSizes{\@xipt}{\@xipt}{8.8}{7.7}

(but these values are too big, in my opinion and I'd leave the default). The font size used for subscripts is the same as the size used for superscripts and this can't be avoided. You can force big subscripts (typically uppercase letters) to be pushed a bit down by specifying a dummy superscript: compare

$a_{X} a^{}_{X}$

• I think the OP's problem is mainly with the 0.8 scaling factor when going from textstyle to scriptstyle. In Computer Modern -- not sure about other font families that provide math support -- the scaling factor is 0.7 to go from textstyle to scriptstyle, and again 0.7 to go from scriptstyle to scriptscriptstyle, for a combined reduction of (ca) 50%. Applying the CM method, shouldn't the OP apply the command \DeclareMathSizes{\@xipt}{\@xipt}{7.7}{5.4}? (FWIW, I believe basic LaTeX uses \DeclareMathSizes{\@xipt}{\@xipt}{8}{6}.) – Mico Apr 26 '14 at 9:47
• @Mico The factor is only related to the specific question (see last line in it) – egreg Apr 26 '14 at 9:49
• Thanks. I just re-read the question and your answer, and realized that you were mainly explaining the problem in the OP's setup and not advocating that one should do so. :-) – Mico Apr 26 '14 at 9:51