From 634f685c91d10db2bbefcca6f040b8e26266fef4 Mon Sep 17 00:00:00 2001 From: Daniel Rosel Date: Wed, 22 Oct 2025 12:20:28 +0200 Subject: [PATCH] paper migration --- .github/workflows/latex.yml | 21 ++++++++++++++++++++ paper/.dir-locals.el | 10 ++++++++++ paper/.gitignore | 15 ++++++++++++++ paper/.latexmkrc | 8 ++++++++ paper/Makefile | 32 ++++++++++++++++++++++++++++++ paper/README.md | 1 + paper/src/auto/main.el | 17 ++++++++++++++++ paper/src/bib/references.bib | 0 paper/src/chapters/01-intro.tex | 10 ++++++++++ paper/src/main.tex | 22 +++++++++++++++++++++ paper/src/preamble.tex | 35 +++++++++++++++++++++++++++++++++ 11 files changed, 171 insertions(+) create mode 100644 .github/workflows/latex.yml create mode 100644 paper/.dir-locals.el create mode 100644 paper/.gitignore create mode 100644 paper/.latexmkrc create mode 100644 paper/Makefile create mode 100644 paper/README.md create mode 100644 paper/src/auto/main.el create mode 100644 paper/src/bib/references.bib create mode 100644 paper/src/chapters/01-intro.tex create mode 100644 paper/src/main.tex create mode 100644 paper/src/preamble.tex diff --git a/.github/workflows/latex.yml b/.github/workflows/latex.yml new file mode 100644 index 0000000..4c0fb1b --- /dev/null +++ b/.github/workflows/latex.yml @@ -0,0 +1,21 @@ +name: Build PDF +on: + push: + branches: [ main ] + pull_request: +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: xu-cheng/texlive-action@v2 + with: + scheme: small + run: | + tlmgr install biber biblatex csquotes geometry microtype hyperref cleveref siunitx booktabs graphics caption latexmk + make pdf + - name: Upload PDF + uses: actions/upload-artifact@v4 + with: + name: thesis-pdf + path: build/main.pdf diff --git a/paper/.dir-locals.el b/paper/.dir-locals.el new file mode 100644 index 0000000..4707831 --- /dev/null +++ b/paper/.dir-locals.el @@ -0,0 +1,10 @@ +((latex-mode + . ((TeX-engine . default) ; or luatex/xetex + (TeX-command-extra-options . "-file-line-error -interaction=nonstopmode") + (TeX-master . "/home/velocitatem/Documents/Projects/PHANTOM/paper/src/main.tex") + (TeX-source-correlate-mode . t) + (TeX-source-correlate-start-server . t) + (TeX-PDF-mode . t) + (reftex-mode . t) + (reftex-cite-format . "\\parencite{%l}") + (fill-column . 100)))) diff --git a/paper/.gitignore b/paper/.gitignore new file mode 100644 index 0000000..cad33a2 --- /dev/null +++ b/paper/.gitignore @@ -0,0 +1,15 @@ +# .gitignore +build/ +*.synctex.gz +*.aux +*.log +*.bbl +*.bcf +*.blg +*.run.xml +*.fdb_latexmk +*.fls +*.out +*.toc +*.lof +*.lot diff --git a/paper/.latexmkrc b/paper/.latexmkrc new file mode 100644 index 0000000..d614114 --- /dev/null +++ b/paper/.latexmkrc @@ -0,0 +1,8 @@ +$pdf_mode = 1; +$pdflatex = 'pdflatex -synctex=1 -interaction=nonstopmode -file-line-error %O %S'; +$aux_dir = 'build'; +$out_dir = 'build'; +$use_biber = 0; # force bibtex +$bibtex = 'bibtex %O %B'; +$pdf_previewer = 'zathura %O %S'; +$clean_ext = 'synctex.gz bbl bcf run.xml fls fdb_latexmk glg glo gls ist blg lof lot out toc'; diff --git a/paper/Makefile b/paper/Makefile new file mode 100644 index 0000000..f4ddab8 --- /dev/null +++ b/paper/Makefile @@ -0,0 +1,32 @@ +LATEXMK := latexmk +SRCDIR := src +BUILDDIR := build +TEX := main.tex +JOBNAME := main +PDF := $(BUILDDIR)/$(JOBNAME).pdf + +all: pdf + +$(BUILDDIR): + mkdir -p $(BUILDDIR) + +pdf: $(BUILDDIR) + @cd $(SRCDIR) && \ + $(LATEXMK) -pdf -jobname=$(JOBNAME) \ + -interaction=nonstopmode -file-line-error \ + -outdir=../$(BUILDDIR) $(TEX) + +watch: $(BUILDDIR) + @cd $(SRCDIR) && \ + $(LATEXMK) -pvc -pdf -jobname=$(JOBNAME) \ + -interaction=nonstopmode -file-line-error \ + -r ../.latexmkrc \ + -outdir=../$(BUILDDIR) $(TEX) + +clean: + @cd $(SRCDIR) && \ + $(LATEXMK) -C -jobname=$(JOBNAME) -outdir=../$(BUILDDIR) || true + rm -rf $(BUILDDIR)/* + + +.PHONY: all pdf clean watch diff --git a/paper/README.md b/paper/README.md new file mode 100644 index 0000000..f733935 --- /dev/null +++ b/paper/README.md @@ -0,0 +1 @@ +This is a LaTeX thesis project. The src/ directory contains the main LaTeX source files including main.tex, preamble.tex, and chapter files in chapters/. Bibliography references are stored in src/bib/references.bib. The src/auto/ directory contains Emacs auto-generated files (gitignored). Build artifacts are output to build/. To compile the thesis run `make pdf`, use `make watch` for continuous compilation during editing, and `make clean` to remove build files. diff --git a/paper/src/auto/main.el b/paper/src/auto/main.el new file mode 100644 index 0000000..4097669 --- /dev/null +++ b/paper/src/auto/main.el @@ -0,0 +1,17 @@ +;; -*- lexical-binding: t; -*- + +(TeX-add-style-hook + "main" + (lambda () + (setq TeX-command-extra-options + "-file-line-error -interaction=nonstopmode") + (TeX-add-to-alist 'LaTeX-provided-class-options + '(("report" "12pt") ("article" "12pt"))) + (TeX-run-style-hooks + "latex2e" + "preamble" + "chapters/01-intro" + "article" + "art12")) + :latex) + diff --git a/paper/src/bib/references.bib b/paper/src/bib/references.bib new file mode 100644 index 0000000..e69de29 diff --git a/paper/src/chapters/01-intro.tex b/paper/src/chapters/01-intro.tex new file mode 100644 index 0000000..2133d8c --- /dev/null +++ b/paper/src/chapters/01-intro.tex @@ -0,0 +1,10 @@ +%% Cite like this \parencite{knuth1984texbook}. See \cref{fig:example}. +%% \begin{figure}[h] +%% \centering +%% \includegraphics[width=.7\linewidth]{figures/example.pdf} +%% \caption{Example figure.} +%% \label{fig:example} +%% \end{figure} + +\section{Know They Enemy} +To know how to overcome we need to diff --git a/paper/src/main.tex b/paper/src/main.tex new file mode 100644 index 0000000..272213c --- /dev/null +++ b/paper/src/main.tex @@ -0,0 +1,22 @@ +% -*- TeX-master: t -*- +\documentclass[12pt]{article} +\input{preamble} + +\begin{document} +\title{Agent-Aware Defenses for Dynamic Pricing and Recommendation Systems under Adversarial Traffic} +\author{Daniel Rösel\\ +\texttt{daniel@alves.world}\\[0.5em] +IE University\\ +Madrid, Spain} +\date{} +\maketitle +\begin{abstract} +The introduction of AI agents into the ecosystem of online commerce which is run on dynamic pricing algorithms is disruptive to their own nature. +\end{abstract} + + + +\input{chapters/01-intro} + +\printbibliography +\end{document} diff --git a/paper/src/preamble.tex b/paper/src/preamble.tex new file mode 100644 index 0000000..09b02bc --- /dev/null +++ b/paper/src/preamble.tex @@ -0,0 +1,35 @@ +\usepackage[margin=1in]{geometry} +\usepackage{microtype} +\usepackage{csquotes} +\usepackage{graphicx} +\usepackage{subcaption} +\usepackage{booktabs} +\usepackage{siunitx} +\usepackage{amsmath} +\usepackage{hyperref} +\usepackage{cleveref} +\usepackage[backend=bibtex,style=numeric]{biblatex} +\addbibresource{bib/references.bib} +\hypersetup{colorlinks=true,linkcolor=blue,citecolor=blue,urlcolor=blue} +\numberwithin{figure}{section} +\numberwithin{table}{section} + +% Custom title formatting to match template +\usepackage{titling} +\pretitle{\begin{center}\noindent\rule{\linewidth}{0.4pt}\par\vspace{1em}\LARGE\bfseries} +\posttitle{\par\end{center}\vspace{0.5em}} +\preauthor{\begin{center}\large} +\postauthor{\end{center}} +\predate{\begin{center}\large} +\postdate{\end{center}\vspace{1em}} + +% Redefine abstract environment +\renewenvironment{abstract}{% + \begin{center}% + \textbf{Abstract}% + \end{center}% + \par\vspace{0.5em}% + \small% +}{% + \par\vspace{1em}\noindent\rule{\linewidth}{0.4pt}% +}