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

3

1 Answer 1

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

2
  • It works! Thanks
    – Yujie
    Nov 8, 2021 at 1:37
  • 1
    @Yujie If the answer solved the problem then please accept the answer by clicking the checkmark next to the answer. Then the Q&A format is completed. Nov 8, 2021 at 1:38

Not the answer you're looking for? Browse other questions tagged .