Text Formattingnewcommand define among others the font size

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

newcommand define among others the font size

Post by aurorax »

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:

Code: Select all

\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

Code: Select all

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

Recommended reading 2024:

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

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

newcommand define among others the font size

Post by cgnieder »

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

Regards
site moderator & package author
Post Reply