pandoc

Pandoc inline .class and .id elements

不打扰是莪最后的温柔 提交于 2019-12-23 22:07:13
问题 My Question: Is there a way in Pandoc markdown to mark inline class (or id) elements that could then be output to LaTeX and html and if so, how? I am looking for a "one input many outputs" publication solution with needed output of LaTeX and epub, but with desired output of .docx. In LaTeX I have defined \mytag{foo} which would correspond to <span class="myclass">foo</span> in html for certain word level mark up. (In MSWord, Libreoffice and Adobe Indesign it is possible to set character

Can I automatically embed pandoc's default templates in my application?

China☆狼群 提交于 2019-12-23 21:26:36
问题 Pandoc comes with several default templates, which are distributed with the pandoc package. However, if I write an application that uses pandoc as a library, those default templates don't get included in the binary. I can still use them on my machine: module Main where import Text.Pandoc (getDefaultTemplate) main = getDefaultTemplate Nothing "latex" >>= print This will print the default.latex template. However, it's not portable, since it really refers to a file somewhere on my system: $ cd

Keep trailing zeros for percents only

旧城冷巷雨未停 提交于 2019-12-23 16:03:27
问题 Given the following example: library(pander) tableAbs <- Titanic[1, 1, , ] tablePct <- round(prop.table(tableAbs) * 100, 2) table <- cbind(tableAbs, tablePct) pander(table) ----------------------------------   No Yes No Yes ----------- ---- ----- ----- ----- **Child** 0 5 0 2.78 **Adult** 118 57 65.56 31.67 ---------------------------------- I would like to keep all trailing zeros on that 0 percentage over there, so this is what I do: panderOptions("keep.trailing.zeros", TRUE) pander(table) -

Using pandoc as a library to make a PDF

最后都变了- 提交于 2019-12-23 14:22:11
问题 Part of a project I am working on involves creating a PDF, using Pandoc. I have the part of the program which makes a PDF. To figure out how to do this, I am trying to modify fuel.hs from JGM BayHack 2014. However, I am having difficulty. I have the following function: export :: (MonadIO m) => Pandoc -> m (Either BL.ByteString BL.ByteString) export = liftIO . makePDF "xelatex" writeLaTeX def { writerStandalone = True } In the body of my modified fuel.hs, pdfbytes <- export letter print

How to get headings sans serif while preserving pdf bookmark text?

て烟熏妆下的殇ゞ 提交于 2019-12-23 12:06:04
问题 In rmarkdown I want headings with sans serif font. I can achieve this with \textsf{} latex command but later in the PDF there's no bookmark text shown. I already tried ## \textsf[Heading 1]{Heading 1} but with an error as result. Anybody got an idea how to get both? MWE: --- output: pdf_document --- ## \textsf{Heading 1} Lorem ipsum dolor sit amet, sit id rebum choro euripidis, nam ei ullum tamquam scaevola, est veniam consulatu et. Duo ex utamur atomorum. His ad dicat pericula, solet

pandoc skip latex environment

痴心易碎 提交于 2019-12-23 11:56:42
问题 I'm writing mainly in LaTeX, but some co-authors prefer MS Word. To facilitate their work a bit, I would like to convert the .tex file (or the .pdf ) to a .docx . The formatting does not need to be perfect, but all of the text, equations, figures etc should be perfectly readable. I'm currently thinking to take the .tex document, replace all the essential stuff and then let Pandoc do it's magic. For this I would preferably implement my additions as a Pandoc filter. E.g., my tikz pictures would

Creating a footer for every page (including first!) using R markdown

你。 提交于 2019-12-23 10:26:57
问题 I'd like to add to the question Creating a footer for every page using R markdown: how do I do this for the first page of the document in addition to all the following pages? In RStudio, this code: --- title: "Test" author: "Author Name" header-includes: - \usepackage{fancyhdr} - \usepackage{lipsum} - \pagestyle{fancy} - \fancyhead[CO,CE]{This is fancy header} - \fancyfoot[CO,CE]{And this is a fancy footer} - \fancyfoot[LE,RO]{\thepage} output: pdf_document --- \lipsum[1-30] Produces this at

How do I make a link to a section of a document in the same directory(pandoc markdown->html output)

眉间皱痕 提交于 2019-12-23 10:14:56
问题 I have two fairly simple pieces of documentation(written in markdown that is used to generate html files with pandoc). I'd like to be able to link to a section of the second document from the first document. Preference order for solutions: Using General Markdown Features Using Pandoc Extensions Using embedded HTML 回答1: Pandoc has a "Header identifiers in HTML"-extension for this usecase. In the documentation is an example, how to provide links from one section of a document to another. 来源:

Why pandoc keeps span and div tags when converting html to markdown?

浪尽此生 提交于 2019-12-23 07:14:59
问题 I'm a pandoc newbie, so I must be missing something obvious. I'm trying to convert MS Word generated HTML file to markdown. Here is a test html: <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> </head> <body> <div class="Section1"> <p class="Question"><span style="FONT-SIZE: 10pt">Today</span> <span style= "FONT-SIZE: 10pt">is</span> <span lang="HR" style= "FONT-SIZE: 10pt; mso-ansi-language: HR">a</span><span style= "FONT-SIZE: 10pt">nice</span> <span style="FONT-SIZE: 10pt

How to enable syntax highlighting for Markdown inline code with Pandoc?

試著忘記壹切 提交于 2019-12-22 20:43:11
问题 The Pandoc manual says: --no-highlight Disables syntax highlighting for code blocks and inlines, even when a language attribute is given. This sounds like there should be syntax highlighting for inline code. But whenever I use Markdown inline code like This is `print("Hello world")` inline code. there is no syntax highlighting. 回答1: Okay, should have read a little bit further... found the solution. It's called Extension: inline_code_attributes: Attributes can be attached to verbatim text,