jgm/pandoc

Use plain text writer for texorpdfstring

Open

#9,177 建立於 2023年11月10日

在 GitHub 查看
 (13 留言) (1 反應) (0 負責人)Haskell (44,133 star) (3,850 fork)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}

貢獻者指南