0

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&amp;revision=1900-01-01</moreblah>
    <moreblah>abcd:efghi:jklmno:prqrst:uvwxyz:xyzlmop?module=qrst&amp;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

jujuBee
  • 103

1 Answers1

1

You are trying to use a custom breaksymbolleft set to \carriagereturn, but \carriagereturn is not defined. You can add \usepackage{dingbat} to your preamble to get a \carriagereturn symbol. However, given the direction that this arrow points, the \carriagereturn symbol may not be what you want; you may want \reflectbox{\carriagereturn}. It's also possible that you will want a custom breaksymbolright or breakanywheresymbolpre.

G. Poore
  • 12,417
  • Thank you very much ! For now, I have removed the \breaksymbolleft argument and errors disappear. – jujuBee Nov 27 '19 at 15:28