From 457d2c8744042087bdc2b5a07ced4d931aaaf349 Mon Sep 17 00:00:00 2001 From: Ali Date: Wed, 18 Jan 2023 22:10:42 +0100 Subject: [PATCH] Updated README and automated adding authors --- README.md | 75 +++++++++++++++++++++++++--------------------- config/acm.tex | 9 +++++- config/ieee.tex | 5 +++- config/llncs.tex | 11 +++++-- main.tex | 23 +++++++------- user/packages.tex | 2 +- user/preamble.tex | 4 +-- user/settings.tex | 37 ++++++++++------------- user/topmatter.tex | 19 +++++++----- 9 files changed, 105 insertions(+), 80 deletions(-) diff --git a/README.md b/README.md index 63a44eb..452975c 100644 --- a/README.md +++ b/README.md @@ -1,39 +1,46 @@ -# ResearchPaperTemplate +# LaTeX Template for Computer Science Research Papers -### A Latex template that minimises the repetitve work of styling and eleminate writing style-specific tex code. -###### The template supports IEEEtran and acmart styles only. However, I am planning to add support for more styles later. +### A style-agnostic LaTeX template that eliminates the need to write style-specific code and eases switching between the typical document classes of computer science research papers. +###### The template supports *IEEEtran*, *llncs* and *acmart* styles only. Feel free to contribute and support more styles. --- -To write a paper, you only need to your content in tex files under the *sections* directory. -It is recommended to write each section in separate tex file, but the template works pefectly fine if you write all content in one file. - -Use the *variables.tex* file to define the title, abstract, keywords, document class (i.e. style), as well as the files in the *sections* directory that you would like them to be included. -Note that the files must be added in the same order you want them to appear. - -Example of *variables.tex*: - - \def \varTitle{insert title here} - \def \varAbstract{ - insert abstract here - } - \def \varKeywords{ - insert, comma-separated, keywords, here - } - \def \varDocClass{IEEEtran} - \def \varKeyvals{conference} - \def \varSections{introduction,section1,section2,conclusion} - -Note that you only need to insert/modify the arguments of the above commands. Check *variables.tex* - -In addition to the above, you need to define the authors in files specific to each style (e.g., *preamble/authorsIEEE.tex*). -This is the only place where you need to write style-specific tex code. -I need to find to way to allow author style to be configured dynamically such that users only define the authors and affiliations in the *variables.tex* file. -Feel free to contribute if you can help with this! - -You can also use the *preamble/packages.tex* and *preamble/configUser.tex* to add packages and user-define preabmle code such as listings, filecontents, etc. - -Finally, use *references.bib* for your bibliography. - +### Template Structure +* [main.tex](main.tex): the root document of the template. This file *must not* be modified. +* [bibliography](bibliography/): contains bibliography styles and references file. Only the references file shall be modified. +* [config](config/]: contains style-specific code and configurations. The contents of this directory *must not* be modified. +* [sections](sections/): directory to add paper sections and text. +* [user](user/): contains user-defined variables and configurations such as paper title, abstract, athors, and packages. --- -Feel free to contribute by completing any of the **TODO** comments or by adding support for other styles. +### Usage +To write a paper, you only need to add your content in tex files under the [*sections*](sections) directory. +It is recommended to write each section in separate tex file, but the template works perfectly fine if you write all content in one file only. + + +Specify template settings in [*settings.tex*](user/settings.tex). Set the style to be used (i.e., acm, ieee or llncs) as well as the sections to be included from the [sections](sections) directory. Note that the sections must be added in the same order you want them to appear. + +Example: + + \def \varStyle{llncs} + \def \varSections{introduction,conclusion} + + +Use the [*topmatter.tex*](user/topmatter.tex) file to define the title, authors, abstract, and keywords. + +Example: + + \addTitle{insert title here} + \addAuthor{Author}{1} + \addInstitution{Department, Institution}{City}{Country}{{name.surname}@example.com} + \addAbstract{insert abstract here} + \addKeywords{insert, comma-separated, keywords, here} + +Note that you only need to insert/modify the arguments of the above commands. + + +Use [*user/packages.tex*](user/packages.tex) and [*user/preamble.tex*](user/preamble.tex) to add packages and user-defined preabmle code (e.g., listings, acronyms) respectively. + + +Finally, use [*references.bib*](bibliography/references.bib) for your bibliography. + +--- diff --git a/config/acm.tex b/config/acm.tex index 6c506dd..95f41df 100644 --- a/config/acm.tex +++ b/config/acm.tex @@ -1,4 +1,6 @@ -% DO NOT MODIFY THIS FILE +%=============================% +% DO NOT MODIFY THIS FILE % +%=============================% \ifx\varDocClass\undefined \def \varDocClass{acmart} @@ -39,10 +41,15 @@ \newcommand{\addAbstract}[1]{\def\varAbstract{#1}} \newcommand{\addTitle}[1]{\def\varTitle{#1}} \newcommand{\addKeywords}[1]{\def\varKeywords{#1}} +\def\insertRunningHeads{} +\newcommand{\setRunningHeads}[1]{ + \def\insertRunningHeads{\renewcommand{\shortauthors}{#1}} +} \newcommand{\insertTopmatter}{ \title{\varTitle} \insertAuthors + \insertRunningHeads \begin{abstract} \varAbstract \end{abstract} diff --git a/config/ieee.tex b/config/ieee.tex index 5a4482e..5482727 100644 --- a/config/ieee.tex +++ b/config/ieee.tex @@ -1,4 +1,6 @@ -% DO NOT MODIFY THIS FILE +%=============================% +% DO NOT MODIFY THIS FILE % +%=============================% \ifx\varDocClass\undefined \def \varDocClass{IEEEtran} @@ -36,6 +38,7 @@ \newcommand{\addAbstract}[1]{\def\varAbstract{#1}} \newcommand{\addTitle}[1]{\def\varTitle{#1}} \newcommand{\addKeywords}[1]{\def\varKeywords{#1}} +\newcommand{\setRunningHeads}[1]{} \newcommand{\insertTopmatter}{ \title{\varTitle} diff --git a/config/llncs.tex b/config/llncs.tex index 2cb9a63..c0bfdea 100644 --- a/config/llncs.tex +++ b/config/llncs.tex @@ -1,4 +1,6 @@ -% DO NOT MODIFY THIS FILE +%=============================% +% DO NOT MODIFY THIS FILE % +%=============================% \ifx\varDocClass\undefined \def \varDocClass{llncs} @@ -42,10 +44,15 @@ } \makeatother +\def\insertRunningHeads{} +\newcommand{\setRunningHeads}[1]{\def\insertRunningHeads{\authorrunning{#1}}} + + \newcommand{\insertTopmatter}{ \title{\varTitle} \author{\varAuthors} - \institute{\varInstitutions} + \institute{\varInstitutions} + \insertRunningHeads \maketitle \begin{abstract} \varAbstract diff --git a/main.tex b/main.tex index 71533db..582cdc6 100644 --- a/main.tex +++ b/main.tex @@ -1,13 +1,14 @@ -% DO NOT MODIFY THIS FILE +%=============================% +% DO NOT MODIFY THIS FILE % +%=============================% -% The only files to be modified are: -% user/*.tex -% sections/*.tex -% bibliography/references.bib -% -% Add your text in tex files in the 'sections' directory. -% Update variables.tex to determine which files to include -% from 'sections' directory +% % The only files to be modified are: +% % user/*.tex +% % sections/*.tex +% % bibliography/references.bib + +% % Add your text in tex files in the 'sections' directory. +% % Update settings.tex to determine which files to include from 'sections' directory \input{user/settings} \input{config/\varStyle} @@ -27,4 +28,6 @@ \setBibStyle \bibliography{bibliography/references.bib} -\end{document} \ No newline at end of file +\end{document} + +% % Template available on GitHub: https://github.com/HaririAli/cs-paper-template \ No newline at end of file diff --git a/user/packages.tex b/user/packages.tex index cf5ced6..958a1b0 100644 --- a/user/packages.tex +++ b/user/packages.tex @@ -1 +1 @@ -% Add packages here \ No newline at end of file +% % Add packages here \ No newline at end of file diff --git a/user/preamble.tex b/user/preamble.tex index 215e53c..be5d972 100644 --- a/user/preamble.tex +++ b/user/preamble.tex @@ -1,5 +1,5 @@ -% Add user-defined configurations here. -% Example: listing style +% % Add user-defined preamble here. +% % Example: listing style or acronyms %\lstdefinestyle{numbers}{ % numbers=right, diff --git a/user/settings.tex b/user/settings.tex index cbe7f12..d1ad314 100644 --- a/user/settings.tex +++ b/user/settings.tex @@ -1,25 +1,20 @@ -% Define style -% This must be one of the following 3 values: acm, ieee, llncs -\def \varStyle{llncs} -% If style is set to acm, -% then document class will be set to acmart and keyvals will be set to sigconf -% If style is set to ieee, -% then document class will be set to IEEEtran and keyvals will be set to conference -% If style is set to llncs, -% then document class will be set to llncs and keyvals will be set to runningheads -% These settings can be overriden in the following blocks +% % Define style +% % This must be one of the following 3 values: acm, ieee, llncs +\def \varStyle{ieee} +% % If style is set to acm, +% % then document class will be set to acmart and keyvals will be set to sigconf +% % If style is set to ieee, +% % then document class will be set to IEEEtran and keyvals will be set to conference +% % If style is set to llncs, +% % then document class will be set to llncs and keyvals will be set to runningheads -% This is the required argument (what goes between the curly braces) in -% \documentclass[keyvals]{class} Uncomment the following line to override -% the document class. -%\def \varDocClass{acmart} - -% This is the optional argument (what goes between the square brackets) in -% \documentclass[keyvals]{class} Uncomment the following line to override -% the keyvals +% % The keyvals settings can be overridden in the following block +% % This is the optional argument (what goes between the square brackets) in +% % \documentclass[keyvals]{class} Uncomment the following line to override +% % the keyvals %\def \varKeyvals{sigconf} -% Define the sections of the paper as a comma-separated list without spaces. -% Each item in the list must refer to a tex file in the sections directory. -% Add the filename only without the extension. +% % Define the sections of the paper as a comma-separated list without spaces. +% % Each item in the list must refer to a tex file in the sections directory. +% % Add the filename only without the extension. \def \varSections{introduction,conclusion} \ No newline at end of file diff --git a/user/topmatter.tex b/user/topmatter.tex index be3290d..85c8f17 100644 --- a/user/topmatter.tex +++ b/user/topmatter.tex @@ -1,22 +1,25 @@ -% Add top matter (i.e., title, abstract, authors, and keywords) -% of the paper in this file +% % Add top matter (i.e., title, abstract, authors, and keywords) +% % of the paper in this file -% Set the title here +% % Set the title here \addTitle{insert title here} -% Set the authors and their affiliations here -% Author affiliations are passed in the second argument as numbers -% referring to the positions of institutions as defined below. +% % Set the authors and their affiliations here +% % Author affiliations are passed in the second argument as numbers +% % referring to the positions of institutions as defined below. \addAuthor{Author One}{1,2} \addAuthor{Author Two}{1} \addAuthor{Author Three}{2} \addInstitution{Department, Institution1}{City1}{Country1}{{name.surname}@domain1.com} \addInstitution{Institution2}{City2}{Country2}{{n.surname}@domain2.com} -% Write the abstract here +% % Set running heads here (i.e., authors' names to appear on page headers) +% \setRunningHeads{Author One et al.} + +% % Write the abstract here \addAbstract{ insert abstract here } -% Set the keywords here +% % Set the keywords here \addKeywords{insert, comma-separated, keywords, here} \ No newline at end of file