added LaTeX template

This commit is contained in:
2026-05-28 00:47:46 +09:00
parent 67f994d7ee
commit 5f2b85feeb
17 changed files with 183 additions and 60 deletions
+13 -11
View File
@@ -22,19 +22,25 @@
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 {
templates = {
latex = {};
};
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,12 +48,8 @@
shellHook = ''
export PS1="${name} pandoc \w \$ "
'';
buildInputs = [
texEnv
buildInputs = basePackages ++ [
pkgs.pandoc
pkgs._0xproto
pkgs.qpdf
pkgs.qpdfview
];
};
}
+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}
+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
}