4

I just started using LaTeX and I have a problem including this in my file:

X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*

is there some kind of a "de-specialized" environment?

Dɑvïd
  • 465

3 Answers3

6

You have many special symbols in your line of text. These special symbols mean something in LaTeX like any other programming language. So, you should take care when writing these symbols, e.g., \ precedes macros in LaTeX, $ means begin math mode, {,} are used to group expressions, etc.

There is also the \verb| ... | macro or its environment \begin{verbatim} ... \end{verbatim} if you don't mind using the typewriter typeface.

Also, you can add

\makeatletter
\def\verbatim@font{\normalfont}
\makeatother

and use the same font within \verb too.

\documentclass{article}
\makeatletter
\def\verbatim@font{\normalfont}
\makeatother
\begin{document}

X5O!P\%@AP[4\textbackslash PZX54(P\textasciicircum)7CC)7\}\$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!\$H+H*

\verb|X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*|

\end{document}

enter image description here

AboAmmar
  • 46,352
  • 4
  • 58
  • 127
4

Package url:

\documentclass{article}
\usepackage{url}
\DeclareUrlCommand\despecialized{\urlstyle{same}}
\begin{document}
\despecialized|X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*|
\end{document}

Result

Heiko Oberdiek
  • 271,626
2

Use the listings package to include literal content. The vertical bar | after \lstinline is the delimiter of the literal content. It mustn't appear among the characters in your string.

\documentclass{article}
\usepackage{listings}
\begin{document}
\lstinline|X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*|
\end{document}

enter image description here

Henri Menke
  • 109,596