2

I need to correct some Linux commands in Latex, I'm currently using the minted library because for me is the better looking one but I can't manage to make too long command break into two parts.

For example:

\documentclass[12pt,english, openany, oneside,a4paper]{article}
\usepackage[utf8]{inputenc}

% Paquetes utilizados en el documento \usepackage[spanish]{babel} \usepackage{minted}

\title{} \author{} \date{}

\begin{document}

\maketitle

\noindent Instalar todas las dependencias necesarias de Home Assistance Superviced \begin{minted}{bash} $ apt-get update && apt-get upgrade && apt-get install jq wget curl avahi-daemon udisks2 libglib2.0-bin network-manager dbus apparmor -y \end{minted}

\end{document}

This code shows the command like this:

enter image description here

Is there someway to make it all fit by breaking it into more lines? I appreciate the help.

1 Answers1

1

As David said, you can just do it:

\begin{minted}{bash}
   $ apt-get update && apt-get upgrade && 
     apt-get install jq wget curl avahi-daemon udisks2 \
        libglib2.0-bin network-manager dbus apparmor -y 
\end{minted}

...which will give the following image. I do not know if automatic line breaking is possible, or desirable (you can break lines semantically by hand).

nice indented code

PD: utf-8 has been the default for a while, so the inputenc package is not needed; but you probably will want T1 font encoding; moreover, if you use Unicode input for Spanish, I heartily suggest to use:

\usepackage[spanish, es-noshorthands, shorthands=off]{babel}

to avoid future problems with active chars (not needed for Spanish if you use Unicode!).

Rmano
  • 40,848
  • 3
  • 64
  • 125