Merge pull request #406 from pallavhydro/pandoc

Adding Pandoc
This commit is contained in:
Fechin authored and GitHub committed 2023-03-25 11:08:17 +08:00
commit 105ec6aa6a
2 files changed
+64 -8

No files matched your search

+64
View File
@@ -0,0 +1,64 @@
---
title: Pandoc
date: 2023-03-21 13:26:00
background: bg-red-400
tags:
- convert
- document
- utility
categories:
- Linux Command
intro: |
[Pandoc](https://pandoc.org) is a document converter, this pandoc cheat sheet contains pandoc commands and some common pandoc tricks.
plugins:
- copyCode
---
Getting Started
---------------
### Pandoc Usage
Syntax
```shell script
$ pandoc -s [source file] -o [output file]
```
Pandoc examples
----------
### LaTeX to MS Word {.col-span-2}
Simple .tex to .docx
```shell script
$ pandoc -s file.tex -o file.docx
```
.tex to .docx with default citations
```shell script
$ pandoc -s file.tex --citeproc --bibliography=bib_library.bib -o file.docx
```
.tex to .docx with specific citations
```shell script
$ pandoc -s file.tex --citeproc --bibliography=bib_library.bib --csl=apa.csl -o file.docx
```
Get `.csl` file from [here](https://github.com/citation-style-language/styles)
.tex to .docx with cross references
```shell script
$ pandoc -s file.tex --filter pandoc-crossref -o file.docx
```
Get the filter `pandoc-crossref` from [here](https://github.com/lierdakil/pandoc-crossref/releases)
Also see {.cols-1}
----------
- [pandoc examples](https://pandoc.org/demos.html)
-8
View File
@@ -257,14 +257,6 @@ Insert "Example: " before each line that contains "hello"
```shell script
$ sed '/hello/i Example: ' file.txt
```
Insert lines from file1 before line 5
```shell script
$ sed '5 r file1' file.txt
```
Insert lines from file1 after the line that starts with "hello"
```shell script
$ sed '/^hello/ r file1' file.txt
```