Text FormattingCommand to write "usual" text in LaTeX

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
GenisToii
Posts: 19
Joined: Sat Nov 05, 2011 8:51 pm

Command to write "usual" text in LaTeX

Post by GenisToii »

Hi!

I wanna know which is the command to introduce text with displaymaths or $'s without LaTeX compile them, like in a tutorial or manual of LaTeX. I was searching it in internet but I didn't know how to search it correctly so I ask here.

Sorry for bothering you.
Last edited by GenisToii on Wed Jan 04, 2012 3:20 pm, edited 1 time in total.

Recommended reading 2024:

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

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

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

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

Command to write "usual" text in LaTeX

Post by localghost »

You can do this very simple with the verbatim environment and the \verb command for short in-line code snippets.

There are packages which enhance typesetting of verbatim text.
For more elaborated typesetting of source code for arbitrary programming languages (including LaTeX) with syntax highlighting there are advanced packages.
For details about the capabilities of the packages refer to the corresponding manuals.


Thorsten
User avatar
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

Command to write "usual" text in LaTeX

Post by Stefan Kottwitz »

Hi,

you could use \verb, such as

Code: Select all

\verb|$\sqrt{2}$|
or the verbatim environment for longer texts.

For writing LaTeX code as demonstration, especially if you would like to have syntax highlighting, you could use the showexpl package, or more generally the listings package.

Stefan
LaTeX.org admin
GenisToii
Posts: 19
Joined: Sat Nov 05, 2011 8:51 pm

Re: Command to write "usual" text in LaTeX

Post by GenisToii »

Thanks for the answers but, there's someone that doesn't need that I do the separations in the text?
Because with verbatim enviroment (I use it cause of its a longer text) I have to press enter to separate the text. If there's another possibility please tell me.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Command to write "usual" text in LaTeX

Post by localghost »

Submit a proper minimal example to give us an adequate problem description.
GenisToii
Posts: 19
Joined: Sat Nov 05, 2011 8:51 pm

Command to write "usual" text in LaTeX

Post by GenisToii »

Sorry for answering so late. here it's the example:

Code: Select all

\begin{verbatim}

\no\underline{Sumes inferiors i superiors de Riemann}

\vspace{11pt}

\no Sigui $f\colon[a,b]\Rightarrow\mathbb{R},$ una funció acotada i $P=\{x_0,x_1,x_2,...,
x_n\}$ amb $a=x_0<x_1<x_2<...<x_n=b,$ definim com:

\begin{itemize}
\item \textit{Suma superior de la funció $f$ associada a la partició arbitraria $P$}.
 Expressada algebraicament com S(f,P), és el valor obtingut per: 
\bd
S(f,P) = \sum_{k=1}^{n}M_k(x_k-x_{k-1})
\ed
\no En que $M_k=\sup$ $\{f(x),x\in I_k\},$ que significa que $M_k$ correspon al 
valor de $f(x)$ més elevat de tots els valors possibles obtinguts a partir dels
 diferents valors de $x$ en el subinterval $I_k$.
\end{itemize}

\end{verbatim}
If you see that text, nearly each line had need a [enter] because if I didn't write it the line continues until the infinity and, when I convert it to pdf, the line is cut by the end of the page.
I would like to know how can I write this in verbatim wihtout pressing [enter] in each long text line.

Thanks
Last edited by GenisToii on Tue Jan 03, 2012 1:49 pm, edited 2 times in total.
GenisToii
Posts: 19
Joined: Sat Nov 05, 2011 8:51 pm

Re: Command to write "usual" text in LaTeX

Post by GenisToii »

I have also tryed spverbatim, moreverb, fancyvrb and listing packages but always there are errors and any one lets me to break too long lines of verbatim enviroment...

Help please
GenisToii
Posts: 19
Joined: Sat Nov 05, 2011 8:51 pm

Re: Command to write "usual" text in LaTeX

Post by GenisToii »

It had been solved. I had the both packages (verbatim and spverbatim) and it makes the errors, now it's ok.
Post Reply