jgm/pandoc

Use plain text writer for texorpdfstring

Open

#9.177 aberto em 10 de nov. de 2023

Ver no GitHub
 (13 comments) (1 reaction) (0 assignees)Haskell (3.850 forks)batch import
enhancementformat:LaTeXgood first issuewriter

Métricas do repositório

Stars
 (44.133 stars)
Métricas de merge de PR
 (Mesclagem média 7d) (7 fundiu PRs em 30d)

Description

Example

## Test (\High)

We use the following in reports to indicate that an issue has a High severity. The \High macro is defined in our latex template and basically makes it red:

image

The relevant part of the AST is

        [
          {
            "t": "Str",
            "c": "Test"
          },
          {
            "t": "Space"
          },
          {
            "t": "Str",
            "c": "("
          },
          {
            "t": "RawInline",
            "c": [
              "tex",
              "\\High"
            ]
          },
          {
            "t": "Str",
            "c": ")"
          }
        ]

I have a lua filter that transforms it into

        [
          {
            "t": "Str",
            "c": "Test"
          },
          {
            "t": "Space"
          },
          {
            "t": "Str",
            "c": "("
          },
          {
            "t": "RawInline",
            "c": [
              "tex",
              "\\High"
            ]
          },         
         {
            "t": "RawInline",
            "c": [
              "plain",
              "High"
            ]
          },
          {
            "t": "Str",
            "c": ")"
          }
        ]

My hope was the plain version would be used inside the second argument of texorpdfstring, however it isn't.

When converted to latex I get:

\subsection{\texorpdfstring{Test (\High)}{Test ()}}\label{test}

I would like:

\subsection{\texorpdfstring{Test (\High)}{Test (High)}}\label{test}

Guia do colaborador