Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
zepinglee committed Jul 27, 2024
1 parent ce380f9 commit b09b2b4
Showing 1 changed file with 70 additions and 8 deletions.
78 changes: 70 additions & 8 deletions docs/citation-style-language-doc.tex
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,14 @@
\NewDocumentCommand\field{m}{\texttt{#1}}
\NewDocumentCommand\entrytype{m}{\texttt{#1}}

\lstdefinestyle{plain}{
basicstyle = \ttfamily\small,
basewidth = 0.51em,
}

\lstnewenvironment{LaTeXdemo}{
\lstset{
basicstyle = \ttfamily\small,
basewidth = 0.51em,
style = plain,
frame = single,
gobble = 2,
language = [LaTeX]TeX,
Expand All @@ -26,8 +30,7 @@

\lstnewenvironment{bash}{
\lstset{
basicstyle = \ttfamily\small,
basewidth = 0.51em,
style = plain,
% gobble = 2,
language = bash,
}
Expand Down Expand Up @@ -152,7 +155,6 @@ \section{Getting started}
\end{enumerate}



\section{Package setup}

\begin{function}{\cslsetup}
Expand Down Expand Up @@ -262,6 +264,8 @@ \section{Package setup}
By default, it is the \cs{parindent} at when printed out.


\section{Bibliographic resources}

\begin{function}{\addbibresource}
\begin{syntax}
\cs{addbibresource}\marg{resource}
Expand All @@ -279,6 +283,49 @@ \section{Package setup}
\addbibresource{file2.yaml, file3.bib}
\end{LaTeXdemo}

CSL-JSON is the bibliographic metadata format for CSL styles.
Below is an example entry in this format. Each entry must have these two
fields: \texttt{id} and \texttt{type} and the former is the entry keys that
appears in the \cs{cite} command. The accepted entry types and fields are
listed in Appendix \ref{sec:entry-types} and Appendix \ref{sec:entry-fields},
respectively. In most cases, one does not manually write CSL-JSON but exports
from a reference manager like Zotero or Mendeley.

\begin{lstlisting}[style=plain,gobble=2,frame=single]
{
"id": "ITEM-1",
"type": "book",
"author": [
{
"family": "D'Arcus",
"given": "Bruce"
}
],
"issued": {
"date-parts": [
[ 2005, 11, 22 ]
]
},
"publisher": "Routledge",
"title": "Boundaries of dissent: Protest and state power in the media age"
}
\end{lstlisting}

The traditional Bib(La)TeX format is also supported. It's internally converted
to CSL-JSON format. However there are some differences.

In a Bib(La)TeX database, the titles (includding \texttt{booktitle}s) should
be written in title case with propper words enclosed with braces (e.g.,
\texttt{The \{Feynman\} Lectures on Physics}”). However CSL requires the
titles stored in sentence case (“\texttt{The Feynman lectures on physics}”).
By default the BibTeX-to-CSL translation does this case conversion.
It checks the original case and skips the titles that are already in sentence
case. For example, the lowercase word “lectures” in “The Feynman lectures on
physics” indicates the whole title is in sentence case and citeproc-lua does
not convert it. This behavior can be turned off by specifying
\opt{check-sentence-case = false} in the optional argument of
\cs{addbibresource}.


\section{Citation commands}

Expand Down Expand Up @@ -589,7 +636,7 @@ \subsection{Bibliography Sections}
to the global section.


\subsection{Bibliography Headings}
\subsection{Bibliography headings}

\begin{function}{\defbibheading}
\begin{syntax}
Expand All @@ -612,7 +659,6 @@ \subsection{Bibliography Headings}
}
\end{LaTeXdemo}


The following are predefined headings which can be used directly.

\begin{description}
Expand All @@ -631,8 +677,24 @@ \subsection{Bibliography Headings}
\end{description}


\subsection{Bibliography categories}

\begin{function}{\DeclareBibliographyCategory}
\begin{syntax}
\cs{DeclareBibliographyCategory}\marg{category}
\end{syntax}
\end{function}

This command declares a new \meta{category} for use with the \opt{category} and
\opt{notcategory} options in \cs{printbibliography}.

\begin{function}{\addtocategory}
\begin{syntax}
\cs{addtocategory}\marg{category}\marg{entrykey, \dots}
\end{syntax}
\end{function}

% \markdownInput{bib-csl-mapping.md}
This command assigns the \meta{entrykey}s to \meta{category}.


\section{Compatibility with other packages}
Expand Down

0 comments on commit b09b2b4

Please sign in to comment.