I used \string\noindent to output a command \noindent, but the result is "noindent.
I also tried with \verb|\noindent| and \texttt{\noindent}, but the results are the same.
I found a question may be related to my problem, but I don't know how to fix it.
Any suggestion is appreciated!
minimal working example:
\documentclass{article}
\usepackage{libertine}
\begin{document}
\verb|\noindent|
\string\noindent
\texttt{\noindent}
\end{document}
Update: I found that this result is because I use libertine font: \usepackage{libertine}. I deleted it and everything is fine. But I am still confused about the principle behind it.
\usepackage[T1]{fontenc}should fix your problem.\texttt{\noindent}presumably doesn't do what you want... – frougon Jun 26 '22 at 07:54\textbackslash– user202729 Jun 26 '22 at 08:08\verb|\noindent|which would have worked even in OT1 encoding – David Carlisle Jun 26 '22 at 10:26