\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{FAR}[19/03/2022 Class for the International Conference on Flight Vehicles, Aerothermodynamics and Re-entry (FAR) Manuscripts - by Jeroen Van den Eynde]
%-------------------------------------------
%           International Conference on 
%   Flight Vehicles, Aerothermodynamics and Re-entry
%-------------------------------------------
%       MANUSCRIPT TEMPLATE FOR LATEX
%-------------------------------------------   
%      Created by Jeroen Van den Eynde
% 

% ------------------------------------------------------------------------------
\LoadClass[10pt,twoside,twocolumn]{article}

% Document needs to be compiled with LuaLaTeX (or XeTeX) to use system fonts.
\RequirePackage{ifluatex,ifxetex}
\ifluatex
% Great! Do nothing.
\else
\ifxetex
% Also great. Do nothing.
\else
\ClassError{FAR}{Documents written with the FAR class need to be compiled using LuaLaTeX or XeTex to make use of system font.}{Please use LuaLaTeX or XeTeX to compile this document.}
\fi
\fi

% ------------------------------------------------------------------------------
% DOCUMENT PROPERTIES
% ------------------------------------------------------------------------------


% ------------------------------------------------------------------------------
% PAGE LAYOUT AND SETUP
% ------------------------------------------------------------------------------
% Set the dimensions and margins of the page
\RequirePackage[a4paper,%
		top=2.5cm, bottom=3.0cm,%
		left=2.54cm, right=2.54cm,%
		headsep=0.2cm,headheight=62pt,%
	    footskip=1.5cm]{geometry}

% Set styles for section and subsections		
\RequirePackage{titlesec}% Change style of sections
\titleformat{\section}{\fontsize{11pt}{13pt}\selectfont\bfseries}{\thesection.}{0.3cm}{\centering\uppercase}
\titleformat{\subsection}{\bfseries}{\thesubsection.}{0.3cm}{}
\titleformat{\subsubsection}{\itshape}{\thesubsubsection.}{0.3cm}{}

\titlespacing*{\section}{0pt}{12pt plus 1pt minus 1pt}{6pt plus 1pt}
\titlespacing*{\subsection}{0pt}{6pt plus 1pt minus 1pt}{3pt plus 1pt}
\titlespacing*{\subsubsection}{0pt}{6pt plus 1pt minus 1pt}{3pt plus 1pt}
\titlespacing*{\paragraph}{0pt}{0pt plus 1pt minus 1pt}{6pt plus 1pt}

% \RequirePackage[parfill]{parskip}% Non-zero paragraph

\renewcommand\abstractname{\uppercase{Abstract}}

% Set caption styles
\RequirePackage{caption}% Modify captions
\captionsetup{labelfont=bf,labelsep=period,aboveskip=6pt,belowskip=6pt}
\renewcommand{\figurename}{Fig}

% Make table rows slightly higher
\renewcommand{\arraystretch}{1.2}

% Set footnote size
\renewcommand{\footnotesize}{\fontsize{9pt}{11pt}\selectfont}

% Set itemize margins
\RequirePackage{enumitem}
\setlist[itemize]{leftmargin=13.8mm, labelsep=6.3mm}

% Multiple authors and affiliations
\RequirePackage{authblk}
\renewcommand\Authfont{\itshape}
\renewcommand\Affilfont{\normalfont}
\renewcommand*{\Authsep}{, }
\renewcommand*{\Authand}{, }
\renewcommand*{\Authands}{, }

% ------------------------------------------------------------------------------
% FONTS, GRAPHICS AND COLOURS
% ------------------------------------------------------------------------------
\RequirePackage{graphicx}% Ability to insert graphics
\RequirePackage{times}% Set Times New Roman
\RequirePackage{fontspec}% Specify system fonts

% ------------------------------------------------------------------------------
% HEADER AND FOOTER
% ------------------------------------------------------------------------------
\RequirePackage{array}% Columns with fixed width
\newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}

\RequirePackage{lastpage}% Get total number of pages
\RequirePackage{fancyhdr}% Headers and footers

\fancypagestyle{plain}{%
	\renewcommand{\headrulewidth}{0pt}%
	\fancyhf{}%
	\cfoot{\fontsize{8pt}{10pt}\selectfont 3rd International Conference on Flight Vehicles, Aerothermodynamics and Re-entry (FAR)\\18-22 May 2025. Arcachon, France}
}

\fancyhf{}% Clear style
\renewcommand{\headrulewidth}{0pt}% Remove header line
\renewcommand{\footrulewidth}{0pt}% Remove footer line

\pagestyle{plain}% Use these headers/footers everywhere

% ------------------------------------------------------------------------------
% FRONTMATTER AND TITLE PAGE
% ------------------------------------------------------------------------------

% % Arabic thanks
% \makeatletter
% \let\@fnsymbol\@arabic

% % Thanks formatting as Italic and slightly larger than normal footnotes.
% \def\thanks#1{\footnotemark                                                                    
% 	\protected@xdef\@thanks{\@thanks                                                           
% 		\protect\footnotetext[\the\c@footnote]{\fontsize{10pt}{12pt}\itshape\selectfont #1}}%                                           
% }                                                                                              
% \let\@thanks\@empty
% \makeatother

% Title
\makeatletter
\def\@maketitle{%
	\newpage
	\null
	\vskip 12pt%
	\begin{center}%
		\let \footnote \thanks
		{\fontsize{12pt}{15pt}\selectfont\bfseries \@title \par}%
		\vskip 12pt%
		{
			\begin{tabular}[t]{c}%
				\@author
			\end{tabular}\par}%
	\end{center}%
	\par
	\vskip 12pt}
\makeatother


% Keywords
\newcommand{\keywords}[1]{{\vspace{1em}\bfseries Keywords:}\, {\itshape #1}}

% ------------------------------------------------------------------------------