jgm/pandoc

Use plain text writer for texorpdfstring

Open

#9,177 opened on 2023年11月10日

GitHub で見る
 (13 comments) (1 reaction) (0 assignees)Haskell (44,133 stars) (3,850 forks)batch import
enhancementformat:LaTeXgood first issuewriter

説明

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}

コントリビューターガイド