From 6c15bcb32de9280bcbb2be127bbf26c3941c1a08 Mon Sep 17 00:00:00 2001 From: Pallav Kumar Shrestha Date: Fri, 17 Mar 2023 22:41:18 +0100 Subject: [PATCH 1/2] Revert "sed: insert lines from file" This reverts commit 00cf292c1acc5808e51ed92228c45f659848aced. --- source/_posts/sed.md | 8 -------- 1 file changed, 8 deletions(-) diff --git a/source/_posts/sed.md b/source/_posts/sed.md index 801c475..bdc0a2b 100644 --- a/source/_posts/sed.md +++ b/source/_posts/sed.md @@ -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 -``` From a7333d10a980aacad8fc6e8aa06b0aa8c672b1fa Mon Sep 17 00:00:00 2001 From: Pallav Kumar Shrestha Date: Tue, 21 Mar 2023 14:57:57 +0100 Subject: [PATCH 2/2] Started pandoc.md, added some basic .tex to .docx tricks --- source/_posts/pandoc.md | 64 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 source/_posts/pandoc.md diff --git a/source/_posts/pandoc.md b/source/_posts/pandoc.md new file mode 100644 index 0000000..0c70fd5 --- /dev/null +++ b/source/_posts/pandoc.md @@ -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) + +