Mentions légales du service

Skip to content
Snippets Groups Projects
Commit ffc03636 authored by Roberto Di Cosmo's avatar Roberto Di Cosmo
Browse files

Improve ASCL example

parent 9e5e57c6
No related branches found
No related tags found
No related merge requests found
\begin{release}{bltx-v1.2}{2020-05-29} \item Bump version to 1.2 with clean support of multiline SWHIDs \end{release}
\begin{release}{bltx-v1.1}{2020-04-29} \item Add support for the institution, organization, eprint, eprinttype and eprintclass fields Force urls output when they are the only reference available Updates to the documentation \end{release}
\begin{release}{bltx-v1.0}{2020-04-25} \item First public release \end{release}
\begin{release}{bltx-v0.9}{2020-04-25} \item Preparing for public release: Licence, Readme, update documentation, handle suggestions from the Working Group \end{release}
......
No preview for this file type
No preview for this file type
......@@ -203,29 +203,32 @@ platform where the software described in the enttry is developed. The default is
It would not be reasonable to have a dedicated field for each of the many software releated identifiers that exist.
If you want to create bibliographic records that use identifiers not natively supported by this package, you
can use the standard Bib\LaTeX\ mechanism that uses the ~eprint~, ~eprinttype~ and ~eprintclass~ fields.\\
can use the standard Bib\LaTeX\ mechanism that uses the |eprint|, |eprinttype| and |eprintclass| fields.\\
The default formatting of these fields may be what you want, but if it's not the case, you can define
your own format, as explained in the official Bib\LaTeX\ documentation.\\
As an example, this style already contains a specific formatting definition for the Astrophysics Source Code Library (ASCL) software records,
via the following declaration in the ~software.bbx~ file:
via the following declaration in the \verb|software.bbx| file:
\begin{verbatim}
\DeclareFieldFormat{eprint:ascl}{%
ascl\addcolon\space
\mkbibacro{ASCL}\addcolon\addspace%
\ifhyperref
{\href{https://ascl.net/#1}{%
\nolinkurl{#1}%
\(\langle\)ascl\addcolon\nolinkurl{#1}\(\rangle\)%
\iffieldundef{eprintclass}
{}
{\addspace\texttt{\mkbibbrackets{\thefield{eprintclass}}}}}}
{\nolinkurl{#1}%
{\(\langle\)ascl\addcolon\nolinkurl{#1}\(\rangle\)%
\iffieldundef{eprintclass}
{}
{\addspace\texttt{\mkbibbrackets{\thefield{eprintclass}}}}}}
{\addspace\texttt{\mkbibbrackets{\thefield{eprintclass}}}}}
}
\end{verbatim}
If you want to adapt this very example to an identifier |foo| with resolver prefix |https://myfoo.org/|, just replace in the \LaTeX{} code above |https://ascl.net/| with |https://myfoo.org/|, |ascl| with |foo| and |ASCL| with |FOO|.
\section{Details}
The detailed information for this style is contained in the example document and
......
......@@ -114,17 +114,18 @@
% Add here special eprint formats
%
\DeclareFieldFormat{eprint:ascl}{%
ascl\addcolon\space
\mkbibacro{ASCL}\addcolon\addspace%
\ifhyperref
{\href{https://ascl.net/#1}{%
\nolinkurl{#1}%
\(\langle\)ascl\addcolon\nolinkurl{#1}\(\rangle\)%
\iffieldundef{eprintclass}
{}
{\addspace\texttt{\mkbibbrackets{\thefield{eprintclass}}}}}}
{\nolinkurl{#1}%
{\(\langle\)ascl\addcolon\nolinkurl{#1}\(\rangle\)%
\iffieldundef{eprintclass}
{}
{\addspace\texttt{\mkbibbrackets{\thefield{eprintclass}}}}}}
{\addspace\texttt{\mkbibbrackets{\thefield{eprintclass}}}}}
}
%
% Macros to format output
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment