Template
mirror of
https://github.com/kenryuS/report-temp.git
synced 2026-08-13 12:41:42 +09:00
update
This commit is contained in:
+15
-4
@@ -10,19 +10,30 @@
|
||||
{ "alias": "gatherenv", "target": "gather" },
|
||||
{ "alias": "itemenv", "target": "itemize" },
|
||||
{ "alias": "minienv", "target": "minipage" },
|
||||
{ "alias": "split", "target": "split" },
|
||||
{ "alias": "spltenv", "target": "split" },
|
||||
{ "alias": "tableenv", "target": "table" },
|
||||
{ "alias": "tabularenv", "target": "tabular" }
|
||||
{ "alias": "tabularenv", "target": "tabular" },
|
||||
{ "alias": "tikzpenv", "target": "tikzpicture" },
|
||||
{ "alias": "detmenv", "target": "vmatrix" },
|
||||
{ "alias": "matenv", "target": "pmatrix" },
|
||||
{ "alias": "ctikzenv", "target": "circuitikz" }
|
||||
],
|
||||
"math": [
|
||||
{ "alias": "prs", "target": "\\left(\\right)<Esc>?\\<CR>i" },
|
||||
{ "alias": "/", "target": "\\frac{}{}" },
|
||||
{ "alias": "/", "target": "\\frac{}{}<Esc>?\\<CR>/}<CR>i" },
|
||||
{ "alias": "inv", "target": "\\frac{1}{}<Esc>i" },
|
||||
{ "alias": "txt", "target": "\\text{}<Esc>i" },
|
||||
{ "alias": "bks", "target": "\\left{\\right}<Esc>?\\<CR>i" }
|
||||
{ "alias": "bf", "target": "\\mathbf{}<Esc>i"},
|
||||
{ "alias": "it", "target": "\\mathit{}<Esc>i"},
|
||||
{ "alias": "bks", "target": "\\left{\\right}<Esc>?\\<CR>i" },
|
||||
{ "alias": "int", "target": "\\int_{}^{} {} d<Esc>?\\<CR>/}<CR>i" },
|
||||
{ "alias": "x", "target": "\\times" },
|
||||
{ "alias": "*", "target": "\\cdot" }
|
||||
],
|
||||
"generic": [
|
||||
{ "alias": "cpt", "target": "\\caption{}<Esc>i" },
|
||||
{ "alias": "scpt", "target": "\\subcaption{}<Esc>i" },
|
||||
{ "alias": "scite", "target": "\\supercite{}<Esc>i" },
|
||||
{ "alias": "itm", "target": "\\item{}<Esc>i" },
|
||||
{ "alias": "lbl", "target": "\\label{}<Esc>i" },
|
||||
{ "alias": "sec", "target": "\\section{}<Esc>i" },
|
||||
|
||||
Generated
+3
-3
@@ -36,11 +36,11 @@
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1779560665,
|
||||
"narHash": "sha256-tpyBcxPpcQb8ukyNF7DoCwfSY3VPsxHoYwj00Cayv5o=",
|
||||
"lastModified": 1784497964,
|
||||
"narHash": "sha256-vlHUuqAcbcH2RKmHbPiuQzbv1pnzzavXnI62RD0bqCU=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "64c08a7ca051951c8eae34e3e3cb1e202fe36786",
|
||||
"rev": "241313f4e8e508cb9b13278c2b0fa25b9ca27163",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
||||
@@ -25,16 +25,22 @@
|
||||
|
||||
basePackages = [
|
||||
texEnv
|
||||
pkgs.fontconfig
|
||||
pkgs._0xproto
|
||||
pkgs.qpdf
|
||||
pkgs.qpdfview
|
||||
];
|
||||
in
|
||||
{
|
||||
packages = {
|
||||
inherit texEnv vimWithTex;
|
||||
};
|
||||
devShells.default = self.devShells.${system}.latex;
|
||||
devShells.latex = pkgs.stdenv.mkDerivation {
|
||||
inherit name;
|
||||
shellHook = ''
|
||||
export PS1="${name} \w \$ "
|
||||
export FONTCONFIG_FILE="${pkgs.fontconfig.out}/etc/fonts/fonts.conf"
|
||||
'';
|
||||
buildInputs = basePackages ++ [
|
||||
vimWithTex
|
||||
@@ -44,6 +50,7 @@
|
||||
inherit name;
|
||||
shellHook = ''
|
||||
export PS1="${name} pandoc \w \$ "
|
||||
export FONTCONFIG_FILE="${pkgs.fontconfig.out}/etc/fonts/fonts.conf"
|
||||
'';
|
||||
buildInputs = basePackages ++ [
|
||||
pkgs.pandoc
|
||||
@@ -58,7 +65,11 @@
|
||||
};
|
||||
pandoc = {
|
||||
path = ./templates/pandoc;
|
||||
description = "Template for Pandoc Markdown";
|
||||
description = "Template for Pandoc Single File Markdown";
|
||||
};
|
||||
pandoc-multi = {
|
||||
path = ./templates/pandoc-multi;
|
||||
description = "Template for Pandoc Multi-file Markdown";
|
||||
};
|
||||
};
|
||||
defaultTemplate = self.templates.latex;
|
||||
|
||||
@@ -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}
|
||||
@@ -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;
|
||||
}
|
||||
);
|
||||
}
|
||||
@@ -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)
|
||||
```
|
||||
@@ -0,0 +1,9 @@
|
||||
# Part 2
|
||||
|
||||
1. uno
|
||||
2. dos
|
||||
3. tres
|
||||
|
||||
$$
|
||||
e^{i\pi} + 1 = 0
|
||||
$$
|
||||
@@ -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}
|
||||
@@ -0,0 +1,6 @@
|
||||
$passoptions.latex()$
|
||||
$common.latex()$
|
||||
|
||||
====
|
||||
$body$
|
||||
++++
|
||||
@@ -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,5 +1,5 @@
|
||||
{
|
||||
description = "Template for Pandoc Markdown";
|
||||
description = "Template for Pandoc Single File Markdown";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
|
||||
|
||||
Reference in New Issue
Block a user