Merge branch 'master' of git://projects.mako.cc:/latex_mako
This commit is contained in:
commit
e0a06dfb30
7
README
7
README
@ -2,18 +2,19 @@
|
||||
=== LaTeX Custom Scripts ======
|
||||
================================
|
||||
|
||||
Copyright (c) 2009 Benjamin Mako Hill <mako@atdot.cc>
|
||||
Copyright (c) 2009-2018 Benjamin Mako Hill <mako@atdot.cc>
|
||||
|
||||
This repository contains LaTeX configuration files that I use to format
|
||||
my papers. They are all released under the GNU GPL version 3 or later.
|
||||
|
||||
The latest version can be found at: http://mako.cc/scripts/
|
||||
The latest version can be found in git at:
|
||||
https://projects.mako.cc/source/latex_mako/
|
||||
|
||||
As scripts and configuration files, I do not "release" these files. You
|
||||
can always check out the latest version with Git with the following
|
||||
command:
|
||||
|
||||
git clone http://projects.mako.cc/source/latex_mako/.git
|
||||
git clone git://projects.mako.cc/latex_mako
|
||||
|
||||
Bug reports, comments, questions, and patches can all be directed to:
|
||||
|
||||
|
||||
2
paper_template/.gitignore
vendored
2
paper_template/.gitignore
vendored
@ -11,3 +11,5 @@
|
||||
/*.fdb_latexmk
|
||||
/*.fls
|
||||
/*.ttt
|
||||
/*.bcf
|
||||
/*.run.xml
|
||||
|
||||
@ -7,19 +7,14 @@ all: $(patsubst %.tex,%.pdf,$(wildcard *.tex))
|
||||
# %.tex: %.Rnw
|
||||
# Rscript -e "library(knitr); knit('$<')"
|
||||
|
||||
refs-processed.bib:
|
||||
perl -p -e 's/©//' refs.bib > refs-processed.bib
|
||||
perl -0pe 's/,\s+(file|abstract) = \{.*?\}(,\n|\n)/\2/sg' refs-processed.bib |sponge refs-processed.bib
|
||||
recode -d u8..ltex < refs-processed.bib | sponge refs-processed.bib
|
||||
|
||||
%.pdf: %.tex refs-processed.bib vc
|
||||
%.pdf: %.tex
|
||||
latexmk -f -pdf $<
|
||||
|
||||
clean:
|
||||
latexmk -C *.tex
|
||||
rm -f *.tmp
|
||||
rm -f *.tmp *.run.xml
|
||||
rm -f vc
|
||||
rm -f refs-processed.bib
|
||||
rm -f *.bbl
|
||||
# the following lines are useful for Rnw/knitr
|
||||
# rm -rf cache/ figure/
|
||||
# rm -f *.tex
|
||||
@ -33,3 +28,4 @@ vc:
|
||||
pdf: all
|
||||
|
||||
.PHONY: clean all
|
||||
# .PRECIOUS: %.tex
|
||||
|
||||
@ -9,6 +9,7 @@
|
||||
% available here: http://github.com/kjhealy/latex-custom-kjh/
|
||||
|
||||
\usepackage{lastpage}
|
||||
\usepackage{datetime}
|
||||
|
||||
% blank footnote
|
||||
% Use \symbolfootnote[0]{Footnote text} for a blank footnote.
|
||||
@ -209,8 +210,29 @@
|
||||
\makepsmarks{mako-mem-git}{\@gitmarks}
|
||||
\makeevenhead{mako-mem-git}{}{}{\scshape\thepage}
|
||||
\makeoddhead{mako-mem-git}{}{}{\scshape\thepage}
|
||||
\makeevenfoot{mako-mem-git}{}{\texttt{\footnotesize{\textcolor{Blue}{git revision \VCRevision\ on \VCDateTEX}}}}{}
|
||||
\makeoddfoot{mako-mem-git}{}{\texttt{\footnotesize \textcolor{Blue}{git revision \VCRevision\ on \VCDateTEX}}}{}
|
||||
\makeevenfoot{mako-mem-git}{}{\texttt{\footnotesize{\textcolor{BrickRed}{git revision \VCRevision\ on \VCDateTEX}}}}{}
|
||||
\makeoddfoot{mako-mem-git}{}{\texttt{\footnotesize \textcolor{BrickRed}{git revision \VCRevision\ on \VCDateTEX}}}{}
|
||||
|
||||
%%% print a datestamp from ShareLaTeX
|
||||
\makepagestyle{mako-mem-sharelatex}
|
||||
\newcommand{\@slmarks}{%
|
||||
\let\@mkboth\markboth
|
||||
\def\chaptermark##1{%
|
||||
\markboth{%
|
||||
\ifnum \c@secnumdepth >\m@ne
|
||||
\if@mainmatter
|
||||
\thechapter. \ %
|
||||
\fi
|
||||
\fi
|
||||
##1}{}}
|
||||
\def\sectionmark##1{%
|
||||
\markright{##1}}
|
||||
}
|
||||
\makepsmarks{mako-mem-sharelatex}{\@slmarks}
|
||||
\makeevenhead{mako-mem-sharelatex}{}{}{\scshape\thepage}
|
||||
\makeoddhead{mako-mem-sharelatex}{}{}{\scshape\thepage}
|
||||
\makeevenfoot{mako-mem-sharelatex}{}{\texttt{\footnotesize{\textcolor{BrickRed}{Buildstamp/Version:~\pdfdate}}}}{}
|
||||
\makeoddfoot{mako-mem-sharelatex}{}{\texttt{\footnotesize{\textcolor{BrickRed}{Buildstamp/Version:~\pdfdate}}}}{}
|
||||
|
||||
%% Create a command to make a note at the top of the first page describing the
|
||||
%% publication status of the paper.
|
||||
|
||||
@ -8,8 +8,7 @@
|
||||
% with article-3 \chapterstyle, change to: \pagestyle{memo}
|
||||
\pagestyle{mako-mem}
|
||||
|
||||
\usepackage{ucs}
|
||||
\usepackage[utf8x]{inputenc}
|
||||
\usepackage[utf8]{inputenc}
|
||||
|
||||
\usepackage[T1]{fontenc}
|
||||
\usepackage{textcomp}
|
||||
@ -33,8 +32,27 @@
|
||||
\hypersetup{colorlinks=true, linkcolor=Black, citecolor=Black, filecolor=Blue,
|
||||
urlcolor=Blue, unicode=true}
|
||||
|
||||
% list of footnote symbols for \thanks{}
|
||||
\makeatletter
|
||||
\renewcommand*{\@fnsymbol}[1]{\ensuremath{\ifcase#1\or *\or \dagger\or \ddagger\or
|
||||
\mathsection\or \mathparagraph\or \|\or **\or \dagger\dagger
|
||||
\or \ddagger\ddagger \else\@ctrerr\fi}}
|
||||
\makeatother
|
||||
\newcommand*\samethanks[1][\value{footnote}]{\footnotemark[#1]}
|
||||
|
||||
% add bibliographic stuff
|
||||
\usepackage[round]{natbib}
|
||||
\usepackage[american]{babel}
|
||||
\usepackage{csquotes}
|
||||
\usepackage[natbib=true, style=apa, backend=biber]{biblatex}
|
||||
\addbibresource{refs.bib}
|
||||
\DeclareLanguageMapping{american}{american-apa}
|
||||
|
||||
\defbibheading{secbib}[\bibname]{%
|
||||
\section*{#1}%
|
||||
\markboth{#1}{#1}%
|
||||
\baselineskip 14.2pt%
|
||||
\prebibhook}
|
||||
|
||||
\def\citepos#1{\citeauthor{#1}'s (\citeyear{#1})}
|
||||
\def\citespos#1{\citeauthor{#1}' (\citeyear{#1})}
|
||||
|
||||
@ -47,6 +65,10 @@
|
||||
% \input{vc}
|
||||
% \pagestyle{mako-mem-git}
|
||||
|
||||
% LATEX NOTE: this alternative line will just input a timestamp at the
|
||||
% build process, useful for sharelatex
|
||||
% \pagestyle{mako-mem-sharelatex}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\setlength{\parskip}{4.5pt}
|
||||
@ -162,10 +184,8 @@ lazy dog. The quick brown fox jumps over the lazy dog. The quick brown
|
||||
fox jumps over the lazy dog \citep{989866}.
|
||||
|
||||
% bibliography here
|
||||
\renewcommand{\bibsection}{\section{\bibname}\prebibhook}
|
||||
\baselineskip 14.2pt
|
||||
\bibliography{refs-processed}
|
||||
\bibliographystyle{apalike}
|
||||
\printbibliography[title = {References}, heading=secbib]
|
||||
|
||||
|
||||
\end{document}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user