From 2b829885acbb04b2cfdd285fd925f54c94acad0d Mon Sep 17 00:00:00 2001 From: architeuthidae Date: Sun, 27 Oct 2024 14:29:31 +0100 Subject: [PATCH 1/3] Add makefile and .gitignore --- .gitignore | 9 +++++++++ Makefile | 13 +++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 .gitignore create mode 100644 Makefile diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f514ef8 --- /dev/null +++ b/.gitignore @@ -0,0 +1,9 @@ +*.out +*.log +*.aux + +_minted-* +build +result + +images/unsorted diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..ee4b947 --- /dev/null +++ b/Makefile @@ -0,0 +1,13 @@ +inputs = 1124 2118-2128 2238 2245 4410-4412 4456 5108 5432 5518-5528 5568 7210 +dir = build + +all: $(inputs) + +$(inputs) : % : %.tex + pdflatex -shell-escape $@.tex + if ! test -d "$(dir)"; then mkdir build; fi + mv $@.pdf build/ + rm $@.log + +clean: + rm -r _minted* *.aux *.out -- 2.44.2 From d55c1b68bff12c52d0a487b30a1cd1d3afa1617e Mon Sep 17 00:00:00 2001 From: architeuthidae Date: Sun, 27 Oct 2024 14:38:57 +0100 Subject: [PATCH 2/3] shell.nix -> flake.nix --- flake.lock | 27 +++++++++++++++++++++++++++ flake.nix | 43 +++++++++++++++++++++++++++++++++++++++++++ shell.nix | 44 -------------------------------------------- 3 files changed, 70 insertions(+), 44 deletions(-) create mode 100644 flake.lock create mode 100644 flake.nix delete mode 100644 shell.nix diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..b03cf13 --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1729880355, + "narHash": "sha256-RP+OQ6koQQLX5nw0NmcDrzvGL8HDLnyXt/jHhL1jwjM=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "18536bf04cd71abd345f9579158841376fdd0c5a", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..ae7302b --- /dev/null +++ b/flake.nix @@ -0,0 +1,43 @@ +{ + description = "Sinara datasheets"; + + inputs.nixpkgs.url = github:NixOS/nixpkgs/nixos-unstable; + + outputs = { self, nixpkgs }: + let + pkgs = import nixpkgs { system = "x86_64-linux";}; + + latex-pkgs = pkgs.texlive.combine { + inherit (pkgs.texlive) + scheme-small collection-latexextra collection-fontsextra + collection-fontsrecommended cbfonts-fd cbfonts palatino textgreek helvetic + greek-inputenc maths-symbols mathpazo babel isodate tcolorbox etoolbox + pgfplots visualtikz quantikz tikz-feynman circuitikz + minted pst-graphicx; + }; + + python-pkgs = with pkgs.python3Packages; [ pygments ]; + + in rec { + + all-pdfs = pkgs.stdenvNoCC.mkDerivation rec { + name = "datasheets-pdfs"; + src = self; + buildInputs = [ latex-pkgs ] ++ python-pkgs; + # is there a better way to get .aux/.out files correct than to just run latexpdf twice? + buildPhase = '' + make all + make all + ''; + installPhase = '' + mkdir $out + cp build/*.pdf $out + ''; + }; + + devShells.x86_64-linux.default = pkgs.mkShell { + name = "datasheet-dev-shell"; + buildInputs = [ latex-pkgs ] ++ python-pkgs; + }; + }; +} diff --git a/shell.nix b/shell.nix deleted file mode 100644 index 0c11f5d..0000000 --- a/shell.nix +++ /dev/null @@ -1,44 +0,0 @@ -let - pkgs = import {}; -in - pkgs.mkShell { - buildInputs = [ - - #pkgs.texlive.combined.scheme-small - - (pkgs.texlive.combine { - inherit (pkgs.texlive) - scheme-small - collection-latexextra - collection-fontsextra - collection-fontsrecommended - palatino - textgreek - minted - tcolorbox - etoolbox - maths-symbols - greek-inputenc - babel - isodate - pst-graphicx - visualtikz - quantikz - tikz-feynman - pgfplots - cbfonts-fd - cbfonts - mathpazo - helvetic - circuitikz ; - - # To compile, call: - # $ pdflatex -shell-escape xxx.tex - # if missing packages, you can search if the required tex packages is in nixpkgs or not from here - # https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/tools/typesetting/tex/texlive/pkgs.nix - # if available, just add it to the above list - - }) - ]; - } - -- 2.44.2 From 7cbf52e96b8295e664c93eaea9433dd7f67cb0ab Mon Sep 17 00:00:00 2001 From: architeuthidae Date: Sun, 27 Oct 2024 14:50:40 +0100 Subject: [PATCH 3/3] Add README.md --- README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..203d77b --- /dev/null +++ b/README.md @@ -0,0 +1,20 @@ +# sinara-hw/datasheets + +Repository for Sinara hardware datasheets. + +## Build all + +```shell +nix build .#all-pdfs +``` + +Output files will be in `result`. + +### Build individual sheets + +```shell +nix develop +make 1124 +``` + +Output files will be in `build`. Run make twice in a row to get correct output for all LaTeX features, i.e. in particular correct "page x of y" footnotes, which require two passes of the compiler. (`#all-pdfs` already does this automatically). Auxiliary files and clutter can be removed with `make clean`. \ No newline at end of file -- 2.44.2