Text FormattingMaking a font smaller -not matter the context

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
betaz
Posts: 1
Joined: Sun Mar 22, 2009 10:31 pm

Making a font smaller -not matter the context

Post by betaz »

Hi guys,

I wish to know if there is a way to change the font size respect the context. Suppose that I've a command to write Hello, called \hello. The usual staff to do is

Code: Select all

\newcommand{\hello}{Hel{\small lo}}
Now I want to put it in different contexts, like:

Code: Select all

\section{\hello everybody!}
\subsection{This is another \hello world program}
From the math point of way, 
$$ x_{\textrm{\hello}} = x^2 $$
I don't want this output (the small part being equal-sized all over the places):
Hello everybody!
This is another Hello
From the math point of way,
xHello = x^2

Any ideas?

Thanks in advance,
Beta

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
Stefan Kottwitz
Site Admin
Posts: 10321
Joined: Mon Mar 10, 2008 9:44 pm

Making a font smaller -not matter the context

Post by Stefan Kottwitz »

Hi Beta,

you could use the relsize package with its commands \larger, \smaller, \textlarger, etc.

Stefan
LaTeX.org admin
Post Reply