summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2026-01-30 23:43:16 +0100
committerAmlal El Mahrouss <amlal@nekernel.org>2026-01-30 23:46:52 +0100
commit8ee220a5d984f83d5ee9d9eed224ab0551bc7cc3 (patch)
treeb6ea2c07598f1253832a1e00fb61b7f5fe5fa29d
parent9a5839719867e779eefc3cf11654bc1032232fd3 (diff)
feat: wg0{1..5}: some tiny refactors on the paper and ocaml scripts.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
-rw-r--r--Makefile38
-rw-r--r--source/wg01/paper.tex (renamed from source/wg01/wg01.tex)0
-rw-r--r--source/wg02/paper.tex (renamed from source/wg02/wg02.tex)0
-rw-r--r--source/wg03/paper.tex (renamed from source/wg03/wg03.tex)0
-rw-r--r--source/wg05/paper.tex (renamed from source/wg05/wg05.tex)0
-rw-r--r--source/wg05/tn001.05/paper.tex (renamed from source/wg05/tn/tn001.05.tex)0
-rw-r--r--tools/addentry.ml36
-rw-r--r--tools/addpaper.ml8
-rw-r--r--wg01.mk11
-rw-r--r--wg02.mk11
-rw-r--r--wg03.mk11
11 files changed, 81 insertions, 34 deletions
diff --git a/Makefile b/Makefile
index 1fcc9c8..24eca4a 100644
--- a/Makefile
+++ b/Makefile
@@ -1,36 +1,24 @@
# File: Makefile
# Author: Amlal El Mahrouss
# Purpose: Generate HTML and PDF papers from LaTex documents.
+# (C) 2025-2026 Amlal El Mahrouss.
+# Licensed under Apache 2.0.
PDFTEX ?= pdflatex
-HTTEX ?= htlatex
-# That one should exist honestly.
+HTMLTEX ?= htlatex
ECHO := @echo
.PHONY: all
-all: html-wg05 html-wg01 html-wg02 html-wg03
+all: wg05 wg01 wg02 wg03
$(ECHO) "=> Done building Tex files."
-.PHONY: html-wg05
-html-wg05:
- $(HTTEX) source/wg05/wg05.tex
- $(PDFTEX) source/wg05/wg05.tex
- $(HTTEX) source/wg05/tn/tn001.05.tex
- $(PDFTEX) source/wg05/tn/tn001.05.tex
-
-.PHONY: html-wg01
-html-wg01:
- $(HTTEX) source/wg01/wg01.tex
- $(PDFTEX) source/wg01/wg01.tex
-
-.PHONY: html-wg03
-html-wg03:
- $(HTTEX) source/wg03/wg03.tex
- $(PDFTEX) source/wg03/wg03.tex
-
-.PHONY: html-wg02
-html-wg02:
- $(HTTEX) source/wg02/wg02.tex
- $(PDFTEX) source/wg02/wg02.tex
-
+include wg01.mk
+include wg02.mk
+include wg03.mk
+.PHONY: wg05
+wg05:
+ $(HTMLTEX) source/wg05/paper.tex
+ $(PDFTEX) source/wg05/paper.tex
+ $(HTMLTEX) source/wg05/tn001.05/paper.tex
+ $(PDFTEX) source/wg05/tn001.05/paper.tex
diff --git a/source/wg01/wg01.tex b/source/wg01/paper.tex
index 931e80b..931e80b 100644
--- a/source/wg01/wg01.tex
+++ b/source/wg01/paper.tex
diff --git a/source/wg02/wg02.tex b/source/wg02/paper.tex
index 4f49ab5..4f49ab5 100644
--- a/source/wg02/wg02.tex
+++ b/source/wg02/paper.tex
diff --git a/source/wg03/wg03.tex b/source/wg03/paper.tex
index 34ac08c..34ac08c 100644
--- a/source/wg03/wg03.tex
+++ b/source/wg03/paper.tex
diff --git a/source/wg05/wg05.tex b/source/wg05/paper.tex
index da2fa29..da2fa29 100644
--- a/source/wg05/wg05.tex
+++ b/source/wg05/paper.tex
diff --git a/source/wg05/tn/tn001.05.tex b/source/wg05/tn001.05/paper.tex
index 176f22a..176f22a 100644
--- a/source/wg05/tn/tn001.05.tex
+++ b/source/wg05/tn001.05/paper.tex
diff --git a/tools/addentry.ml b/tools/addentry.ml
index 29dce37..79dd687 100644
--- a/tools/addentry.ml
+++ b/tools/addentry.ml
@@ -1,5 +1,5 @@
(*
- File: addrule.ml
+ File: addentry.ml
Purpose: Creates a makefile rule.
Copyright 2026, Amlal El Mahrouss & NeKernel.org Authors.
Licensed under Apache 2.0.
@@ -9,8 +9,32 @@ open Stdlib
open Out_channel
open Printf
-(*
- We just make a LaTeX file with the given title.
-*)
-let () = if Array.length Sys.argv >= 3 then
- printf "We are done here.";
+let paper_name_index : int = 2
+let file_index : int = 1
+
+let format = format_of_string
+ "
+
+PDFTEX ?= pdflatex
+HTMLTEX ?= htlatex
+
+.PHONY: %s
+%s:
+ $(HTMLTEX) source/%s/paper.tex
+ $(PDFTEX) source/%s/paper.tex
+"
+;;
+
+let () =
+ if Array.length Sys.argv >= 3 then
+ let out_file = Sys.argv.(file_index) ^ ".mk" in
+ let file = open_text out_file in
+ let name = Sys.argv.(paper_name_index) in
+
+ fprintf file format name name name name;
+
+ close_out file
+ else (
+ printf "addentry: Add paper Makefile entry.\n";
+ printf "addentry: usage: <file_index> <paper_name_index>\n"
+ ) \ No newline at end of file
diff --git a/tools/addpaper.ml b/tools/addpaper.ml
index ec91c58..e6cca9b 100644
--- a/tools/addpaper.ml
+++ b/tools/addpaper.ml
@@ -9,6 +9,7 @@ open Stdlib
open Out_channel
open Printf
+let email_index : int = 4
let author_index : int = 3
let title_index : int = 2
let file_index : int = 1
@@ -21,7 +22,7 @@ let format = format_of_string "
\\usepackage[margin=0.5in,top=1in,bottom=1in]{geometry}
\\title{%s}
-\\author{%s.\\\\john@nekernel.org}
+\\author{%s.\\\\%s}
\\date{\\today}
\\begin{document}
@@ -40,13 +41,14 @@ let format = format_of_string "
(*
We just make a LaTeX file with the given title.
*)
-let () = if Array.length Sys.argv >= 4 then
+let () = if Array.length Sys.argv >= 5 then
let out_file : string = Sys.argv.(file_index)^".tex" in
let file : out_channel = open_text out_file in
fprintf file format Sys.argv.(title_index);
fprintf file format Sys.argv.(author_index);
+ fprintf file format Sys.argv.(email_index);
close_out file;
else (
- printf "addpaper: Creates LaTeX papers.\n";
+ printf "addpaper: Creates papers for TeX.\n";
printf "addpaper: usage: <file_name> <document_title>\n"
);
diff --git a/wg01.mk b/wg01.mk
new file mode 100644
index 0000000..d93f7ef
--- /dev/null
+++ b/wg01.mk
@@ -0,0 +1,11 @@
+# File: wg01.tex
+# Author: Amlal El Mahrouss
+# Purpose: Generate HTML and PDF papers from LaTex documents.
+# (C) 2025-2026 Amlal El Mahrouss.
+# Licensed under Apache 2.0.
+
+.PHONY: wg01
+wg01:
+ $(HTMLTEX) source/wg01/paper.tex
+ $(PDFTEX) source/wg01/paper.tex
+
diff --git a/wg02.mk b/wg02.mk
new file mode 100644
index 0000000..e12bab3
--- /dev/null
+++ b/wg02.mk
@@ -0,0 +1,11 @@
+# File: wg02.tex
+# Author: Amlal El Mahrouss
+# Purpose: Generate HTML and PDF papers from LaTex documents.
+# (C) 2025-2026 Amlal El Mahrouss.
+# Licensed under Apache 2.0.
+
+.PHONY: wg02
+wg02:
+ $(HTMLTEX) source/wg02/paper.tex
+ $(PDFTEX) source/wg02/paper.tex
+
diff --git a/wg03.mk b/wg03.mk
new file mode 100644
index 0000000..896d9bb
--- /dev/null
+++ b/wg03.mk
@@ -0,0 +1,11 @@
+# File: wg03.tex
+# Author: Amlal El Mahrouss
+# Purpose: Generate HTML and PDF papers from LaTex documents.
+# (C) 2025-2026 Amlal El Mahrouss.
+# Licensed under Apache 2.0.
+
+.PHONY: wg03
+wg03:
+ $(HTMLTEX) source/wg03/paper.tex
+ $(PDFTEX) source/wg03/paper.tex
+