General ⇒ writing commands in tex
-
- Posts: 9
- Joined: Wed Aug 20, 2008 6:53 pm
writing commands in tex
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.
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
- 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¹
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
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. [...]
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10