From c376cbddfc0832d904f2ac48734b72074971eb04 Mon Sep 17 00:00:00 2001 From: Erwan Normand Date: Wed, 26 Jun 2024 12:01:15 +0200 Subject: [PATCH] Use \import for chapters --- README.md | 2 +- main.tex | 45 +++++++++++++++++++++++---------------------- 2 files changed, 24 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 2711e22..4216338 100644 --- a/README.md +++ b/README.md @@ -5,5 +5,5 @@ Compile `main.tex` using either `pdflatex` with `biblatex` or `lualatex` (recomm You may need to install the following packages: ```bash -tlmgr install abstract acro babel-french comment epigraph eso-pic etoc inconsolata libertinus newtx nextpage sauerj sectsty shorttoc titlesec wallpaper +tlmgr install abstract acro babel-french comment epigraph eso-pic etoc import inconsolata libertinus newtx nextpage sauerj sectsty shorttoc titlesec wallpaper ``` diff --git a/main.tex b/main.tex index c0986b1..e96f81b 100644 --- a/main.tex +++ b/main.tex @@ -36,6 +36,8 @@ pdfversion=1.7 % Fix /includefigure warnings } +\usepackage{import} + \usepackage{siunitx} % For numbers with units \sisetup{ retain-explicit-plus=true, % Keep + in numbers @@ -74,11 +76,10 @@ \definechangesauthor[color=RawSienna]{CP} \newcommand{\CP}[1]{\comment[id=CP]{#1}} -\newcommand{\inputchapter}[1]{\clearemptydoublepage\input{#1}} % Load a chapter after a clear double page - -\newcommand{\inputchapterfigures}[2]{% Load a chapter (#2) with figures from a specific directory (#1) - \graphicspath{{#1/#2/figures/}}% - \inputchapter{#1/#2/#2}% +\newcommand{\inputchapter}[2]{% Load a chapter (#2) in a path (#1) + \clearemptydoublepage% after a clear double page + \graphicspath{{#1/figures/}}% with figures + \import{#1}{#2}% and relative paths \input in the chapter } \newcommand{\mainchapter}[1]{% @@ -104,33 +105,33 @@ \input{0-front/cover/cover} \selectlanguage{english} -\inputchapter{0-front/content/acknowledgement} -\inputchapter{0-front/content/abstract} -\inputchapter{0-front/content/résumé} -\inputchapter{0-front/content/contents} -\inputchapter{0-front/content/publications} -\inputchapter{0-front/content/acronyms} -\inputchapter{0-front/content/figures} -\inputchapter{0-front/content/tables} +\inputchapter{0-front/content}{acknowledgement} +\inputchapter{0-front/content}{abstract} +\inputchapter{0-front/content}{résumé} +\inputchapter{0-front/content}{contents} +\inputchapter{0-front/content}{publications} +\inputchapter{0-front/content}{acronyms} +\inputchapter{0-front/content}{figures} +\inputchapter{0-front/content}{tables} \mainmatter \input{1-introduction/part} -\inputchapterfigures{1-introduction}{introduction} -\inputchapterfigures{1-introduction}{related-work} +\inputchapter{1-introduction/introduction}{introduction} +\inputchapter{1-introduction/related-work}{related-work} \input{2-perception/perception} -\inputchapterfigures{2-perception}{xr-perception} -\inputchapterfigures{2-perception}{ar-textures} +\inputchapter{2-perception/xr-perception}{xr-perception} +\inputchapter{2-perception/ar-textures}{ar-textures} \input{3-manipulation/manipulation} -\inputchapterfigures{3-manipulation}{visual-hand} -\inputchapterfigures{3-manipulation}{visuo-haptic-hand} +\inputchapter{3-manipulation/visual-hand}{visual-hand} +\inputchapter{3-manipulation/visuo-haptic-hand}{visuo-haptic-hand} \input{4-conclusion/part} -\inputchapter{4-conclusion/conclusion} +\inputchapter{4-conclusion}{conclusion} \backmatter -\inputchapter{4-conclusion/bibliography} -\inputchapter{4-conclusion/backcover/backcover} +\inputchapter{4-conclusion}{bibliography} +\inputchapter{4-conclusion/backcover/}{backcover} \end{document}