Hello I was trying to put '\n' on codeblock, and I have just realized that my apostrophe is in weird direction when in codeblock
I wanted something like
The code was
\documentclass{report}
\usepackage{xcolor}
\usepackage{listings}
\usepackage{float}
\usepackage{amsmath}
\usepackage[a4paper,margin=1in,footskip=0.25in]{geometry}
\usepackage{tcolorbox}
\usepackage{tikz}
\usepackage{scrextend}
\tcbuselibrary{breakable}
\definecolor{blue-green}{rgb}{0.0, 0.87, 0.87}
\colorlet{mygray}{black!30}
\colorlet{mygreen}{green!60!blue}
\colorlet{mymauve}{red!60!blue}
\lstset{
mathescape,
backgroundcolor=\color{gray!10},
basicstyle=\ttfamily,
columns=fullflexible,
breakatwhitespace=false,
breaklines=true,
captionpos=b,
commentstyle=\color{mygreen},
extendedchars=true,
frame=single,
keepspaces=true,
keywordstyle=\color{blue},
language=c++,
numbers=none,
numbersep=5pt,
numberstyle=\tiny\color{blue},
rulecolor=\color{black},
showspaces=false,
showstringspaces=false,
showtabs=false,
stepnumber=5,
stringstyle=\color{magenta},
% morecomment=[l][\color{red}]{#},
tabsize=3,
title=\lstname,
emph = {true,false},
emphstyle = {\color{cyan}},
}
\begin{document}
test
\begin{lstlisting}
'\n'
\end{lstlisting}
\end{document}
(This is not just in codeblock but always like this. But I want to know how to use in codeblock.)

upquote=trueto the list of arguments of\listset. See section 4.3.6. of the user guide of thelistingspackage for more information. Actually, the remark in that section that it's necessary to load thetextcomppackage is no longer correct; some years ago, if I recall correctly, much of the functionality of thetextcomppackage was folded into the LaTeX kernel. – Mico Jan 29 '22 at 11:23\lstset, not\listset... I've looked up whentextcompwas folded into the LaTeX kernel; it would appear to have occurred with the2020/02/02release. – Mico Jan 29 '22 at 11:37