Overleaf 无法通过管道进入源代码的 lstlisting 块

Overleaf 无法通过管道进入源代码的 lstlisting 块
% %%%% Code Snippet START: %%%%
\begin{lstlisting}[language=bash]
grep ^hello t.txt  # ok
grep ^hello t.txt | grep bye  # NOT SHOW THE PIPE!
grep ^hello t.txt \| grep bye  # NOT SHOW THE PIPE!
\end{lstlisting}
% %%%% Code Snippet END.   %%%%

注意。JSON 代码片段在“{”、“}”和“”上存在类似问题。


乳胶头

我正在使用的文档模板。

\documentclass[conference]{IEEEtran}
%\IEEEoverridecommandlockouts
% The preceding line is only needed to identify funding in the first footnote. If that is unneeded, please comment it out.
%\usepackage{cite}
\usepackage{amsmath,amssymb,amsfonts}
\usepackage{algorithmic}
\usepackage{graphicx}
\usepackage{booktabs}
\usepackage{textcomp}
\usepackage{listings}
\usepackage[scaled]{beramono}
\usepackage{xcolor}
\usepackage[backend=biber,
            style=ieee,
            uniquename=init,
            %giveninits,
            %repeatfields,
            %justify,
            %noslsn
            ]
            {biblatex}
            


%\urlstyle{same}

\addbibresource{referencias.bib}

\def\BibTeX{{\rm B\kern-.05em{\sc i\kern-.025em b}\kern-.08em
    T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}}

\definecolor{dkgreen}{rgb}{0,0.6,0}
\definecolor{Gray}{gray}{0.9}


\lstdefinestyle{SQL-Smarzaro}{%
    language=SQL,
    showspaces=false,
    showstringspaces=false,
    basicstyle=\small\ttfamily,
    %    numbers=left,
    numberstyle=\tiny,
    commentstyle=\color{gray},
    upquote=true,
    breaklines=true,
    morekeywords={*,REFERENCES,RENAME,TO,DATABASE,SCHEMA,IF,USE,REPLACE,REFRESH,MATERIALIZED, TYPE,
        BEFORE, AFTER, INSTEAD, OF, FOR, EACH, ROW, DO, STATEMENT, RULE, FUNCTION, PROCEDURE, WITH,...},
    keywordstyle=\color{blue}\bfseries,
    %frame=ltrb,
    backgroundcolor=\color{gray!20},
    inputencoding=latin1,
    extendedchars=true,
    %   autogobble=true,
    %escapeinside={(*}{*)},          % if you want to add LaTeX within your code
    stringstyle = {\color{dkgreen}},
    %postgis
    morekeywords = [2]{st_distance, st_setsrid, st_point, st_transform, st_within, st_geogfromtext, st_area, st_contains, st_nrings, st_exteriorring, st_interiorringn,st_perimeter, st_npoints, st_endpoint, st_startpoint, st_length, st_X, st_Y, st_geometryn, st_numgeometries, multipoint, multilinestring, multipolygon, geometrycollection, polygon, linestring, point, st_covers, st_coveredby,st_geomfromtext, st_crosses, st_srid, st_setsrid, st_makepoint, st_pointfromtext,ST_LineFromText,st_IsSimple,st_IsValid, st_isclosed, st_isring, geography, geometry, st_equals,ST_OrderingEquals,st_disjoint,st_intersects, st_overlaps, st_touches,st_ContainsProperly, st_dwithin,st_relate,st_MakeLine, st_Union, st_Collect, st_Polygonize, st_centroid},
    keywordstyle = [2]{\color{blue}},
}


\lstset{style=SQL-Smarzaro,
    literate=
    {á}{{\'a}}1 {é}{{\'e}}1 {í}{{\'i}}1 {ó}{{\'o}}1 {ú}{{\'u}}1
    {Á}{{\'A}}1 {É}{{\'E}}1 {Í}{{\'I}}1 {Ó}{{\'O}}1 {Ú}{{\'U}}1
    {à}{{\`a}}1 {è}{{\`e}}1 {ì}{{\`i}}1 {ò}{{\`o}}1 {ù}{{\`u}}1
    {À}{{\`A}}1 {È}{{\'E}}1 {Ì}{{\`I}}1 {Ò}{{\`O}}1 {Ù}{{\`U}}1
    {ä}{{\"a}}1 {ë}{{\"e}}1 {ï}{{\"i}}1 {ö}{{\"o}}1 {ü}{{\"u}}1
    {Ä}{{\"A}}1 {Ë}{{\"E}}1 {Ï}{{\"I}}1 {Ö}{{\"O}}1 {Ü}{{\"U}}1
    {â}{{\^a}}1 {ê}{{\^e}}1 {î}{{\^i}}1 {ô}{{\^o}}1 {û}{{\^u}}1
    {Â}{{\^A}}1 {Ê}{{\^E}}1 {Î}{{\^I}}1 {Ô}{{\^O}}1 {Û}{{\^U}}1
    {Ã}{{\~A}}1 {ã}{{\~a}}1 {Õ}{{\~O}}1 {õ}{{\~o}}1
    {œ}{{\oe}}1 {Œ}{{\OE}}1 {æ}{{\ae}}1 {Æ}{{\AE}}1 {ß}{{\ss}}1
    {ű}{{\H{u}}}1 {Ű}{{\H{U}}}1 {ő}{{\H{o}}}1 {Ő}{{\H{O}}}1
    {ç}{{\c c}}1 {Ç}{{\c C}}1 {ø}{{\o}}1 {å}{{\r a}}1 {Å}{{\r A}}1
    {€}{{\euro}}1 {£}{{\pounds}}1 {«}{{\guillemotleft}}1
    {»}{{\guillemotright}}1 {ñ}{{\~n}}1 {Ñ}{{\~N}}1 {¿}{{?`}}1
}

\colorlet{punct}{red!60!black}
\definecolor{background}{HTML}{EEEEEE}
\definecolor{delim}{RGB}{20,105,176}
\colorlet{numb}{magenta!60!black}

\begin{document}
...
\end{document}

相关内容