Skip to content

Instantly share code, notes, and snippets.

@jcsalomon
Created August 31, 2012 13:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jcsalomon/3552618 to your computer and use it in GitHub Desktop.
Save jcsalomon/3552618 to your computer and use it in GitHub Desktop.
Article template for TeXworks
% !TeX program = pdflatex
% !TeX encoding = utf-8
% !TeX spellcheck = en_US
% Updates at <https://gist.github.com/3552618>
\documentclass[11pt]{article}
\usepackage{ifluatex, ifxetex}
\newif\ifmoderntex
\ifluatex \moderntextrue \fi
\ifxetex \moderntextrue \fi
% Encoding & fonts
\ifmoderntex
\usepackage{fontspec}
\setmainfont[Ligatures=TeX,Numbers={OldStyle,Proportional}]{Constantia}
\setsansfont[Ligatures=TeX,Numbers={OldStyle,Proportional}]{Calibri}
\setmonofont[Numbers={OldStyle}]{Consolas}
% \usepackage{unicode-math}
% \setmathfont{Cambria Math}
\else
\usepackage[utf8]{inputenc}
\usepackage[oldstylenums,largesmallcaps]{kpfonts}
\fi
%% Page Dimensions
%\usepackage{geometry} % to change the page dimensions
%\geometry{letterpaper} % or a4paper or…
% \geometry{margin=2in} % for example, change the margins to 2 inches all round
% \geometry{landscape} % set up the page for landscape
% read geometry.pdf for detailed page layout information
%\usepackage{graphicx}
%% Packages
%\usepackage{booktabs} % for much better looking tables
%\usepackage{array} % for better arrays (eg matrices) in maths
%\usepackage{paralist} % very flexible & customisable lists (eg. enumerate/itemize, etc.)
%\usepackage{verbatim} % adds environment for commenting out blocks of text & for better verbatim
%\usepackage{subfig} % make it possible to include more than one captioned figure/table in a single float
%% Headers & Footers
%\usepackage{fancyhdr} % This should be set AFTER setting up the page geometry
%\pagestyle{fancy} % options: empty , plain , fancy
%\renewcommand{\headrulewidth}{0pt} % customise the layout...
%\lhead{}\chead{}\rhead{}
%\lfoot{}\cfoot{\thepage}\rfoot{}
%% Section Title Appearance
%\usepackage{sectsty}
%\allsectionsfont{\sffamily\mdseries\upshape} % (See the fntguide.pdf for font help)
%% (This matches ConTeXt defaults)
%%%% ToC Appearance
%\usepackage[nottoc,notlof,notlot]{tocbibind} % Put the bibliography in the ToC
%\usepackage[titles,subfigure]{tocloft} % Alter the style of the Table of Contents
%\renewcommand{\cftsecfont}{\rmfamily\mdseries\upshape}
%\renewcommand{\cftsecpagefont}{\rmfamily\mdseries\upshape} % No bold!
% Language & hyphenation
% Clear aux files when switching engines
\ifmoderntex
\ifxetex
\usepackage{polyglossia}
\setmainlanguage[variant=american]{english}
\fi
\ifluatex
\usepackage[english]{babel}
\fi
\else
\usepackage[english]{babel}
\fi
\usepackage[strict]{csquotes}
\MakeAutoQuote{“}{”}
\usepackage[all]{foreign}
\DeclareRobustCommand\etc{\xperiodafter{{{\itshape\&}\foreignabbrfont{c}}}}
\usepackage{hyphenat}
\newcommand{\parbreak}{\medskip\noindent}
\ifmoderntex
\newcommand{\textemdashskip}{\textemdash\hskip0pt}
\catcode`\—=\active
\let—=\textemdashskip
\newcommand{\textellipsisat}{\textellipsis\@}
\catcode`\…=\active
\let…=\textellipsisat
\else
\DeclareUnicodeCharacter{00D7}{\ensuremath{\times}}
\DeclareUnicodeCharacter{2014}{\textemdash\hskip0pt}
\DeclareUnicodeCharacter{2026}{\textellipsis\@}
\fi
\title{Brief Article}
\author{The Author}
%\date{} % Activate to display a given date or no date (if empty),
% otherwise the current date is printed
\begin{document}
\maketitle
%\section{First section}
%\subsection{A subsection}
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment