TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
3  
Welcome to TeX.SX! Are you perhaps looking for \verb|X5O!P%@AP[4\PZ...$H+H*|? – egreg Mar 28 at 13:03
    
Thank you ! it works too but the font has changed, is there a way to keep the same font ? – Black Diamond Mar 28 at 13:08
    
Would this be relevant? "Change typeface of verbatim environment" See also: "Using same font for \texttt and \Verb" – Davïd Mar 28 at 13:11
up vote 3 down vote accepted

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

share|improve this answer

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

share|improve this answer
    
Thank you very much for the useful answer (y) – Black Diamond Mar 28 at 12:58
    
\@ surely does not produce @. – Henri Menke Mar 28 at 13:05
    
that's true I just noticed, what to do to include @ ? – Black Diamond Mar 28 at 13:09
    
Just type @. It's that easy. – Henri Menke Mar 28 at 13:09
    
loool thank you – Black Diamond Mar 28 at 13:10

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.