Differences

This shows you the differences between two versions of the page.

Link to this comparison view

playground [2016/05/24 00:09] (current)
Line 1: Line 1:
 +====== LaTeX template for the PDF output ======
  
 +Here is a draft of a latex template:
 +<code latex 1>
 +\documentclass[a4paper,​ oneside, article]{memoir}
 +
 +\usepackage[T1]{fontenc}
 +\usepackage{fourier}
 +\usepackage{microtype}
 +\usepackage{hyperref}
 +
 +% Math stuff
 +\usepackage{amsmath}
 +
 +\usepackage{pst-barcode}
 +\usepackage{auto-pst-pdf}
 +\usepackage[math]{blindtext}
 +
 +\usepackage[absolute]{textpos}
 +\usepackage{lastpage} % For the last page number
 +
 +\usepackage{lipsum}
 +\usepackage{tikz}
 +
 +% ************ PAGE INPUTS **************
 +%  These entries should be given
 +
 +\author{PHT}
 +\title{This is my main title}
 +\newcommand{\thesubtitle}{This is my subtitle}
 +\newcommand{\thedraftdate}{January 23 2013}
 +\newcommand{\theurl}{http://​www.theshapeofmath.com}
 +
 +
 +% ************ PAGE LAYOUT **************
 +\setlength{\parindent}{0em}
 +\setlength{\parskip}{1.0\baselineskip}
 +
 +\settrimmedsize{11in}{210mm}{*}
 + ​\setlength{\trimtop}{0pt}
 + ​\setlength{\trimedge}{\stockwidth}
 + ​\addtolength{\trimedge}{-\paperwidth}
 + ​\settypeblocksize{8.75in}{30pc}{*}
 + ​\setulmargins{*}{*}{1}
 + ​\setlrmargins{*}{*}{0.9}
 + ​\setmarginnotes{17pt}{51pt}{\onelineskip}
 + ​\setheadfoot{\onelineskip}{2\onelineskip}
 + ​\setheaderspaces{*}{2\onelineskip}{*}
 + ​\checkandfixthelayout
 +
 +% ************ COLORS AND SECTIONS **************
 +\definecolor{lightburgundy}{rgb}{0.65,​0.52,​0.56}
 +\definecolor{burgundy}{rgb}{0.64,​0.28,​0.4}
 +\definecolor{purple}{HTML}{743579}
 +\definecolor{orange}{HTML}{B96B50}
 +\definecolor{green}{HTML}{76A648}
 +\definecolor{forest}{HTML}{38815E}
 +
 +\newcommand\secbar {
 + \tikz[baseline,​ trim left=2.8cm] ​
 + {
 +     \fill [white] (2.6cm,​0.2ex) rectangle +(0.2cm,​1ex);​
 +     \fill [black] (0cm,0.2ex) rectangle (2.6cm,​1ex);​  ​   ​
 + }
 +}
 +\newcommand\subsecbar {
 + \tikz[baseline,​ trim left=1.7cm] ​
 + {
 +     \fill [white] (1.5cm,​0.2ex) rectangle +(0.2cm,​1ex);​
 +     \fill [black] (0cm,0.2ex) rectangle (1.5cm,​1ex);​  ​   ​
 + }
 +}
 +\newcommand\subsubsecbar {
 + \tikz[baseline,​ trim left=0.7cm] ​
 + {
 +     \fill [white] (0.5cm,​0.2ex) rectangle +(0.2cm,​1ex);​
 +     \fill [black] (0cm,0.2ex) rectangle (0.5cm,​1ex);​  ​   ​
 + }
 +}
 +
 +\counterwithout{section}{chapter}
 +
 +\makeatletter
 +\renewcommand{\section}{%
 +  \sechook%
 +  \@startsection{section}{1}% ​ level 1
 +      {\secindent}% ​           heading indent
 +      {\beforesecskip}% ​       skip before the heading
 +      {\aftersecskip}% ​        skip after the heading
 +      {\noindent\llap{\secbar}\normalfont\secheadstyle}} % font
 +\setsecheadstyle{\large\memRTLraggedright}
 +\renewcommand{\subsection}{%
 +  \subsechook%
 +  \@startsection{subsection}{1}% ​ level 2
 +      {\subsecindent}% ​           heading indent
 +      {\beforesubsecskip}% ​       skip before the heading
 +      {\aftersubsecskip}% ​        skip after the heading
 +      {\noindent\llap{\subsecbar}\normalfont\subsecheadstyle}} % font
 +\setsubsecheadstyle{\large\memRTLraggedright}
 +\renewcommand{\subsubsection}{%
 +  \subsechook%
 +  \@startsection{subsection}{2}% ​ level 2
 +      {\subsubsecindent}% ​           heading indent
 +      {\beforesubsubsecskip}% ​       skip before the heading
 +      {\aftersubsubsecskip}% ​        skip after the heading
 +      {\noindent\llap{\subsubsecbar}\normalfont\subsubsecheadstyle}} % font
 +\setsubsubsecheadstyle{\large\itshape\memRTLraggedright}
 +\makeatother
 +
 +
 +\pagestyle{headings}
 +\makeoddfoot{headings}{}{}{\thepage/​\pageref{LastPage}}
 +\makeoddhead{headings}{}{}{}
 +
 +\begin{document}
 +
 +% ************ AUTHOR INITIAL **************
 +\begin{textblock}{1}(14.2,​0.5)
 +{\scshape \MakeLowercase{\theauthor}}
 +\end{textblock}
 +
 +% ************ TITLE BLOCK **************
 +\vspace*{-2cm}
 +\hfill
 +\begin{minipage}[t]{0.5\textwidth} \flushright
 +\vspace*{2pt}
 +{\Large \scshape \MakeLowercase{\thetitle}} \\
 +{\scshape \MakeLowercase{\color{burgundy}\thesubtitle}} ​
 +\end{minipage}
 +\hspace*{0.2cm}
 +\begin{minipage}[t]{0.4in}
 +\vspace*{0pt}
 +\begin{flushright}
 +\begin{pspicture}(0.4in,​0.4in)
 +\psbarcode{\theurl}{eclevel=L width=0.4 height=0.4}{qrcode}
 +\end{pspicture}
 +\end{flushright}
 +\end{minipage}
 +
 +\hfill ​
 +\begin{minipage}{0.7\textwidth}
 +\hrule \mbox{}
 +\end{minipage}
 +
 +% ************ DATE BLOCK **************
 +\let\thefootnote\relax\footnote{Drafted:​ \thedraftdate}
 +\let\thefootnote\relax\footnote{Printed:​ \today}
 +
 +
 +% The rest of this is to be replaced by the page's text
 +\section{Title}
 +\section{Another}
 +\subsection{Another subsection}
 +\begin{equation} \label{one}
 +a^2 + b^2 = c^2
 +\end{equation}
 +
 +Referring to this equation in \eqref{one}
 +
 +\subsubsection{A subsubsection}
 +
 +\blindtext
 +
 +\blindtext
 +
 +\blindmathpaper
 +
 +\end{document}
 +
 +
 +
 +</​code>​