Disable Yaml header output on Pandoc markdown - yaml

I've been using apostrophe, it shows metadata on the beginning of the file. Probably this is a new feature on Pandoc markdown.
I glanced many options but couldn't find any way to disable it.
How can I disable to printing YAML header on Markdown alongside entering this metadata which need to enter PDF info.
---
lang: En-GB
date: 15.06.2021
author: max
subtitle: 'How to disable YAML header printing as header'
title: "Markdown Tutorial"
geometry: margin=3cm
fontfamily: default
fontsize: 12pt
...

Related

How to permanently embed images in an ioslides presentation?

I'm having trouble permanently embedding images in my RStudio ioslides presentation.
Specifically, the problem occurs when I try to include local images via:
![](image.png)
The images will appear successfully when I knit the document and open it directly from its folder on my computer. But if I share the html file with anyone else or copy and paste to another directory on my computer, all images embedded via ![](image.png) disappear.
My YAML header looks like this:
---
title: 'Title'
subtitle: 'Subtitle'
author: "Harrison"
date: '`r format(Sys.time(), "%d %B, %Y")`'
output:
ioslides_presentation:
self_contained: true
widescreen: true
smaller: true
css: custom.css
incremental: false
---
I thought that "self-contained" is supposed to accomplish what I want, that is, to create a fully self-contained html document.
Note: My images are successfully permanently embedded when I use the include_graphics() function from knitr to add a jpeg or png file.
Any idea what is going on?
I cannot reproduce your problem. Here is my reproducible example:
---
title: 'Title'
subtitle: 'Subtitle'
author: "Harrison"
date: '`r format(Sys.time(), "%d %B, %Y")`'
output:
ioslides_presentation:
self_contained: true
keep_md: true
---
## First slide
```{r, test, dev='png'}
plot(1)
```
## Second slide
![](`r knitr::fig_chunk('test', 'png')`)
Both images are corrected embedded.
Please try to update your packages. If it still fails after updating all packages, please provide your xfun::session_info('rmarkdown').

layout and other thing

I want to write a report in Markdown under Rstudio, I have already written several documents in Latex, from what I understood you can write latex commands under Markdown. I am on the first page where there is the title, name, ect.
I would like to know how:
put an image above the title.
make two columns one for the author and the other for the referents.
put a subtitle.
title: "titre"
author: "nom"
date: "r format(Sys.time(), '%d %B, %Y')"
output:
pdf_document:
latex_engine: pdflatex
#html_document:
#latex_engine: pdflatex
fontsize: 14pt
documentclass: report

How can I specify pandoc's markdown extensions using a YAML block?

Background
Pandoc's markdown lets you specify extensions for how you would like your markdown to be handled:
Markdown syntax extensions can be individually enabled or disabled by appending +EXTENSION or -EXTENSION to the format name. So, for example, markdown_strict+footnotes+definition_lists is strict markdown with footnotes and definition lists enabled, and markdown-pipe_tables+hard_line_breaks is pandoc’s markdown without pipe tables and with hard line breaks.
My specific question
For a given pandoc conversion where, say, I use grid tables in my source:
pandoc myReport.md --from markdown+pipe_tables --to latex -o myReport.pdf
How can I write a pandoc YAML block to accomplish the same thing (specifying that my source contains grid tables?)
A generalized form of my question
How can I turn extensions on and off using pandoc YAML?
Stack Overflow Questions that I don't think completely answer my question
Can I set command line arguments using the YAML metadata - This one deals with how to specify output options, but I'm trying to tell pandoc about the structure of my input
What can I control with YAML header options in pandoc? - Answerers mention pandoc's templates, but neither the latex output template nor the markdown template indicate any sort of option for grid_tables. So, it's not clear to me from these answers how knowing about the templates will help me figure out how to structure my YAML.
There may also not be a way to do this
It's always possible that pandoc isn't designed to let you specify those extensions in the YAML. Although, I'm hoping it is.
You can use Markdown Variants to do this in an Rmarkdown document. Essentially, you enter your extensions into a variant option in the YAML header block at the start of the your .Rmd file.
For example, to use grid tables, you have something like this in your YAML header block:
---
title: "Habits"
author: John Doe
date: March 22, 2005
output: md_document
variant: markdown+grid_tables
---
Then you can compile to a PDF directly in pandoc by typing in your command line something like:
pandoc yourfile.md -o yourfile.pdf
For more information on markdown variants in RStudio: http://rmarkdown.rstudio.com/markdown_document_format.html#markdown_variants
For more information on Pandoc extensions in markdown/Rmarkdown in RStudio:
http://rmarkdown.rstudio.com/authoring_pandoc_markdown.html#pandoc_markdown
You can specify pandoc markdown extension in the yaml header using md_extension argument included in each output format.
---
title: "Your title"
output:
pdf_document:
md_extensions: +grid_tables
---
This will activate the extension. See Rmarkdown Definitive Guide for details.
Outside Rmarkdown scope, you can use Pandocomatic to it, or Paru for Ruby.
---
title: My first pandocomatic-converted document
pandocomatic_:
pandoc:
from: markdown+footnotes
to: html
...
As Merchako noted, the accepted answer is specific to rmarkdown. In, for instance, Atom md_extensions: does not work.
A more general approach would be to put the extensions in the command line options. This example works fine:
----
title: "Word document with emojis"
author: me
date: June 9, 2021
output:
word_document:
pandoc_args: ["--standalone", "--from=markdown+emoji"]
----
For people stumbling across this in or after 2021, this can be done without Rmarkdown. You can specify a YAML "defaults" file, which basically includes anything you could want to configure.
In order to do what OP wanted, all you'd need to do is
from: markdown+pipe_tables
in the defaults file, then pass it when you compile.
You can also specify the input and output files, so you can end up with the very minimal command
pandoc --defaults=defaults.yaml
and have it handle the rest for you. See https://pandoc.org/MANUAL.html#extensions for more.

Header and footer in YAML metablock for rmarkdown and pandoc

Is it possible to specify in the YAML metablock a pdf header and/or footer?Something you could set to appear on every page. This is in rmarkdown and will then be rendered to a pdf (using pandoc and knitr). I have not been able to find anything (header: and footer: sadly did not work!)
---
title: testpdf | test
footer: "test footer"
theme: "zenburn"
date: "`r Sys.Date()`"
output: "pdf_document"
fig_width: 12
fig_height: 6
fig_caption: true
---
There is no native pandoc-markdown support of headers and footers. However, since pandoc generates pdf documents through latex, you can tweak your latex template to accommodate those.
Create a new template from the default one :
pandoc -D latex > footer_template.latex
Add the following lines in the latex preamble (this is a very basic example that should produce a centered footer, see the fancyhdr user manual if you need something more advanced)
$if(footer)$
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyfoot[C]{$footer$}
$endif$
Finally, add this to your document yaml header :
output:
pdf_document:
template: test.latex
Your template should either be in ~/.pandoc/templates or in the same directory as test.rmd for this to work.

How to specify YAML metadata in Markdown for Pandoc Beamer slides?

I am trying to use a YAML metadata block to specify some document properties in a Markdown document for Pandoc that I am going to convert to LaTeX Beamer. I read the description here: http://johnmacfarlane.net/pandoc/README.html#extension-yaml_metadata_block and attempted the following document:
---
title: Some title
---
# This is a test slideshow.
## This should turn into a slide...
...with some content.
I convert the file to PDF using pandoc -t beamer file.md -V theme:SomeTheme -o file.pdf. It seems to work correctly with the theme etc., except that the YAML block at the beginning of the document is converted into a table in the first slide containing a top and bottom rule and the text "title: Some title". What am I doing wrong?
Not sure why your metadata doesn't work as mine works fine.
Try doing (with a space after the title):
---
title: Some title
---
# This is a test slideshow.
## This should turn into a slide...
...with some content.
Or (with periods):
---
title: Some title
...
# This is a test slideshow.
## This should turn into a slide...
...with some content.
Or (with quotes):
---
title: "Some title"
---
# This is a test slideshow.
## This should turn into a slide...
...with some content.
Do these all work?

Resources