Variable: org-cite-csl-latex-preamble

org-cite-csl-latex-preamble is a customizable variable defined in oc-csl.el.gz.

Value

"\\usepackage{calc}\n\\newlength{\\cslhangindent}\n\\setlength{\\cslhangindent}{[CSL-HANGINDENT]}\n\\newlength{\\csllabelsep}\n\\setlength{\\csllabelsep}{[CSL-LABELSEP]}\n\\newlength{\\csllabelwidth}\n\\setlength{\\csllabelwidth}{[CSL-LABELWIDTH-PER-CHAR] * [CSL-MAXLABEL-CHARS]}\n\\newenvironment{cslbibliography}[2] % 1st arg. is hanging-indent, 2nd entry spacing.\n {% By default, paragraphs are not indented.\n  \\setlength{\\parindent}{0pt}\n  % Hanging indent is turned on when first argument is 1.\n  \\ifodd #1\n  \\let\\oldpar\\par\n  \\def\\par{\\hangindent=\\cslhangindent\\oldpar}\n  \\fi\n  % Set entry spacing based on the second argument.\n  \\setlength{\\parskip}{\\parskip +  #2\\baselineskip}\n }%\n {}\n\\newcommand{\\cslblock}[1]{#1\\hfill\\break}\n\\newcommand{\\cslleftmargin}[1]{\\parbox[t]{\\csllabelsep + \\csllabelwidth}{#1}}\n\\newcommand{\\cslrightinline}[1]\n  {\\parbox[t]{\\linewidth - \\csllabelsep - \\csllabelwidth}{#1}\\break}\n\\newcommand{\\cslindent}[1]{\\hspace{\\cslhangindent}#1}\n\\newcommand{\\cslbibitem}[2]\n  {\\leavevmode\\vadjust pre{\\hypertarget{citeproc_bib_item_#1}{}}#2}\n\\makeatletter\n\\newcommand{\\cslcitation}[2]\n {\\protect\\hyper@linkstart{cite}{citeproc_bib_item_#1}#2\\hyper@linkend}\n\\makeatother"

Documentation

LaTeX preamble content inserted by the csl citation processor.

This preamble can be anything as long as it provides definitions for the environment and commands that Citeproc's org-latex formatter uses for formatting citations and bibliographies. In particular, it has to define
- the commands \cslblock{<text>}, \cslleftmargin{<text>},
  \cslrightinline{<text>} and \cslindent{<text>} for formatting
  text that have, respectively, the CSL display attributes
  block, left-margin, right-inline and indent;
- the commands \cslcitation{<item_no>}{<item_text>} and
  \cslbibitem{<item_no>}{<item_text>}, which are used to
  format individual citations and bibliography items, including
  hyperlinking citations to the corresponding bibliography entry
  using their numerical id, which is passed as the first,
  <item_no> argument;
- and the environment \cslbibliography{<hanging-indent>}{<entry-spacing>},
  in which bibliographies are wrapped; the value of the
  <hanging-indent> argument is 1 if hanging indent should be
  applied and 0 if not, while the <entry-spacing> argument is an
  integer specifying the number of extra line-heights
  required between bibliography entries in addition to normal
  line spacing.

When present, the placeholders [CSL-HANGINDENT], [CSL-LABELSEP],
[CSL-LABELWIDTH-PER-CHAR] and [CSL-MAXLABEL-CHARS] are replaced,
respectively, by the contents of the customizable variables org-cite-csl-latex-hanging-indent, org-cite-csl-latex-label-separator, org-cite-csl-latex-label-width-per-char, and the maximal label length in the bibliography measured in characters.

This variable was added, or its default value changed, in Org version
9.7.

Source Code

;; Defined in /usr/src/emacs/lisp/org/oc-csl.el.gz
;; The following was inspired by and in many details follows how
;; Pandoc's (<https://github.com/jgm/pandoc>) default LaTeX template
;; handles CSL output.  Many thanks to the author, John MacFarlane!
(defcustom org-cite-csl-latex-preamble
  "\\usepackage{calc}
\\newlength{\\cslhangindent}
\\setlength{\\cslhangindent}{[CSL-HANGINDENT]}
\\newlength{\\csllabelsep}
\\setlength{\\csllabelsep}{[CSL-LABELSEP]}
\\newlength{\\csllabelwidth}
\\setlength{\\csllabelwidth}{[CSL-LABELWIDTH-PER-CHAR] * [CSL-MAXLABEL-CHARS]}
\\newenvironment{cslbibliography}[2] % 1st arg. is hanging-indent, 2nd entry spacing.
 {% By default, paragraphs are not indented.
  \\setlength{\\parindent}{0pt}
  % Hanging indent is turned on when first argument is 1.
  \\ifodd #1
  \\let\\oldpar\\par
  \\def\\par{\\hangindent=\\cslhangindent\\oldpar}
  \\fi
  % Set entry spacing based on the second argument.
  \\setlength{\\parskip}{\\parskip +  #2\\baselineskip}
 }%
 {}
\\newcommand{\\cslblock}[1]{#1\\hfill\\break}
\\newcommand{\\cslleftmargin}[1]{\\parbox[t]{\\csllabelsep + \\csllabelwidth}{#1}}
\\newcommand{\\cslrightinline}[1]
  {\\parbox[t]{\\linewidth - \\csllabelsep - \\csllabelwidth}{#1}\\break}
\\newcommand{\\cslindent}[1]{\\hspace{\\cslhangindent}#1}
\\newcommand{\\cslbibitem}[2]
  {\\leavevmode\\vadjust pre{\\hypertarget{citeproc_bib_item_#1}{}}#2}
\\makeatletter
\\newcommand{\\cslcitation}[2]
 {\\protect\\hyper@linkstart{cite}{citeproc_bib_item_#1}#2\\hyper@linkend}
\\makeatother"
  "LaTeX preamble content inserted by the `csl' citation processor.

This preamble can be anything as long as it provides definitions
for the environment and commands that Citeproc's `org-latex'
formatter uses for formatting citations and bibliographies.  In
particular, it has to define
- the commands \\cslblock{<text>}, \\cslleftmargin{<text>},
  \\cslrightinline{<text>} and \\cslindent{<text>} for formatting
  text that have, respectively, the CSL display attributes
  `block', `left-margin', `right-inline' and `indent';
- the commands \\cslcitation{<item_no>}{<item_text>} and
  \\cslbibitem{<item_no>}{<item_text>}, which are used to
  format individual citations and bibliography items, including
  hyperlinking citations to the corresponding bibliography entry
  using their numerical id, which is passed as the first,
  <item_no> argument;
- and the environment \\cslbibliography{<hanging-indent>}{<entry-spacing>},
  in which bibliographies are wrapped; the value of the
  <hanging-indent> argument is 1 if hanging indent should be
  applied and 0 if not, while the <entry-spacing> argument is an
  integer specifying the number of extra line-heights
  required between bibliography entries in addition to normal
  line spacing.

When present, the placeholders [CSL-HANGINDENT], [CSL-LABELSEP],
[CSL-LABELWIDTH-PER-CHAR] and [CSL-MAXLABEL-CHARS] are replaced,
respectively, by the contents of the customizable variables
`org-cite-csl-latex-hanging-indent', `org-cite-csl-latex-label-separator',
`org-cite-csl-latex-label-width-per-char', and the maximal label length
in the bibliography measured in characters."
  :group 'org-cite
  :type 'string
  :package-version '(Org . "9.7"))