Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

latex escape chars

I want to prepare a text for the use in a LaTeX document.

I wrote a SQL Function which does a lot of REPLACE. For example _ -> \_ and so on.

But there are so many special chars and sometimes I get errors. Does anyone know a SQL-function or a Java package for escaping text to LaTeX?

like image 272
Uwe Avatar asked Oct 26 '09 17:10

Uwe


People also ask

What is escape character LaTeX?

An escape character—any character with category code 0—tells TeX to switch into a special reading mode and carefully scan (read) the subsequent characters because they identify the name of a command, not text to be typeset.

How do you insert special characters in LaTeX?

LaTeX Spacial Characters If you simply want the character to be printed just as any other letter, include a \ in front of the character. For example, \$ will produce $ in your output. The exception to the rule is the \ itself because \\ has its own special meaning. A \ is produced by typing $\backslash$ in your file.

How do I ignore a special character in LaTeX?

Bookmark this question. Show activity on this post. \ignore{^&%$###___} that outputs exactly ' ^&%$###___ ' in the pdf document?

How do you escape special characters?

Escape CharactersUse the backslash character to escape a single character or symbol. Only the character immediately following the backslash is escaped. Note: If you use braces to escape an individual character within a word, the character is escaped, but the word is broken into three tokens.


2 Answers

There are only 10 special chars: \ { } _ ^ # & $ % ~.

like image 146
Alexey Malistov Avatar answered Sep 19 '22 14:09

Alexey Malistov


Use a verbatim environment or the listings package, then you can enter source code without escaping.

like image 29
Philipp Avatar answered Sep 19 '22 14:09

Philipp