Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

For some small macros I'm writing I would need to change the font size relative to the font size of the text that surrounds to macro later on. I only know how to change the font size for the whole document (documentclass/fontspec), or for some text, but only relative to the default font size for the document (\Large, \small).

What I was thinking of was something like:

\newcommand*\mycommand{\smaller ipsum}
\Large lorem \mycommand
\small lorem \mycommand

If I use \Large, \small etc in the command itself, it will not care about the font size of the surrounding text but set the font size relative to the default font size. I would want it to be e.g. 1.2 times smaller than \Large or \small, depending on where it is used.

share|improve this question
    
IMO, adding the macro tag or not was a close call here. –  lockstep May 21 '12 at 15:52
    
After reading the tag description a second time (for another question) I though that it did not fit since the question was not on the "mechanics" of macros, but rather on a specific macro. But you are right...we surely could discuss this –  Andreas Wallner May 21 '12 at 16:22
add comment

1 Answer

up vote 17 down vote accepted

Have a look at the relsize package. Package description:

The basic command of the package is \relsize, whose argument is a number of \magsteps to change size; from this are defined commands \larger, \smaller, \textlarger, etc.

share|improve this answer
    
Thanks, I had stumbled upon this package on some webpage, but the description there was so bad that I thought it was something immitating \Large etc. –  Andreas Wallner May 20 '12 at 20:50
2  
The AMS classes (amsart and amsbook) have a similar built-in mechanism. –  egreg May 21 '12 at 15:50
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.