Sorry for the cross-posting if any. I'm trying to use minted to print the XML file.
\title{My document}
\author{Mr. World}
\date{\today}
\documentclass[a4paper, 12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage[cache=false]{minted}
\usepackage{tcolorbox}
\usepackage{etoolbox}
\setminted{
linenos=true,
autogobble,
}
% Create a new environment for breaking code listings across pages.
\newenvironment{longlisting}{\captionsetup{type=listing}}{}
\usepackage{ragged2e}
%\BeforeBeginEnvironment{minted}{\begin{tcolorbox}}%
%\AfterEndEnvironment{minted}{\end{tcolorbox}}%
\usepackage{xcolor}
\usepackage{amsmath, amsthm, amssymb}
\usepackage{graphicx, color, subfigure, caption, epsfig}
%\usepackage{subcaption}
\usepackage{stfloats}
\PassOptionsToPackage{hyphens}{url}\usepackage{hyperref}
\usepackage{url}
\usepackage{cite}
\usepackage[T1]{fontenc} % this is needed for correct output of umlauts in pdf
\usepackage[margin=2cm]{geometry} %layout
\usepackage{array}
\usepackage{multirow}
\usepackage[ruled,vlined]{algorithm2e}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\begin{document}
%\renewcommand{\theFancyVerbLine}{
% \sffamily\textcolor[rgb]{0.5,0.5,0.5}{\scriptsize\arabic{FancyVerbLine}}}
\maketitle
\section{What a start}
\begin{longlisting}
\inputminted[linenos, numbersep=5pt, tabsize=4, frame=lines, fontsize=\footnotesize, breaklines, breakanywhere, breaksymbolleft=\carriagereturn]{xml}{test.xml}
\caption{Reference file:\mintinline{bash}{test.xml}}
\end{longlisting}
\end{document}
Here is the test.xml file:
<abcd xmlns="abed">
<blah-blah-blah xmlns="abcd">
<moreblah>abcd:efghi:jklmno:prqrst:uvwxyz:xyz?module=abcd&revision=1900-01-01</moreblah>
<moreblah>abcd:efghi:jklmno:prqrst:uvwxyz:xyzlmop?module=qrst&revision=1900-01-02</moreblah>
</blah-blah-blah>
When I compile the latex, this is the error I get:
! Undefined control sequence.
\FancyVerbBreakSymbolLeft ->\carriagereturn
l.4 ...{}01\PYG{n+nt}{\PYGZlt{}/moreblah\PYGZgt{}}
? r
OK, entering \nonstopmode...
! Undefined control sequence.
\FancyVerbBreakSymbolLeft ->\carriagereturn
l.5 ...{}02\PYG{n+nt}{\PYGZlt{}/moreblah\PYGZgt{}}
I couldn't figure out what was the issue. But after long, trial and error, I figured that the breaklines was causing this issue. However, when I remove it, these errors disappear, but also the lines does not break.
Can someone point me what is the issue here? I have looked all resources, but couldn't figure out the solution.
Some resources: XML breaklines, breaklines at any characters
\breaksymbolleftargument and errors disappear. – jujuBee Nov 27 '19 at 15:28