LaTeX forum ⇒ Text Formattingnewcommand define among others the font size

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

newcommand define among others the font size

Postby aurorax » Thu Feb 11, 2016 12:43 pm

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:

  1. \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

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

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


User avatar
Site Moderator
Posts: 1974
Joined: Sat Apr 16, 2011 7:27 pm
Location: Germany

Postby cgnieder » Sat Feb 13, 2016 12:53 am

You can load the package relsize and use its commands \smaller or \textsmaller.

chemmacros · chemformula · leadsheets · xsim

Return to “Text Formatting”

Who is online

Users browsing this forum: No registered users and 8 guests