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.
General ⇒ writing commands in tex
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
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.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. [...]
Code: Select all
\begin{verbatim}
\usepackage{graphicx}
\end{verbatim}
Code: Select all
\verb|\usepackage{graphicx}|
Accents for characters have a special syntax.meliahabib wrote:[...] other question :how can i write è in latex. [...]
Code: Select all
\`e
Some basic LaTeX documentation is given with lshort. In our LaTeX Resources for Beginners you can find other useful documents.meliahabib wrote:[...] so,how can i write them without problem.if someone can help me please. [...]
Best regards
Thorsten¹
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
-
- Posts: 9
- Joined: Wed Aug 20, 2008 6:53 pm
Re: writing commands in tex
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.
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.
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
writing commands in tex
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.meliahabib wrote:[...] how can i suppress spaces between paragraphs and how can i create a special number of spaces between them. [...]
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10