3

I'm like the syntax highlighting of minted but cannot get it to mimic the "more pleasing" line breaks for long code strings found in listings.

In the example below, I have three snippets: the first is the way I would like minted to look but can only achieve it in listings; the second, is how minted is displaying the code; and the third, is an attempt to change the breakafter variable in minted (but still to no avail). What I'm specifically wanting, is minted not to break again at the space in beteeen the space after the long URL and the proceeding forward slash.

Any help is appreciated. Thanks.

enter image description here

\documentclass{article}
\usepackage[english]{babel}

\usepackage{minted}
\usepackage{pifont}
\usepackage{color}
\usepackage{listings}
\lstset{
    breaklines=true,
    prebreak=\raisebox{0ex}[0ex][0ex]{\footnotesize\color{red}\ensuremath{_\rfloor}},
    postbreak=\raisebox{0ex}[0ex][0ex]{\ensuremath{\color{red}\hookrightarrow\space}}
}
\begin{document}

\begin{lstlisting}
RUN curl -L -o /tmp/${package_name}.zip http://www.bioinformatics.babraham.ac.uk/projects/fastqc/${package_name}.zip \
  && cd /usr/local \
  && unzip /tmp/${package_name}.zip \
  && chmod 755 /usr/local/FastQC/fastqc \
  && rm -rf /tmp/*
\end{lstlisting}

\begin{minted}[breaklines]{text}
RUN curl -L -o /tmp/${package_name}.zip http://www.bioinformatics.babraham.ac.uk/projects/fastqc/${package_name}.zip \
  && cd /usr/local \
  && unzip /tmp/${package_name}.zip \
  && chmod 755 /usr/local/FastQC/fastqc \
  && rm -rf /tmp/*
\end{minted}

\begin{minted}[breaklines,breakafter=/]{text}
RUN curl -L -o /tmp/${package_name}.zip http://www.bioinformatics.babraham.ac.uk/projects/fastqc/${package_name}.zip \
  && cd /usr/local \
  && unzip /tmp/${package_name}.zip \
  && chmod 755 /usr/local/FastQC/fastqc \
  && rm -rf /tmp/*
\end{minted}

\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.