Skip to content

Instantly share code, notes, and snippets.

@rawlik
Last active January 11, 2023 22:34
Show Gist options
  • Save rawlik/f468435c4639362d04847f547e27af54 to your computer and use it in GitHub Desktop.
Save rawlik/f468435c4639362d04847f547e27af54 to your computer and use it in GitHub Desktop.
Custom Latex style
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{rawlikstyle}[A custom style for latex documents]
% always use the UTF-8 encoding
\RequirePackage[utf8]{inputenc}
% clickable links
\RequirePackage{hyperref}
% palatino font for text and maths
\RequirePackage{mathpazo}
\usepackage[light]{FiraSans}
%\RequirePackage{cabin}
% title
\RequirePackage{titling}
\pretitle{\sffamily \scshape \Huge \centering}
\posttitle{\bigbreak}
\predate{\medskip \sffamily \scshape \large \centering}
\postdate{\medbreak}
% affiliations
\RequirePackage[noblocks,auth-sc,affil-it]{authblk}
% the abstract
\RequirePackage{abstract}
\renewcommand{\abstracttextfont}{\sffamily\normalsize}
\renewcommand{\abstractname}{} % clear the title
\renewcommand{\absnamepos}{empty} % originally center
% write dates in the day, month, year order
\RequirePackage[UKenglish]{isodate}
% style of the titles of the sections
\usepackage[sc,sf,bf]{titlesec}
% separate paragraphs with a space rather than indentation
\RequirePackage[parfill]{parskip}
% figures and graphics
\RequirePackage{graphicx}
\RequirePackage{subfig}
\RequirePackage[export]{adjustbox}
% decide on the exact placement of figures with [H]
\RequirePackage{float}
\RequirePackage[dvipsnames]{xcolor}
% Captions
\RequirePackage[font={small, sf},labelfont={sf,bf}]{caption}
\renewcommand\figurename{Fig.}
% bibliography
\RequirePackage[style=nature,backend=biber,url=false,isbn=false,date=year]{biblatex}
% small font in the bibliography
\renewcommand*{\bibfont}{\footnotesize}
% do not show the issue
\AtEveryBibitem{\clearfield{issue}}
% upright greek characters
\RequirePackage{upgreek}
\RequirePackage{textgreek}
% typeset units properly
\RequirePackage{siunitx}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment