Compare commits

..

5 Commits

Author SHA1 Message Date
kenryuS 2c996ad3f1 removed unnecessary vim files 2026-05-28 01:26:21 +09:00
kenryuS 92e69a7451 moved out from abi dependent section 2026-05-28 01:15:40 +09:00
kenryuS 42fd5ef1cc added template enrties to flake 2026-05-28 01:12:56 +09:00
kenryuS 506ab689c1 added pandoc template 2026-05-28 01:10:21 +09:00
kenryuS 5f2b85feeb added LaTeX template 2026-05-28 00:47:46 +09:00
25 changed files with 248 additions and 147 deletions
+23 -12
View File
@@ -22,19 +22,22 @@
vimWithTex = import ./nix/vim.nix { inherit pkgs; lib = pkgs.lib; };
texEnv = import ./nix/latex.nix { inherit pkgs; };
basePackages = [
texEnv
pkgs.qpdf
pkgs.qpdfview
];
in
{
devShells.default = pkgs.stdenv.mkDerivation {
devShells.default = self.devShells.${system}.latex;
devShells.latex = pkgs.stdenv.mkDerivation {
inherit name;
shellHook = ''
export PS1="${name} \w \$ "
'';
buildInputs = [
texEnv
buildInputs = basePackages ++ [
vimWithTex
pkgs._0xproto
pkgs.qpdf
pkgs.kdePackages.okular
];
};
devShells.pandoc = pkgs.stdenv.mkDerivation {
@@ -42,14 +45,22 @@
shellHook = ''
export PS1="${name} pandoc \w \$ "
'';
buildInputs = [
texEnv
buildInputs = basePackages ++ [
pkgs.pandoc
pkgs._0xproto
pkgs.qpdf
pkgs.qpdfview
];
};
}
);
) // {
templates = {
latex = {
path = ./templates/latex;
description = "Template for LaTeX";
};
pandoc = {
path = ./templates/pandoc;
description = "Template for Pandoc Markdown";
};
};
defaultTemplate = self.templates.latex;
};
}
+30 -29
View File
@@ -2,60 +2,61 @@
pkgs.texliveSmall.withPackages (ps: with ps; [
# Bibliography
biber
bibtex
biblatex
bibtex
# Japanese Support
ascmac
babel
babel-japanese
luatexja
ascmac
bxjscls
zxjatype
collection-langjapanese
luatexja
zxjatype
# Fonts
noto
zxjafont
fontspec
haranoaji
libertine
inconsolata
latex-fonts
libertine
luainputenc
mathfont
newtx
luainputenc
fontspec
noto
type1cm
zxjafont
# Math
amsmath
amsfonts
unicode-math
mathtools
amsmath
lualatex-math
mathtools
unicode-math
# Graphics
graphics
wrapfig
caption
circuitikz
graphics
here
pgf
circuitikz
wrapfig
# Tools
latexmk
subfiles
enumitem
hyperref
cleveref
float
framed
tabularray
footmisc
listings
xcolor
xstring
xpatch
blindtext
multirow
cleveref
enumitem
etoolbox
float
footmisc
framed
hyperref
latexmk
listings
multirow
subfiles
tabularray
xcolor
xpatch
xstring
] ++ [ ps.import pkgs.my-latex-pkgs ])
+2 -2
View File
@@ -41,8 +41,8 @@ pkgs.vim-full.customize {
syntax enable
let g:vimtex_view_method = 'general'
let g:vimtex_view_general_viewer = 'okular'
let g:vimtex_view_general_options = '--unique file:@pdf\#src:@line@tex'
let g:vimtex_view_general_viewer = 'qpdfview'
let g:vimtex_view_general_options = '--unique @pdf\#src:@tex:@line:@col'
let g:vimtex_compiler_method = 'latexmk'
let maplocalleader = ","
BIN
View File
Binary file not shown.
Binary file not shown.
+1
View File
@@ -0,0 +1 @@
.intermediates/
+3
View File
@@ -0,0 +1,3 @@
# LaTeX Template
Use `vim` for edit/compile TeX files with vimtex plugin or `latexmk` command to compile.
View File
+34
View File
@@ -0,0 +1,34 @@
\documentclass[xelatex,a4paper,11pt,ja=standard]{bxjsarticle}
\usepackage{preamble}
\usepackage{detailed-title}
\reportauthor{高専太郎}
\reporttitle{テストレポート}
\reportdate{AAAA年}{BB月}{CC日}
\turnindate{AAAA年}{BB月}{DD日}
\schoolname{abc工業高等専門学校}
\department{hogefuga科}
\subject{foobazz}
\professor{高専先生}
\studentid{0000}
\seatingnum{0}
\begin{document}
\detailedtitle
\section{Test}
Hello world program implemented in C is listed in listing \ref{lst1}.
\begin{lstlisting}[language=C,caption={Code Listing},label={lst1}]
#include <stdio.h>
int main(int argc, char** argv) {
printf("Hello World!");
return 0;
}
\end{lstlisting}
\end{document}
+44
View File
@@ -0,0 +1,44 @@
\documentclass[japanese,xelatex,a4paper,10.5pt,ja=standard]{bxjsarticle}
\usepackage{depD-experiment}
\usepackage{pgf}
\reportauthor{高専太郎}
\reporttitle{テストレポート}
\reportdate{AAAA年}{BB月}{CC日}
\turnindate{AAAA年}{CC月}{DD日}
\schoolyear{AAAA}
\grade{N}
\department{電子xxxx科}
\subject{実験}
\reportid{0000}
\expgroup{fuga}
\seatingnum{0}
\addExperimentDate{aaaa年 bb月 cc日}
\addResearcher{高専花子}
\addbibresource{./bibliography.bib}
\begin{document}
\experimentTitle
\section{実験目的}
\resetrefcounter
\section{理論}
\resetrefcounter
\section{実験条件}
\resetrefcounter
\section{実験結果}
\resetrefcounter
\section{考察}
\resetrefcounter
\section{まとめ}
\printbibliography[title={参考文献}]{}
\end{document}
+23
View File
@@ -0,0 +1,23 @@
{
description = "Template for LaTeX";
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}.latex;
}
);
}
+29
View File
@@ -0,0 +1,29 @@
\documentclass[xelatex,a4paper,11pt,ja=standard]{bxjsarticle}
\usepackage{preamble}
\usepackage{simple-title}
\reportauthor{高専太郎}
\reporttitle{テストレポート}
\reportdate{AAAA年}{BB月}{CC日}
\turnindate{AAAA年}{BB月}{DD日}
\begin{document}
\simpletitle
\section{Test}
Hello \LaTeX{}!
\begin{itemize}
\item{\textrm{Roman}}
\item{\textit{Italic}}
\item{\textbf{Bold}}
\item{\texttt{Typewriter}}
\end{itemize}
\section{テスト}
いろはにほへとちりぬるを
\end{document}
+2
View File
@@ -0,0 +1,2 @@
%.pdf: %.md
pandoc --from markdown --to pdf -o $@ $^ --pdf-engine=lualatex -N
+23
View File
@@ -0,0 +1,23 @@
{
description = "Template for Pandoc 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;
}
);
}
+30
View File
@@ -0,0 +1,30 @@
---
documentclass: bxjsarticle
classoption:
- lualatex
- ja=standard
- 11pt
title: テストレポート
author: 高専太郎
date: 1970-01-01
---
# Test
* Normal
* *Italic*
* **Bold**
* `code`
> quote
```python
def fib(n):
if n <= 2:
return 1
return fib(n - 1) + fib(n - 2)
```
$$
e^{i\pi} + 1 = 0
$$
+1
View File
@@ -5,3 +5,4 @@
\usepackage{experiment-title}
\usepackage{depD-bib}
\usepackage{depD-format}
\usepackage{amssymb}
+1
View File
@@ -1,6 +1,7 @@
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{depD-format}
\usepackage{amsmath}
\usepackage{cleveref}
\renewcommand\figurename{Fig. }
+2 -2
View File
@@ -10,9 +10,10 @@
]{biblatex}
\usepackage{fontspec}
\usepackage{inconsolata}
\fontspec{inconsolata}
\usepackage[mono=false]{libertine}
\usepackage{noto}
\setmonofont{0xProto}
\usepackage[european]{circuitikz}
@@ -59,4 +60,3 @@
framexleftmargin=10mm
}
\lstset{style=mystyle}
-16
View File
@@ -1,16 +0,0 @@
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{reportpaper}
\geometry{
a4paper,
total={166mm,270mm},
left=22mm,
right=22mm,
top=30mm,
headheight=15mm,
headsep=5mm,
marginparwidth=25mm,
footnotesep=5mm,
footskip=15mm,
bottom=25mm
}
-13
View File
@@ -1,13 +0,0 @@
augroup latex_circuitikz_abbr
iabbrev <buffer> ctikz <Esc>i\begin{circuitikz}<CR><CR>\end{circuitikz}<Esc>ki
iabbrev <buffer> tobatt <Esc>ato [battery2, invert, v={$E$}]<Esc>a
iabbrev <buffer> tores <Esc>ato [R={$R$}]<Esc>a
iabbrev <buffer> toslo <Esc>ato [short, o-]<Esc>a
iabbrev <buffer> toslc <Esc>ato [short, *-]<Esc>a
iabbrev <buffer> tosro <Esc>ato [short, -o]<Esc>a
iabbrev <buffer> tosrc <Esc>ato [short, -*]<Esc>a
iabbrev <buffer> ndl <Esc>anode[left]{.}<Esc>5hf.vc
iabbrev <buffer> ndr <Esc>anode[right]{.}<Esc>5hf.vc
iabbrev <buffer> ndc <Esc>anode{.}<Esc>5hf.vc
iabbrev <buffer> ohm <Esc>a\Omega<Esc>a
augroup END
-11
View File
@@ -1,11 +0,0 @@
augroup latex_generic_envs_abbr
iabbrev <buffer> emptyenv <Esc>i\begin{}<CR><CR>\end{}<Esc>k
iabbrev <buffer> ugather <Esc>i\begin{gather*}<CR><CR>\end{gather*}<Esc>k
iabbrev <buffer> uequi <Esc>i\begin{equation*}<CR><CR>\end{equation*}<Esc>k
iabbrev <buffer> equi <Esc>i\begin{equation}<CR><CR>\end{equation}<Esc>k
iabbrev <buffer> centerenv <Esc>i\begin{center}<CR><CR>\end{center}<Esc>k
iabbrev <buffer> codelsenv <Esc>i\begin{lstlisting}[language=.,title={.}]<CR><CR>\end{lstlisting}<Esc>2k0f.vc
iabbrev <buffer> itemenv <Esc>i\begin{itemize}<CR><CR>\end{itemize}<Esc>k
iabbrev <buffer> enumenv <Esc>i\begin{enumerate}<CR><CR>\end{enumerate}<Esc>k
iabbrev <buffer> figenv <Esc>i\begin{figure}[tbh]<CR>\centering<CR><CR>\caption{}<CR>\end{figure}<Esc>k
augroup END
-54
View File
@@ -1,54 +0,0 @@
augroup latex_generic_abbr
iabbrev <buffer> trm <Esc>a\textrm{}<Esc><Left>a
iabbrev <buffer> ttt <Esc>a\texttt{}<Esc><Left>a
iabbrev <buffer> tbf <Esc>a\textbf{}<Esc><Left>a
iabbrev <buffer> tit <Esc>a\textit{}<Esc><Left>a
iabbrev <buffer> sec <Esc>a\section{.}<Esc>3hf.vc
iabbrev <buffer> ssec <Esc>a\subsection{.}<Esc>3hf.vc
iabbrev <buffer> inm <Esc>a$$<Esc><Left>a
iabbrev <buffer> m/ <Esc>a\frac{}{}<Esc>3ha
iabbrev <buffer> mpl <Esc>a\left(<Esc>a
iabbrev <buffer> mpr <Esc>a\right)<Esc>a
iabbrev <buffer> minv <Esc>a\frac{1}{.}<Esc>3hf.vc
augroup END
function! Simpletexbang()
let l:name = input("Name: ")
let l:title = input("Title: ")
let l:todayYear = strftime('%Y')
let l:todayMonth = strftime('%m')
let l:todayDay = strftime('%d')
execute "normal i\\documentclass[xelatex,a4paper,11pt,ja=standard]{bxjsarticle}\n\n\\usepackage{tex/preamble}\n\\usepackage{tex/simple-title}\n\n"
execute "normal i\\reportauthor{" . l:name . "}\n"
execute "normal i\\reporttitle{" . l:title . "}\n"
execute "normal i\\reportdate{" . l:todayYear . "年}{" . l:todayMonth . "月}{" . l:todayDay . "日}\n"
execute "normal i\\turnindate{年}{月}{日}\n\n\\begin{document}\\end{document}"
execute "normal 02f{bhi\n\\simpletitle\n"
endfunction
function! Detailedtexbang()
let l:name = input("Name: ")
let l:id = input("Student ID: ")
let l:seat = input("Seating Number: ")
let l:title = input("Title: ")
let l:school = input("School: ")
let l:dep = input("Department: ")
let l:subj = input("Subject: ")
let l:prof = input("Professor Name: ")
let l:todayYear = strftime('%Y')
let l:todayMonth = strftime('%m')
let l:todayDay = strftime('%d')
execute "normal i\\documentclass[xelatex,a4paper,11pt,ja=standard]{bxjsarticle}\n\n\\usepackage{tex/preamble}\n\\usepackage{tex/detailed-title}\n\n"
execute "normal i\\reportauthor{" . l:name . "}\n"
execute "normal i\\reporttitle{" . l:title . "}\n"
execute "normal i\\reportdate{" . l:todayYear . "年}{" . l:todayMonth . "月}{" . l:todayDay . "日}\n"
execute "normal i\\turnindate{年}{月}{日}\n"
execute "normal i\\schoolname{" . l:school . "}\n"
execute "normal i\\department{" . l:dep . "}\n"
execute "normal i\\subject{" . l:subj . "}\n"
execute "normal i\\professor{" . l:prof . "}\n"
execute "normal i\\studentid{" . l:id . "}\n"
execute "normal i\\seatingnum{" . l:seat . "}\n"
execute "normal i\n\\begin{document}\\end{document}"
execute "normal 02f{bhi\n\\detailedtitle\n"
endfunction
-3
View File
@@ -1,3 +0,0 @@
augroup latex_info_procs_abbr
iabbrev <buffer> cas <Esc>i\section{.}<CR><CR><CR><CR>\lstinputlisting[language=C,title={.}]{.}<CR><CR>\subsection{実行結果}<CR><CR>\begin{figure}[tbh]<CR>\centering<CR>\includegraphics[width=12cm]{.}<CR>\caption{.}<CR>\end{figure}<ESC>10k0f.vc
augroup END
-5
View File
@@ -1,5 +0,0 @@
augroup latex_packages_abbr
iabbrev <buffer> amsp <Esc>i\usepackage{amsmath}<Esc>
iabbrev <buffer> tikzp <Esc>i\usepackage{pgf}<Esc>
iabbrev <buffer> circp <Esc>i\usepackage{circuitikz}<Esc>
augroup END