From 2dabb156a1733ef1ecacc3c8e96925fa022e9804 Mon Sep 17 00:00:00 2001 From: Benjamin Mako Hill Date: Mon, 25 Jan 2016 08:58:09 -0800 Subject: [PATCH 1/8] make .tex files .PRECIOUS This is not necessary in the default arragement but it becomes important if/when we switch to having it be for Rnw/Rtex files. --- paper_template/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/paper_template/Makefile b/paper_template/Makefile index 05b7746..12f4232 100644 --- a/paper_template/Makefile +++ b/paper_template/Makefile @@ -33,3 +33,4 @@ vc: pdf: all .PHONY: clean all +# .PRECIOUS: %.tex From 31158d210fb825084dfdb15cc4e4798d4702dc93 Mon Sep 17 00:00:00 2001 From: Benjamin Mako Hill Date: Wed, 3 Feb 2016 11:28:58 -0800 Subject: [PATCH 2/8] updated color of git info to be red The previous blue was confusing because it looked like a hyperlink. --- paper_template/mako-mem.sty | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/paper_template/mako-mem.sty b/paper_template/mako-mem.sty index 5f80e40..d8f9fd7 100644 --- a/paper_template/mako-mem.sty +++ b/paper_template/mako-mem.sty @@ -209,8 +209,8 @@ \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}}}{} %% Create a command to make a note at the top of the first page describing the %% publication status of the paper. From 0e7100a49ee2a16878e527fee4e81d5a4b578723 Mon Sep 17 00:00:00 2001 From: Benjamin Mako Hill Date: Wed, 3 Aug 2016 15:53:11 -0400 Subject: [PATCH 3/8] updated to use biber/biblatex instead of bitex --- paper_template/.gitignore | 2 ++ paper_template/Makefile | 11 +++-------- paper_template/text.tex | 23 ++++++++++++++++------- 3 files changed, 21 insertions(+), 15 deletions(-) diff --git a/paper_template/.gitignore b/paper_template/.gitignore index 7599c73..5504ab4 100644 --- a/paper_template/.gitignore +++ b/paper_template/.gitignore @@ -11,3 +11,5 @@ /*.fdb_latexmk /*.fls /*.ttt +/*.bcf +/*.run.xml diff --git a/paper_template/Makefile b/paper_template/Makefile index 12f4232..8e9b554 100644 --- a/paper_template/Makefile +++ b/paper_template/Makefile @@ -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 diff --git a/paper_template/text.tex b/paper_template/text.tex index 2ae4f95..a59dfbd 100644 --- a/paper_template/text.tex +++ b/paper_template/text.tex @@ -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} @@ -34,7 +33,19 @@ urlcolor=Blue, unicode=true} % add bibliographic stuff -\usepackage[round]{natbib} +% add bibliographic stuff +\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})} @@ -162,10 +173,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} From e5a3725ffc71908db440d5ea32e0e070ad39d218 Mon Sep 17 00:00:00 2001 From: Benjamin Mako Hill Date: Sat, 22 Oct 2016 16:46:00 -0700 Subject: [PATCH 4/8] remove duplicated comment --- paper_template/text.tex | 1 - 1 file changed, 1 deletion(-) diff --git a/paper_template/text.tex b/paper_template/text.tex index a59dfbd..c8d746b 100644 --- a/paper_template/text.tex +++ b/paper_template/text.tex @@ -32,7 +32,6 @@ \hypersetup{colorlinks=true, linkcolor=Black, citecolor=Black, filecolor=Blue, urlcolor=Blue, unicode=true} -% add bibliographic stuff % add bibliographic stuff \usepackage[american]{babel} \usepackage{csquotes} From 4a46d628008cf09708408d572d537cd7f4852455 Mon Sep 17 00:00:00 2001 From: Benjamin Mako Hill Date: Sat, 22 Oct 2016 16:48:49 -0700 Subject: [PATCH 5/8] buildstamp alternative to git markings --- paper_template/mako-mem.sty | 22 ++++++++++++++++++++++ paper_template/text.tex | 4 ++++ 2 files changed, 26 insertions(+) diff --git a/paper_template/mako-mem.sty b/paper_template/mako-mem.sty index d8f9fd7..95c0b7f 100644 --- a/paper_template/mako-mem.sty +++ b/paper_template/mako-mem.sty @@ -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. @@ -212,6 +213,27 @@ \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. \newcommand{\published}[1]{% diff --git a/paper_template/text.tex b/paper_template/text.tex index c8d746b..fa5cb32 100644 --- a/paper_template/text.tex +++ b/paper_template/text.tex @@ -57,6 +57,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} From 8f2b03c57c3d6ac61dd9acc6e2ef6f0d244b8763 Mon Sep 17 00:00:00 2001 From: Benjamin Mako Hill Date: Fri, 16 Dec 2016 20:04:03 -0800 Subject: [PATCH 6/8] fixed footnote symbols for \thanks --- paper_template/text.tex | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/paper_template/text.tex b/paper_template/text.tex index fa5cb32..2866b4a 100644 --- a/paper_template/text.tex +++ b/paper_template/text.tex @@ -32,6 +32,13 @@ \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 + % add bibliographic stuff \usepackage[american]{babel} \usepackage{csquotes} From 4ab1ccbf9db4b4a983c5a09b90b7d9ef02875812 Mon Sep 17 00:00:00 2001 From: Benjamin Mako Hill Date: Fri, 16 Dec 2016 20:05:01 -0800 Subject: [PATCH 7/8] added \samethanks command --- paper_template/text.tex | 1 + 1 file changed, 1 insertion(+) diff --git a/paper_template/text.tex b/paper_template/text.tex index 2866b4a..e3f7f1d 100644 --- a/paper_template/text.tex +++ b/paper_template/text.tex @@ -38,6 +38,7 @@ \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[american]{babel} From c5c0f590725c2aa94940bf3e63f8400cfbf1f3d6 Mon Sep 17 00:00:00 2001 From: Benjamin Mako Hill Date: Sun, 6 May 2018 08:25:26 -0700 Subject: [PATCH 8/8] updated links to git repository --- README | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README b/README index d1e5fa9..2247df6 100644 --- a/README +++ b/README @@ -2,18 +2,19 @@ === LaTeX Custom Scripts ====== ================================ -Copyright (c) 2009 Benjamin Mako Hill +Copyright (c) 2009-2018 Benjamin Mako Hill 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: