2

I have a minted block as follows:

\documentclass{article}

\usepackage{minted}
\usepackage{listings}

\begin{document}

    \begin{listing}[ht]
    \begin{minted}{xml}

    <plugin>
      <groupId>maven.plugin</groupId>
      <artifactId>maven-plugin</artifactId>
      <version>1.1.1</version>
      <configuration>   
        <tipo>\${env.TEST}</tipo>
      </configuration>
      <executions>
        <execution>
          <phase>xxxx</phase>
          <goals>
            <goal>xxx</goal>
          </goals>
        </execution>
      </executions>
    </plugin>

    \end{minted}
    \caption{Maven plugin XML code}
    \label{pomsinau}
    \end{listing}

\end{document}

I am using the escape bar \ to the symbol of dollar $, but the latex is displaying the symbol $ along with the escape character in the output:

How do I remove the escape bar at the output and leave only the symbol $?

enter image description here

  • 1
    In “verbatim” environments you don't need to escape special characters. – egreg Oct 9 '15 at 20:15
4

Simply use $:

\documentclass{article}

\usepackage{minted}
\usepackage{listings}

\begin{document}

    \begin{listing}[ht]
    \begin{minted}{xml}

    <plugin>
      <groupId>maven.plugin</groupId>
      <artifactId>maven-plugin</artifactId>
      <version>1.1.1</version>
      <configuration>   
        <tipo>${env.TEST}</tipo>
      </configuration>
      <executions>
        <execution>
          <phase>xxxx</phase>
          <goals>
            <goal>xxx</goal>
          </goals>
        </execution>
      </executions>
    </plugin>

    \end{minted}
    \caption{Maven plugin XML code}
    \label{pomsinau}
    \end{listing}

\end{document}

enter image description here

  • Thank​ you so much for your help Gonzalo Medina, now it's all working! – ricardoramos Oct 9 '15 at 18:20

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.