Math & Scienceset inline math size larger than \scriptstyle

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
CoolnessItself
Posts: 47
Joined: Wed Nov 11, 2009 9:30 pm

set inline math size larger than \scriptstyle

Post by CoolnessItself »

I'm writing in a document that uses sans-serif 10pt. In one section, inline math looked too big, so I used \everymath{\scriptstyle} inside a group to change it locally. But now it looks too small. Is there an in between, or can I set the number of pts manually? Thanks

Code: Select all

\documentclass[10pt]{article}
\usepackage{amsmath}
\renewcommand*{\familydefault}{\sfdefault}
\begin{document}
Default:
{
This is some text with the variable $K=10$ looking too large
}
Textstyle:
{
\everymath{\textstyle}
This is some text with the variable $K=10$ still looking too large
}
Scriptstyle:
{
\everymath{\scriptstyle}
This is some text with the variable $K=10$ looking too small
}
\end{document}
Last edited by cgnieder on Wed Aug 13, 2014 6:17 pm, edited 2 times in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

set inline math size larger than \scriptstyle

Post by Johannes_B »

You shouldn't mix sans serif text with serif math. It looks odd. The eye gets distracted by things like that, tough mostly unconscious.

Better to use sans serif math as well, but be warned that not all symbols might be available in the font.

Code: Select all

\documentclass[10pt]{article}
\usepackage{amsmath}
\usepackage[cm]{sfmath}
\renewcommand*{\familydefault}{\sfdefault}
\begin{document}

Default:
{
	This is some text with the variable K \textit{K} $K=10$ looking too large
}\par
Textstyle:
{%Do you note the different spacing here?
	\everymath{\textstyle}%
	This is some text with the variable $K=10$ still looking too large
}\par
Textstyle:
{
	\everymath{\textstyle}
	This is some text with the variable $K=10$ still looking too large
}\par
Scriptstyle:
{
	\everymath{\scriptstyle}
	This is some text with the variable $K=10$ looking too small
}
\end{document}

Over all, sans serif for longer texts is bad to read. Consider using a serif font in the whole document. If you have to stick to some odd regulations, you should stand up and give them a hint.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Post Reply