## LaTeX forum ⇒ Text Formatting ⇒ newcommand define among others the font size

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
aurorax
Posts: 1
Joined: Thu Feb 11, 2016 12:37 pm

### newcommand define among others the font size

Hello to everybody.

I am defining some new commands related to the color of my word but I want that each time I use it, the text font size get smaller than what it actually is. Could I redefine the font size inside this expression:

`\newcommand{\KeywordTok}[1]{\textcolor[rgb]{0.13,0.29,0.53}{\textbf{{#1}}}}`

The easy way would be to use tiny or scalebox each time I use my new commands but then latex doesn't respect the line breaks

`\scalebox{.4}{ \KeywordTok{library}\NormalTok{( }\StringTok{"caret"} \NormalTok{)  }\KeywordTok{library}\NormalTok{( }\StringTok{"plyr"} \NormalTok{)}\KeywordTok{set.seed}\NormalTok{( }\DecValTok{23} \NormalTok{)}\CommentTok{# The data set is named as `df`} }`

Thank you very much for any advice
Last edited by cgnieder on Sat Feb 13, 2016 12:52 am, edited 1 time in total.

Tags:

cgnieder
Site Moderator
Posts: 1985
Joined: Sat Apr 16, 2011 7:27 pm
Location: Germany
Contact:
You can load the package relsize and use its commands `\smaller` or `\textsmaller`.

Regards
Clemens
------------------------------
chemmacros · chemformula · leadsheets · xsim