This commit is contained in:
2026-07-23 18:13:11 +09:00
parent 2c996ad3f1
commit 101067a32e
11 changed files with 133 additions and 10 deletions
+27
View File
@@ -0,0 +1,27 @@
PANDOC:=pandoc
TEX:=xelatex
OUTPUT:=./out
SRC:=$(wildcard *.md)
SRC_MAIN_TEX:=report.tex
TEX_OUT:=$(SRC:.md=.tex)
TEMPLATE:=./template.tex
all: report.pdf
generate-template:
pandoc --from markdown --to latex --template=${TEMPLATE} -o ${TEMPLATE:.tex=.sty} *.md
sed -i '/====/,/++++/d' ${TEMPLATE:.tex=.sty}
%.tex: %.md
pandoc --from markdown --to latex --strip-comments -o $@ $^
# for multi-file report
report.pdf: ${TEX_OUT}
@mkdir -p ${OUTPUT}
${TEX} --output-directory=${OUTPUT} ${SRC_MAIN_TEX}
clean:
rm ${TEX_OUT}
+23
View File
@@ -0,0 +1,23 @@
{
description = "Template for Pandoc Multi-file Markdown";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
report-temp.url = "github:kenryuS/report-temp";
};
outputs = { self, nixpkgs, flake-utils, report-temp }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
config = {};
overlays = [];
};
in
{
devShells.default = report-temp.devShells.${system}.pandoc;
}
);
}
+15
View File
@@ -0,0 +1,15 @@
# Part 1
* Normal
* *Italic*
* **Bold**
* `code`
> quote
```python
def fib(n):
if n <= 2:
return 1
return fib(n - 1) + fib(n - 2)
```
+9
View File
@@ -0,0 +1,9 @@
# Part 2
1. uno
2. dos
3. tres
$$
e^{i\pi} + 1 = 0
$$
+14
View File
@@ -0,0 +1,14 @@
\documentclass[xelatex,ja=standard,11pt]{bxjsarticle}
\title{テストレポート}
\author{高専太郎}
\date{1970-01-01}
\usepackage{./template}
\begin{document}
\maketitle
\input{part1}
\input{part2}
\end{document}
+6
View File
@@ -0,0 +1,6 @@
$passoptions.latex()$
$common.latex()$
====
$body$
++++
+8 -1
View File
@@ -1,2 +1,9 @@
PANDOC:=pandoc
TEX:=lualatex
OUTPUT:=./out
all: report.pdf
%.pdf: %.md
pandoc --from markdown --to pdf -o $@ $^ --pdf-engine=lualatex -N
pandoc --from markdown --to pdf -o ${OUTPUT}/$@ $^ --pdf-engine=${TEX} -N
+1 -1
View File
@@ -1,5 +1,5 @@
{
description = "Template for Pandoc Markdown";
description = "Template for Pandoc Single File Markdown";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";