0
\documentclass[a4paper,12pt,oneside]{report} 

\usepackage{OvidiusFMI}
\usepackage{times}
\usepackage{graphicx}
\usepackage{hyperref}
\usepackage{color,xcolor}
\usepackage{framed}
\usepackage{enumerate}
\usepackage{listings}
\usepackage{amsmath,amsfonts,amssymb,amsthm,epsfig,epstopdf,url,array}
\usepackage{multicol,multirow}
\usepackage{needspace}
\include{custom-lst-style}
%these are all packages im using

\begin{document}
  \begin{lstlisting}
   npm install @material-ui/core
  \end{lstlisting}
\end{document}

I have to add a lstlisting to my latex.

Original text : npm install @material-ui/icons

Latex text: npm install material-ui/icons (no @ symbol)

How could I fix this issue?

MiRAY
  • 188
  • 2
  • 15
  • Can you make a [mre]? By default this works fine. Maybe you set up listings to use @ as escape character? – samcarter_is_at_topanswers.xyz Jun 27 '21 at 20:21
  • this is the code i wrote in TeXstudio: \begin {lstlisting} nmp install @material-ui/core \end{lstlisting} . In the output PDF, i don't see @ symbol – MiRAY Jun 27 '21 at 20:28
  • Please make a compilable [mre] that starts with a documentclass and ends with `\end{document}` so we can reproduce the problem. – samcarter_is_at_topanswers.xyz Jun 27 '21 at 20:30
  • This works without problem: `\documentclass{article} \usepackage{listings} \begin{document} \begin{lstlisting} npm install @material-ui/icons \end{lstlisting} \end{document}` So we really must see your code to see what's going wrong there – samcarter_is_at_topanswers.xyz Jun 27 '21 at 20:31
  • I'm also using a custom package, perhaps it is getting me in trouble. However I managed to pass this problem by adding a screenshot of the code I need, but I'm still curious why I cannot add @ – MiRAY Jun 27 '21 at 20:38
  • what does `custom-lst-style.tex` contain? – samcarter_is_at_topanswers.xyz Jun 27 '21 at 20:40
  • Oh, I've inspected it and found \lstset{escapechar=@,style=customc}. This is a predefined lst-style I'm using for my project. Thank you, now I understood. You should post an answer, so I could accept it. – MiRAY Jun 27 '21 at 20:41

1 Answers1

1

Problem was solved due to user:2777074's crystall ball. If you will encounter such things like I had ( not displaying a character), you should check for your listing styles.

In my case I was using \include{custom-lst-style} that had the next line of code:\lstset{escapechar=@,style=customc} and because of that I was unable to display @ character.

MiRAY
  • 188
  • 2
  • 15