Giter VIP home page Giter VIP logo

latex-credits's Introduction

latex-credits: A LaTeX package for generating CRediT (Contributor Role Taxonomy) statements

This is a simple LaTeX package for generating contributor role statements that can be easily included in a paper. The text of the roles follows CRediT.

Installation and Usage

Download credits.sty from this repository (or clone the whole repository) and put it in your project. You may load the package using \usepackage{credits}.

Defining Authors

Use the \credit command to define an author and their contributions to the paper. The \credit command takes two parameters, the first one being the name of the author, the second one being a comma-separated list of 14 values, corresponding to the individual roles a contributor might have. These roles follow the CRediT scheme and are as follows:

  1. Conceptualization
  2. Data curation
  3. Formal analysis
  4. Funding acquisition
  5. Investigation
  6. Methodology
  7. Project administration
  8. Resources
  9. Software
  10. Supervision
  11. Validation
  12. Visualization
  13. Writing -- original draft
  14. Writing -- review & editing

To define an author that contributed only to the writing and the conceptualisation, you could use the following command:

\credit{Alice}{1,0,0,0,0,0,0,0,0,0,0,0,1,1}

Suppose you have a second author that did everything but the writing and conceptualisation. You would add such an author using this command:

\credit{Eve}{0,1,1,1,1,1,1,1,1,1,1,1,0,0}

To add a statement about these contributions to the text, use the \insertcredits command. The visualisation will be embedded in a tikzpicture environment so it can be added in-place; it does not make use of any floats. This is how the statement will look by default:

Example contributor roles with default colours

There is also the option to generate a text statement about contributors. Just use the \insertcreditsstatement command. Here is how such a statement will be formatted (notice that author names have been slightly changed):

Example contributor text statement

Example

The package is readily usable and permits some customisation (this example can also be found in example.tex):

\documentclass{standalone}

\usepackage{xcolor}

\definecolor{cardinal} {RGB}{196, 30, 58}
\definecolor{lightgrey}{RGB}{150,150,150}

% You can configure the colour of the grid and the respective roles of
% individual authors.
\usepackage[role = cardinal, grid = lightgrey]{credits}

% The ordering of the values indicates the ordering of the original
% taxonomy, i.e.:
%
% - Conceptualization
% - Data curation
% - Formal analysis
% - Funding acquisition
% - Investigation
% - Methodology
% - Project administration
% - Resources
% - Software
% - Supervision
% - Validation
% - Visualization
% - Writing -- original draft
% - Writing -- review \& editing
\credit{Alice}  {1,1,1,1,1,1,1,1,1,1,1,1,1,1}
\credit{Bob}    {0,1,0,1,0,1,0,1,0,1,0,1,0,1}

% Values between 0 and 1 will be scaled to be mixed with the background
% colour (white, unless changed by TikZ). This enables giving *partial*
% credit to authors (for instance, if someone helped out initially with
% data curation, but then later went on to another project).
\credit{Charlie}{0,0.5,1,0,0,0,0,0,1,0,0,1,0,0}

\begin{document}
  \insertcredits
\end{document}

This results in the following output:

Example contributor taxonomy with custom colours

By passing the horizontal key when loading the package, you can switch the ordering of rows and columns, essentially transposing the statement.

\usepackage[horizontal]{credits}

Moreover, if some of the roles are empty (i.e., no contributor) and you want to hide them, pass the skipempty key:

\usepackage[skipempty]{credits}

If you are only interested in the textual statement, you can use the separator package option to slightly adjust its formatting.

% Default: separate individual concepts/roles by a semicolon. This seems
% to be the de facto standard endorsed by many publishers.
\usepackage[separator = {;}]{credits}

% This would create a list of contributions. Personally, I do not like
% this format too much.
\usepackage[separator = {\newline}]{credits}

Use \insertcreditsstatement to place your textual statement anywhere. Similar to the visual statement, this environment does not create a new group or float; it can be readily added to any text environment. You can find the full example in example_text.tex.

FAQ

To be more precise, this is a list of anticipated questions. No one actually asked any of these questions.

  1. How can I contribute to this project?

    Simple: open an issue or clone the repository and send me a pull request. All contributions are welcome!

  2. The LaTeX code is horrible!

    Technically, this is not a question. Also: yes, agreed. Consider improving it by opening a pull request.

  3. Can you support a certain style or certain feature?

    Maybe! Open an issue and let me know what you are interested in.

Package Users

License

The package is licensed using a BSD 3-Clause license. See the license file for more information.

latex-credits's People

Contributors

jannisborn avatar pseudomanifold avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

latex-credits's Issues

Pass inputs in readable format

Could be a game changer in usability to support passing data per concept and in a human-readable form, e.g.,:

\credit{Conceptualization}{Alice, Bob}
\credit{Data curation}{Charlie}
...

Skip empty roles

Firstly -- this is super cool, thanks!

I have one request (or question), is it possible for \insertcredits / \insertcreditsstatement to automatically skip a role if no authors are assigned to it?

Commas not added even though needed

With the current credits.sty, when there are many authors it happens that the author-separating commas are forgotten in some cases:

MWE:

\documentclass{article}
\usepackage{credits}


\begin{document}


\credit{NW}{1,1,1,0,0,1,0,0,1,1,1,1,1,1}
\credit{DK}{1,0,0,0,1,1,1,0,0,1,0,0,0,1}
\credit{MR}{0,0,1,0,0,1,0,0,1,0,1,1,0,1}
\credit{SW}{0,0,0,0,1,0,1,1,0,0,0,0,0,1}
\credit{CB}{0,1,1,0,1,0,0,0,0,0,0,0,0,1}
 \credit{FE}{0,1,1,0,1,0,0,0,0,0,0,0,0,0}
 \credit{SA}{0,1,0,0,1,0,0,0,0,0,0,0,0,0}
\credit{LG}{0,0,0,0,1,0,1,0,0,0,0,0,0,1}
 \credit{SR}{0,1,1,0,0,1,0,0,1,0,0,0,0,0}
 \credit{CR}{0,1,0,0,0,0,0,0,0,0,0,0,0,0}
\credit{EK}{0,0,0,0,0,0,0,1,0,0,0,0,0,0}
\credit{WB}{0,0,0,1,0,0,0,1,0,1,0,0,0,1}
\credit{RH}{0,0,0,0,1,0,1,1,0,0,0,0,0,1}
\credit{JB}{1,0,0,0,0,1,0,0,1,1,1,0,1,1}
\insertcreditsstatement
\insertcredits 
\end{document}

The result is:

Conceptualization: NW, DK, JB; Data curation: NW, CB, FESAS-
RCR; Formal analysis: NW, MR, CBFESR; Funding acquisition: WB;
Investigation: DK, SW, CB, FE, SALGRH; Methodology: NW, DK, MR,
SRJB; Project administration: DK, SWLGRH; Resources: SWEKWBRH;
Software: NW, MR, SRJB; Supervision: NW, DK, WBJB; Validation:
NW, MRJB; Visualization: NW, MR; Writing – original draft: NW, JB;
Writing – review & editing: NW, DK, MR, SW, CB, LG, WBRHJB

Clearly, the desired result would be:

Conceptualization: NW, DK, JB; Data curation: NW, CB, FE, SA,
SR, CR; Formal analysis: NW, MR, CB, FE, SR; Funding acquisition:
WB; Investigation: DK, SW, CB, FE, SA, LG, RH; Methodology: NW,
DK, MR, SR, JB; Project administration: DK, SW, LG, RH; Resources:
SW, EK, WB, RH; Software: NW, MR, SR, JB; Supervision: NW, DK,
WB, JB; Validation: NW, MR, JB; Visualization: NW, MR; Writing –
original draft: NW, JB; Writing – review & editing: NW, DK, MR, SW,
CB, LG, WB, RH, JB

I dont understand latex well enough to really pinpoint why this happens in some but not all cases, but I created fix that enabled me to produce the second result :)
It also works for the simpler cases from the README. Will open a PR, latest tomorrow!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.