Text Formattingcan`t write some text

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
bci24sg22
Posts: 4
Joined: Sun Mar 22, 2009 4:42 am

can`t write some text

Post by bci24sg22 »

Hello guys!I have a litle problem in latex. I want to write a linux command in latex and i can`t write it like that:

grep -i '^s.*m.*b.*' /usr/dict/words

The problem is ^ and '

Can anyone help me please?

Recommended reading 2024:

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

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

can`t write some text

Post by localghost »

You can write this text in a short verbatim environment.

Code: Select all

\documentclass[11pt,a4paper,english]{article}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage{babel}
\usepackage{lmodern}

\parindent0em

\begin{document}
  \verb|grep -i '^s.*m.*b.*' /usr/dict/words|
\end{document}
For more complex structures you may take a look at the listings package.


Best regards and welcome to the board
Thorsten¹
Post Reply