1

How to output -- in Latex. When I use it directly, it will only show a -. I added transliterated characters in front, but they all reported errors.

When I put it in a mathematical environment, it becomes lscpu − −extend.

Thanks

Yujie
  • 175
  • http://www.emerson.emory.edu/services/latex/latex_155.html#:~:text=If%20you%20simply%20want%20the,%24%5Cbackslash%24%20in%20your%20file. -- https://en.wikibooks.org/wiki/LaTeX/Special_Characters – js bibra Nov 08 '21 at 01:28
  • Thank you! But the special characters on the website do not seem to contain -. Only underscore. – Yujie Nov 08 '21 at 01:31
  • +1: FYI, this question is very related:https://tex.stackexchange.com/questions/36692 – Dr. Manuel Kuehner Nov 08 '21 at 02:12

1 Answers1

3
\documentclass{article}
% https://tex.stackexchange.com/questions/621751

\begin{document}

\Huge
\begin{itemize}
    \item -- (\texttt{-\,-}) % You do not want that.
    \item -\,- (\texttt{-\textbackslash,-}) % Maybe better.
    \item -\kern 0pt- (\texttt{-\textbackslash kern 0pt-}) % Maybe better.
\end{itemize}
% See also https://tex.stackexchange.com/questions/74353
% and https://tex.stackexchange.com/questions/53413.

\end{document}

enter image description here


Update: I found a related question: How do I prevent LaTeX from creating en-dash and em-dash?. Especially the answer of Werner seems to be suitable for your situation.

enter image description here