Skip to content

Instantly share code, notes, and snippets.

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 JohnLukeBentley/8e68155dd12373a1aed283ac5babaf47 to your computer and use it in GitHub Desktop.
Save JohnLukeBentley/8e68155dd12373a1aed283ac5babaf47 to your computer and use it in GitHub Desktop.
\documentclass[12pt,a4paper]{article}
\usepackage{a4wide}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Demo
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\usepackage[UKenglish]{babel}
\begin{filecontents}{\jobname.bib}
% Common
@book{plato_2004_republic,
author = {{Plato}},
date = {2004},
origdate = {-0379~},
title = {Republic},
note = {bibtex*: plato\_2004\_republic},
translator = {Reeve, C. D. C.},
publisher = {{Hackett Publishing Company, Inc.}},
pagetotal = {392},
isbn = {0-87220-737-4},
edition = {3rd edition},
location = {{Indianapolis}},
timestamp = {2017-08-13T08:21:57Z}
}
@book{epictetus_1916_enchiridion,
author = {{Epictetus}},
date = {1916},
origdate = {0125~},
title = {Enchiridion},
addendum = {Arrian was the disciple who compiled this work.},
note = {bibtex*: epictetus\_1916\_enchiridion},
editoratype = {collaborator},
translator = {Matheson, P. E.},
editora = {Arrian},
url = {http://www.sacred-texts.com/cla/dep/dep102.htm},
timestamp = {2017-08-13T08:21:57Z}
}
@article{chalmers_1995_facing,
author = {Chalmers, David J.},
date = {1995-03-01},
title = {Facing up to the Problem of Consciousness},
keywords = {Consciousness,dualism,experience,explanation,functionalism,hard problem,information,materialism,qualia,reduction},
note = {bibtex*: chalmers\_1995\_facinga},
pages = {200--219},
journaltitle = {Journal of Consciousness Studies},
number = {3},
abstract = {To make progress on the problem of consciousness, we have to confront it directly. In this paper, I first isolate the truly hard part of the problem, separating it from more tractable parts and giving an account of why it is so difficult to explain. I critique some recent work that uses reductive methods to address consciousness, and argue that these methods inevitably fail to come to grips with the hardest part of the problem. Once this failure is recognized, the door to further progress is opened. In the second half of the paper, I argue that if we move to a new kind of nonreductive explanation, a naturalistic account of consciousness can be given. I put forward my own candidate for such an account: a nonreductive theory based on principles of structural coherence and organizational invariance and a double-aspect view of information.},
url = {http://www.ingentaconnect.com/content/imp/jcs/1995/00000002/00000003/653},
issn = {1355-8250},
volume = {2},
timestamp = {2017-08-13T08:21:57Z}
}
@book{galilei_1590_motion,
author = {Galilei, Galileo},
date = {1590~},
title = {On Motion},
addendum = {In Latin ``De Motu Antiquiora"},
note = {bibtex*: galilei\_1590\_motion},
timestamp = {2017-08-13T08:21:57Z}
}
@book{aquinas_1273_compendium,
author = {Aquinas, Thomas},
date = {1273~},
title = {Compendium of Theology},
note = {bibtex*: aquinas\_1273\_compendium},
timestamp = {2017-08-13T08:21:57Z}
}
@book{aquinas_1256_two,
author = {Aquinas, Thomas},
date = {1256?},
title = {Two Sermons from {{MS}} Florence},
note = {bibtex*: aquinas\_1256\_two},
timestamp = {2017-08-13T08:21:57Z}
}
% Years exceeding four digits
@book{rebels_y-51234_rebel,
author = {{Rebels}},
title = {Rebel Plans for Death Star Attack},
addendum = {This is going to contradict Star Wars cannon},
year = {y-51234},
timestamp = {2017-10-22T01:00:57Z}
}
@book{seldon_y52000_encyclopedia,
author = {Seldon, Hari},
title = {Encyclopedia Galactica},
year = {y52000},
publisher = {{The Psychohistorians}},
location = {{Terminus}},
timestamp = {2017-10-22T01:06:37Z}
}
\end{filecontents}
\PassOptionsToPackage{%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Dates and Datetimes
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% julian=true,% convert dates before gregorianstart to Julian Calendar
% gregorianstart=1582-10-15,% Default
alldates=ymd, % year, short, long, terse, comp, ymd, edtf. ymd = Year-Month-Day format
labeldate=ymd, % year, short, long, terse, comp, ymd, edtf. ymd = Year-Month-Day format
alldatesusetime=true, % print time components in non-compact date ranges
labeldateusetime=true,
alltimes=24h, % 12h, 24h, 24hcomp.
seconds=false,
timezones=true,
datezeros=true,
% dateera=astronomical (default), secular, christian
% astronomical dates, controlled by datezero
% secular (prints BCE/CE) controlled by dateerauto, datezeros
% christian prints BC/AD controlled by dateerauto, datezeros
dateera=secular,
dateeraauto=501, % Sets the max year ceiling for automatic printing of era
abbreviate=true, % prints full localisation strings
dateabbrev=false, % prints full date localisation strings
dateuncertain=true,
datecirca=true,%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Style
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
style=authoryear,
sorting=none,
dashed=false,
url=false,
%refsection=section,
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% style=authoryear option
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% mergedate= % false, minimum, basic, compact or true (default), maximum.
% See \doc\latex\biblatex\examples\50-style-authoryear-biber.pdf
% mergedate bug tests:
% alldates=ymd,
% labeldate=ymd
% false (), minimum (), basic (), compact (), true (), maximum ()
% alldates=ymd,
% labeldate=year,
% false (), minimum (), basic (), compact (), true (), maximum ()
mergedate=true
}{biblatex}
%\usepackage{hyperref}
\usepackage{origdatesupport}
\usepackage{biblatex}
\addbibresource{\jobname.bib}
% Seperation between time and timezone.
\DefineBibliographyExtras{english}{
\renewcommand*{\bibtimezonesep}{\space}
}
%% Origdate to date mapping and appending to addencum
%% "Modern publication date [datevalue]" is now in authoryear-jlb.
% addendum to "Modern publication date [datevalue]"
% for entries with date and origdate fields.
% e.g. addendum={
% [Optional existing text.] Modern publication date
% 2004-09-15
% }
% origdate: origdatevalue to date: origdatevalue
% e.g. origdate = {1751} to date = {1751}
\DeclareSourcemap{
\maps[datatype=bibtex]{
\map[overwrite]{
% Put a space at the end of addendum, if it exists.
\step[fieldsource=addendum, final]
\step[fieldset=addendum, fieldvalue={~}, append]
}
\map[overwrite]{
% Append some text to the addendum field:
% - With a leading space of there is text already in
%the addendum field (currently works); but
% - Without a leading space if the addendum field
% doesn't exist (currently doesn't work).
\step[fieldsource=origdate, final] % Only suffix "Modern publication date ..." where there is an origdate
\step[fieldset=addendum, fieldvalue={Modern publication date{ }}, append]
% The addendum field must exist with at least "Modern
% publication date ".
% Append the date.
\step[fieldsource=date]
\step[fieldset=addendum, origfieldval, append]
%%% origdate: origdatevalue to date: origdatevalue
%%% e.g. origdate = {1751} to date = {1751}
\step[fieldsource=origdate]
\step[fieldset=date, origfieldval]
}
}
\map[overwrite]{
% Set verba to date so
% the raw input date can be accessed with \citefield{}
\step[fieldsource=date]
\step[fieldset=verba, origfieldval]
}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Support
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\PassOptionsToPackage{svgnames,hyperref}{xcolor}
\usepackage{xcolor}
\definecolor{MetaColor}{HTML}{0040ff}
%\newenvironment{EntryPreface}{\color{MetaColor}}{}
%\AtEveryBibitem{
% \begin{EntryPreface}
% date=\printdate\ifdatejulian{\space(Julian)};
% origdate=\printorigdate\iforigdatejulian{(\space(Julian)};
% urldate=\printurldate\ifurldatejulian{(\space(Julian)}
% \par\vspace{0.25em}
% \end{EntryPreface}
%}
% Paragraph formatting
\setlength{\parindent}{0pt}
%\setlength{\parskip}{0.5em plus0.2em minus0.2em}
% Seperation betweem main entry and entry's addendum field.
%\DeclareFieldFormat{addendum}{\par\vspace{0.5em} \textcolor{MetaColor}{#1}}
\DeclareFieldFormat{addendum}{\textcolor{MetaColor}{#1}}
% Seperation between bibliographic entries
%\setlength{\bibitemsep}{0.5em}
% Space between table rows
\renewcommand{\arraystretch}{1.1}
% Page break before every section
\let\oldsection\section
\renewcommand\section{\clearpage\oldsection}
% Tilde output
\newcommand{\mytilde}{\raise.17ex\hbox{$\scriptstyle\mathtt{\sim}$}}
% Urls only, local paths, Urls with friendly names.
% Dependency:
% \usepackage{svgnames,hyperref}{xcolor}
% Named colors from xcolor svgnames
% Included:
% url
% Usage: \url{}, \path{}, \href{}
\usepackage[%
colorlinks=true,
breaklinks%
]{hyperref}
\hypersetup{
urlcolor=MidnightBlue, % External links
linkcolor=Purple, % Internal links
citecolor=black % SeaGreen
}
\hypersetup{
bookmarksnumbered,
bookmarksopen
}
% From the 'url' package (made available from the hyperref package, at least)
% values: "tt", "sf", "rm", "same"
\urlstyle{same}
\begin{document}
\section{Key}
Reference entries are sorted in citation order to make following the examples easier. Conventionally you'd sort by Author, date, title.
\textcolor{MetaColor}{Addendum in this color.}
\begin{refsection}
\section{Common}
\begin{tabular}{|l|l|l|}
\hline
\textbf{Description} & \textbf{Input} & \textbf{In text citation result}\\
\hline
\noalign{\bigskip}
\hline
\multicolumn{3}{|l|}{\textbf{Typical}}\\
\hline
Typical citation of a modern work & 1995 & \autocite{chalmers_1995_facing} \\
\hline
\noalign{\bigskip}
\hline
\multicolumn{3}{|l|}{\textbf{Approximate and uncertain}}\\
\hline
Approximate, circa (``ca.") & 1590\mytilde & \autocite{galilei_1590_motion} \\
\hline
Uncertain & 1256? & \autocite{aquinas_1256_two} \\
\hline
Approximate and Uncertain & 1273?\mytilde & \autocite{aquinas_1273_compendium} \\
\hline
\noalign{\bigskip}
\hline
\multicolumn{3}{|l|}{\textbf{Eras}}\\
\hline
Before the year zero (``BCE") & -0379\mytilde & \autocite{plato_2004_republic} \\
\hline
Not long after the year zero (``CE") & 0125\mytilde & \autocite{epictetus_1916_enchiridion} \\
\hline
\noalign{\bigskip}
\end{tabular}
\printbibliography[heading=subbibliography]
\end{refsection}
\begin{refsection}
\section{Year exceeding four digits}
\subsection{Format}
\begin{quotation}
'y' may be used at the beginning of the date string to signify that the date is a year, when (and only when) the year exceeds four digits, i.e. for years later than 9999 or earlier than -9999. (\href{http://www.loc.gov/standards/datetime/pre-submission.html#extendedintervall1}{5.2.3, EDTF Extended Interval (L1)})
\end{quotation}
However, when a year more than four digits is permitted then only the year part is permitted, not other date components (month, day, etc) (From \href{http://www.loc.gov/standards/datetime/pre-submission.html#bnf}{Section 8, EDTF BNF} ...):
\begin{verbatim}
(* ************************** Level 1 *************************** *)
level1Expression = uncertainOrApproxDate
| unspecified
| L1Interval
| longYearSimple
| season ...
(* *** Long Year - Simple Form *** *)
longYearSimple = "y" "-"? positiveDigit digit digit digit digit+
\end{verbatim}
For example, ...
\begin{verbatim}
% Legal
y170000002
y-170000002
% Illegal
y170000002-03-22
y-170000002-03-22
\end{verbatim}
\subsection{Examples}
\begin{tabular}{|l|l|l|l|}
\hline
\textbf{Description} & \textbf{Input} & \textbf{Expected Output} & \textbf{Actual Result}\\
\hline
A long time ago & y-51234 & (Rebels 51235 BCE) & \autocite{rebels_y-51234_rebel} \\
\hline
Far into the future & y52000 & (Seldon 52000) & \autocite{seldon_y52000_encyclopedia} \\
\hline
\noalign{\bigskip}
\end{tabular}
\printbibliography[heading=subbibliography]
\end{refsection}
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment