latex/pdf : output problems for @directive[] in code-blocks directives

Thomas Desvenain avatarThomas Desvenain created an issue

from the rst source :

.. code-block:: xml

    <?xml version="1.0"?>
    <metadata>
      <version>1</version>
      <dependencies>
        <dependency>profile-Products.PloneArticle:default</dependency>
      </dependencies>
    </metadata>

the latex generated is :

\begin{Verbatim}[commandchars=\\\{\}]
\PYG{c+cp}{@textless[]?xml version="1.0"?@textgreater[]}
\PYG{n+nt}{@textless[]metadata}\PYG{n+nt}{@textgreater[]}
  \PYG{n+nt}{@textless[]version}\PYG{n+nt}{@textgreater[]}1\PYG{n+nt}{@textless[]/version@textgreater[]}
  \PYG{n+nt}{@textless[]dependencies}\PYG{n+nt}{@textgreater[]}
    \PYG{n+nt}{@textless[]dependency}\PYG{n+nt}{@textgreater[]}profile-Products.PloneArticle:default\PYG{n+nt}{@textless[]/dependency@textgreater[]}
  \PYG{n+nt}{@textless[]/dependencies@textgreater[]}
\PYG{n+nt}{@textless[]/metadata@textgreater[]}
\end{Verbatim}

so the pdf generated is :

@textless[]?xml version="1.0"?@textgreater[] @textless[]metadata@textgreater[] @textless[]version@textgreater[]1@textless[]/version@textgreater[] @textless[]dependencies@textgreater[] @textless[]dependency@textgreater[]profile-Products.PloneArticle:default@textless[]/dependenc @textless[]/dependencies@textgreater[] @textless[]/metadata@textgreater[]

if we use \directive{} :

\begin{Verbatim}[commandchars=\\\{\}]
\PYG{c+cp}{\textless{}?xml version="1.0"?\textgreater{}}
\PYG{n+nt}{\textless{}metadata}\PYG{n+nt}{\textgreater{}}
  \PYG{n+nt}{\textless{}version}\PYG{n+nt}{\textgreater{}}1\PYG{n+nt}{\textless{}/version\textgreater{}}
  \PYG{n+nt}{\textless{}dependencies}\PYG{n+nt}{\textgreater{}}
    \PYG{n+nt}{\textless{}dependency}\PYG{n+nt}{\textgreater{}}profile-Products.PloneArticle:default\PYG{n+nt}{\textless{}/dependency\textgreater{}}
  \PYG{n+nt}{\textless{}/dependencies\textgreater{}}
\PYG{n+nt}{\textless{}/metadata\textgreater{}}
\end{Verbatim}

we got the correct appearance :

<?xml version="1.0"?>
<metadata>
  <version>1</version>
  <dependencies>
    <dependency>profile-Products.PloneArticle:default</dependency>
  </dependencies>
</metadata>

Comments (4)

  1. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.