0

begin{Form} and end{Form} currently works in markdown if there is no markdown syntax in-between:

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

But as long as I move end{Form} down to the end of the markdown document in order to cover multiple form fields, it stops working:

---
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 command:

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

How do I fix this?

  • 1
    better ask on the pandoc mailing list. – Ulrike Fischer Jan 9 at 16:11
0

I got the working solution over here: https://github.com/jgm/pandoc/issues/5209

Basically I have to use literal latex blocks to specify form:

 ---
 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}
  ```

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.