LaTEX Tutorials

Text Styling in LaTeX

1. How to change the text style in LaTeX?

The following commands can be used to highlight texts in documents. 

         1. \textbf{}  : to make the text bold 

         2. \textit{}   : to make the text italic 

         3. \textsl{}   : to make the text slanted

         4. \textsc{}  : to make the text small cap 

         5. \underline{} : to underline the text 

         6. \texttt{} : for typewriter font 

         7. \textrm{} : for Roman font

        8. \textsf{} : for Sans Serif font 

 Also, we can use {\em   text}, {\bf   text} to create texts in italic and bold font. 

\textbf{to make the text bold} 
\textit{to make the text italic}
\textsl{to make the text slanted}
\textsc{to make the text small cap} 
\underline{to underline the text} 
\texttt{for typewriter font}
\textrm{for roman font} 
\textsf{for Sans Serif font} 

2. How to change the font size in LaTeX?

To modify the font size, the following commands can be used. 

         1. {\tiny} : for the smallest font size 

         2. {\small} : for small font size 

         3. {\large} : for large font (note small ‘l’ in ‘large’)

         4. {\Large} : little bigger than the previous large

         5. {\LARGE} : little more bigger than the previous large

         6. {\huge} : little more bigger than the previous large

         7. {\Huge} : little bigger than the previous ‘huge’

{\tiny This is a simple sentence.} 
{\small This is a simple sentence.}
{\large This is a simple sentence.}
{\Large This is a simple sentence.} 
{\LARGE This is a simple sentence.}
{\huge This is a simple sentence.}
{\Huge This is a simple sentence.} 

You can use the above code to create text with varying font. We use the curly brackets to set the environment for modifying the default document style.

3. How to set the text alignment in LaTeX?

A text in a document can be aligned in three ways. They are: center, left, and right justifications. It can be achieved using the following ways. We can use center, flushleft, or flushleft to create the environment for text justification. 

   1. Center justified: 

          \begin{center} 

            Text here ……….

          \end{center} 

   2. Left justified: 

          \begin{flushleft} 

            Text here ……..

          \end{flushleft} 

  3. Right justified: 

          \begin{flushright} 

            Text here ………….

          \end{flushright} 

\begin{center}
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna. Donec vehicula augue eu neque. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas
\end{center}

\begin{flushleft}
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna. Donec vehicula augue eu neque. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas
\end{flushleft}

\begin{flushright}
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna. Donec vehicula augue eu neque. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas
\end{flushright}

Need Help?

If you need any further clarification or assistance in LaTeX coding, you are free to contact us.