Generalwriting commands in tex

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
meliahabib
Posts: 9
Joined: Wed Aug 20, 2008 6:53 pm

writing commands in tex

Post by meliahabib »

hi all.
i am writing a tex about latex,so i will write \usepackage{graphics} and other LATEX commands inside the tex as an explanation and not the really use of the command.but i have this error: Error: ! LaTeX Error: Can be used only in preamble.
other question :how can i write è in latex.
so,how can i write them without problem.if someone can help me please.
thanks.

Recommended reading 2024:

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

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

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

writing commands in tex

Post by localghost »

meliahabib wrote:[...] i am writing a tex about latex,so i will write \usepackage{graphics} and other LATEX commands inside the tex as an explanation and not the really use of the command.but i have this error: Error: ! LaTeX Error: Can be used only in preamble. [...]
Depending on what and how you want to write, you can use either listings or showexpl. For simple code in the text you may use the verbatim environment or the short \verb command.

Code: Select all

\begin{verbatim}
  \usepackage{graphicx}
\end{verbatim}

Code: Select all

\verb|\usepackage{graphicx}|
meliahabib wrote:[...] other question :how can i write è in latex. [...]
Accents for characters have a special syntax.

Code: Select all

\`e
But writing "è" in the source directly should be no problem when using inputenc. Refer to its documentation.
meliahabib wrote:[...] so,how can i write them without problem.if someone can help me please. [...]
Some basic LaTeX documentation is given with lshort. In our LaTeX Resources for Beginners you can find other useful documents.


Best regards
Thorsten¹
meliahabib
Posts: 9
Joined: Wed Aug 20, 2008 6:53 pm

Re: writing commands in tex

Post by meliahabib »

thank you very much.
it was a good solution.
but ,i have another question please:
how can i suppress spaces between paragraphs and how can i create a special number of spaces between them.
thanks.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

writing commands in tex

Post by localghost »

meliahabib wrote:[...] how can i suppress spaces between paragraphs and how can i create a special number of spaces between them. [...]
That depends on the settings in your preamble and especially the used document class. Please provide a minimal working example (MWE) that shows the problem.
Post Reply