hyperref 表单跨越多个 markdown 部分?

hyperref 表单跨越多个 markdown 部分?

begin{Form}如果中间没有 markdown 语法,则end{Form}当前可以工作:markdown

\begin{Form}
\TextField[name=Title, width=0.87\textwidth, bordercolor=black, value = {Some default value}]{Title:}
\end{Form}

但是,只要我end{Form}向下移动到 markdown 文档的末尾以覆盖多个表单字段,它就会停止工作:

---
title: "Test Latex Form"
geometry: "left=2.5cm,right=2cm,top=2cm,bottom=2cm"
output: pdf_document
header-includes:
    - \usepackage{hyperref}
    - \usepackage{datetime}
    - \usepackage{xcolor}   
---

# Overview

\begin{Form}
\TextField[name=Title, width=0.87\textwidth, bordercolor=black, value = {Some default value}]{Title:}


## A heading:
* Some markdown syntax here*

\TextField[name=field1, width=\hsize, bordercolor=black, value = {}]{}

## Another heading:
*And form field below*

\TextField[name=field2, width=\hsize, bordercolor=black, value = {}]{}

\end{Form}

Pandoc 命令:

pandoc --number-section -o TestLatexForm.pdf TestLatexForm.md -f markdown+raw_tex

我该如何解决?

答案1

我在这里找到了可行的解决方案:https://github.com/jgm/pandoc/issues/5209

基本上我必须使用文字latex块来指定形式:

 ---
 title: "Test Latex Form"
 geometry: "left=2.5cm,right=2cm,top=2cm,bottom=2cm"
 output: pdf_document
 header-includes:
     - \usepackage{hyperref}
     - \usepackage{datetime}
     - \usepackage{xcolor}
 ---
 # Overview

  ```{=latex}
 \begin{Form}
 ```

 \TextField[name=Title, width=0.87\textwidth, bordercolor=black, value = {Some default value}]{Title:}

 ## A heading:
 * Some markdown syntax here*

 \TextField[name=field1, width=\hsize, bordercolor=black, value = {}]{}

 ## Another heading:
 *And form field below*

 \TextField[name=field2, width=\hsize, bordercolor=black, value = {}]{}

 ```{=latex}
 \end{Form}
  ```

相关内容