Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ authors:
orcid: "https://orcid.org/0000-0002-8282-3910"
affiliation: "LMU Munich"
email: felix.schoenbrodt@psy.lmu.de
- given-names: Pat
family-names: Callahan
orcid: "https://orcid.org/0000-0003-1769-7580"
affiliation: "LMU Munich"

title: "Code Publishing Tutorial"
version: 0.1.0
Expand All @@ -36,12 +40,20 @@ preferred-citation:
- given-names: Christoph
family-names: Scheffel
orcid: "https://orcid.org/0000-0001-5963-9229"
- given-names: Felix
family-names: Schönbrodt
orcid: "https://orcid.org/0000-0002-8282-3910"
affiliation: "LMU Munich"
email: felix.schoenbrodt@psy.lmu.de
- given-names: Pat
family-names: Callahan
orcid: "https://orcid.org/0000-0003-1769-7580"
affiliation: "LMU Munich"
title: "Code Publishing Tutorial"
year: 2025
doi: "10.5281/zenodo.16631977"
publisher:
name: "LMU Open Science Center"
ror: "https://ror.org/029e6qe04"
repository-code: "https://github.com/lmu-osc/code-publishing"
url: "https://lmu-osc.github.io/code-publishing/"
type: "book"
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ please read the [contributing notes](CONTRIBUTING.md) before.

## License

Except where noted otherwise, the narrative text in this tutorial is licensed under [CC BY-SA 4.0][cc-by-sa];
the code without any narrative text is also (at your option) available under [CC0 1.0][cc0].
Except where noted otherwise, the narrative text in this tutorial is licensed under [CC\ BY-SA\ 4.0][cc-by-sa];
the code without any narrative text is also (at your option) available under [CC0\ 1.0][cc0].

[cc-by-sa]: LICENSE-CC-BY-SA.txt
[cc0]: LICENSE-CC0.txt
22 changes: 8 additions & 14 deletions _quarto.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
# Begin Project
project:
type: website
pre-render: wget -nc https://raw.githubusercontent.com/lmu-osc/branding-resources/refs/heads/main/lmu-osc-custom.scss
post-render: rm lmu-osc-custom.scss
# End Project



# Begin Website
website:
title: "Code Publishing Tutorial (Short version)"
page-footer:
center: |
A recommended citation and license information for this tutorial
are provided on the [about page](about.qmd).
are provided on the [about page](/about.qmd).
border: false
search:
location: sidebar
Expand All @@ -25,7 +21,6 @@ website:
margin-header: |
![](/images/LMU-OSC_logo.jpg){width="175"}


navbar:
right:
- about.qmd
Expand All @@ -36,9 +31,9 @@ website:
- icon: github
menu:
- text: Source Code
url: https://github.com/lmu-osc/code-publishing
url: https://github.com/lmu-osc/code-publishing
- text: Report a Bug
url: https://github.com/lmu-osc/code-publishing/issues
url: https://github.com/lmu-osc/code-publishing/issues
- icon: house-heart
url: https://www.osc.uni-muenchen.de/

Expand All @@ -53,22 +48,22 @@ website:
- choose-license.qmd
- make-readme.qmd
- archive.qmd
- section: "💡 In-depth material"
- section: "Excursus: In-depth material 💡"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd favor no emojis

contents:
- href: in_depth_material/introduction_copyright.qmd
text: "Introduction to Copyright and Licensing"
- href: in_depth_material/data_dic_generation.qmd
text: "Automatic Generation of Data Dictionaries"
- href: in_depth_material/other_dependencies.qmd
text: "Identify additional system dependencies for the README"
# End Website


# Begin Format
format:
html:
theme:
- cosmo
- lmu-osc-custom.scss
css:
css:
- https://raw.githubusercontent.com/lmu-osc/branding-resources/refs/heads/main/lmu-osc-styles.css
toc: true
fontsize: 13pt
Expand All @@ -80,7 +75,6 @@ format:
- file: matomo_analytics.html
# End Format


csl: apa.csl
bibliography: literature.bib
lang: en-US
lang: en-US
4 changes: 2 additions & 2 deletions choose-license.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -562,9 +562,9 @@ while the bibliography is made available under CC0\ 1.0.
[agpl]: https://www.gnu.org/licenses/agpl-3.0.html

```{.txt .code-overflow-wrap filename="LICENSE.txt"}
The Quarto documents stored in "Manuscript.qmd", "Manuscript.tex", and "Manuscript.pdf" by Josephine Zerna, Christoph Scheffel, and <YOUR NAME> are available under AGPLv3 (or later) <https://www.gnu.org/licenses/agpl-3.0.html> or (at your option) under CC BY-SA 4.0 <https://creativecommons.org/licenses/by-sa/4.0/>.
The Quarto documents stored in "Manuscript.qmd", "Manuscript.tex", and "Manuscript.pdf" by Josephine Zerna, Christoph Scheffel, and <YOUR NAME> are available under AGPLv3 (or later) <https://www.gnu.org/licenses/agpl-3.0.html> or (at your option) under CC\ BY-SA\ 4.0 <https://creativecommons.org/licenses/by-sa/4.0/>.

The bibliography (stored in "Bibliography.bib") by Florian Kohrt and <YOUR NAME> is available under CC0 1.0 <https://creativecommons.org/publicdomain/zero/1.0/>.
The bibliography (stored in "Bibliography.bib") by Florian Kohrt and <YOUR NAME> is available under CC0\ 1.0 <https://creativecommons.org/publicdomain/zero/1.0/>.
```

As the AGPLv3 requires reusers adding the [full license text](https://www.gnu.org/licenses/agpl-3.0.txt),
Expand Down
2 changes: 1 addition & 1 deletion code.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ We recommend adding a short paragraph to `LICENSE.txt` to describe its license.
It is best to provide attribution even if the license does not require it.

```{.txt .code-overflow-wrap filename="LICENSE.txt"}
"apaquarto" stored in "_extensions/wjschne/apaquarto" by W. Joel Schneider available from <https://github.com/wjschne/apaquarto> is licensed under CC0 1.0: <https://creativecommons.org/publicdomain/zero/1.0/>
"apaquarto" stored in "_extensions/wjschne/apaquarto" by W. Joel Schneider available from <https://github.com/wjschne/apaquarto> is licensed under CC0\ 1.0: <https://creativecommons.org/publicdomain/zero/1.0/>
```

Again, if the license required adding the full license text,
Expand Down
10 changes: 5 additions & 5 deletions copyright.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ Also, their commercial use may require the consent of the depicted person.

[commons-photographs]: https://commons.wikimedia.org/wiki/Commons:Photographs_of_identifiable_people

## ✍️ Practical Exercise: Adding an Image
## Practical Exercise: Adding an Image

Let's practice what you learned by adding an image to the manuscript.
We'll use [this picture of a penguin from Flickr](https://flic.kr/p/2pEKnUr).
Expand Down Expand Up @@ -566,20 +566,20 @@ we still recommend providing proper attribution.
- Copyright notice: (not available)
- Title of the work: `Chinstrap Penguin`
- Link to the work: <https://www.flickr.com/photos/192320315@N02/53603388557/> or <https://flic.kr/p/2pEKnUr>
- License name: `CC0 1.0`
- License name: `CC0\ 1.0`
- Link to the license: <https://creativecommons.org/publicdomain/zero/1.0/>
- Link to warranty disclaimer: (not available)
- Indicate modification: (no existing modification notices)

```{.md .code-overflow-wrap}
!["[Chinstrap Penguin](https://flic.kr/p/2pEKnUr)" by "steve b" licensed under [CC0 1.0](https://creativecommons.org/publicdomain/zero/1.0/)](penguin.jpg){width=50%}
!["[Chinstrap Penguin](https://flic.kr/p/2pEKnUr)" by "steve b" licensed under [CC0\ 1.0](https://creativecommons.org/publicdomain/zero/1.0/)](penguin.jpg){width=50%}
```

If it is likely that the article gets printed,
you might want to ensure that the link to the work is retained in that case:

```{.md .code-overflow-wrap}
!["[Chinstrap Penguin](https://flic.kr/p/2pEKnUr)" by "steve b" available under [CC0 1.0](https://creativecommons.org/publicdomain/zero/1.0/) from [`flic.kr/p/2pEKnUr`](https://flic.kr/p/2pEKnUr)](penguin.jpg){width=50%}
!["[Chinstrap Penguin](https://flic.kr/p/2pEKnUr)" by "steve b" available under [CC0\ 1.0](https://creativecommons.org/publicdomain/zero/1.0/) from [`flic.kr/p/2pEKnUr`](https://flic.kr/p/2pEKnUr)](penguin.jpg){width=50%}
```
:::

Expand All @@ -597,7 +597,7 @@ then on _File_ > _Save_, and choose `LICENSE.txt` as filename.
The license description can be worded as follows:

```{.txt .code-overflow-wrap filename="LICENSE.txt"}
"Chinstrap Penguin" stored in "penguin.jpg" by "steve b" available from <https://flic.kr/p/2pEKnUr> is licensed under CC0 1.0: <https://creativecommons.org/publicdomain/zero/1.0/>
"Chinstrap Penguin" stored in "penguin.jpg" by "steve b" available from <https://flic.kr/p/2pEKnUr> is licensed under CC0\ 1.0: <https://creativecommons.org/publicdomain/zero/1.0/>
```

If the license required adding the full license text,
Expand Down
4 changes: 2 additions & 2 deletions data.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ Here's an example from a different data set, with variables in rows, and the dic
| life_satisfaction | Life Satisfaction | integer | "How satisfied are you with your life?" | 1 = Very dissatisfied; 2 = Dissatisfied; 3 = Neutral; 4 = Satisfied; 5 = Very satisfied | scale (1–5) | -99 = Not answered |


### ✍️ Practical Exercise: Add your own data dictionary
### Practical Exercise: Add your own data dictionary

Now go ahead and create a data dictionary for the penguins data set,
in a software (text or spreadsheet) of your choice.
Expand All @@ -139,7 +139,7 @@ Save the data dictionary in the same folder as the actual data set file.

:::

## ✍️ Practical Exercise: Add Data Citation and Attribution
## Practical Exercise: Add Data Citation and Attribution

All data relied upon should be cited in the manuscript
to allow for precise identification and access.
Expand Down
6 changes: 3 additions & 3 deletions in_depth_material/introduction_copyright.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ format:
</style>
---

**Note: This is an expanded version of the Chapter "[Sharing work of others: Copyright](/copyright.qmd)". Here you find more details on the choice of licenses.**
*Note: This is an expanded version of the Chapter "[Sharing work of others: Copyright](/copyright.qmd)". Here you find more details on the choice of licenses.*

By default, everything you put into the project folder will be shared publicly.
In many instances, this will also include works by others than yourself or your co-authors,
Expand Down Expand Up @@ -178,15 +178,15 @@ for which the open editing phase began in 2006.
They are largely viewed as compatible with one another.

:::: {.column-margin}
![](images/Definition_of_Free_Cultural_Works.svg){width=250px}
![](/images/Definition_of_Free_Cultural_Works.svg){width=250px}
::::
:::

### Can I Share That Work?

To determine whether a particular work can be included in the project folder
and shared publicly, the first step is to search for its license.
For example, this tutorial has an [about page](../about.qmd) detailing its licensing,
For example, this tutorial has an [about page](/about.qmd) detailing its licensing,
whereas other websites sometimes state the license in the footer.
Other places to look include a project's `README` file or a dedicated `LICENSE` or `COPYING` file.
If a project has been stored in a research repository,
Expand Down
96 changes: 96 additions & 0 deletions in_depth_material/other_dependencies.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
---
title: "Identify additional system dependencies for the README"
engine: knitr
---

The specific version of R and the loaded packages is the most crucial information that should go into the README (or that is stored in the `renv` lockfile). Ideally, you list other system dependencies, such as the version of Quarto[^renv-quarto] that you used to render your paper.

[^renv-quarto]: As of August 2024, a proposal for `renv` to record the version of Quarto
has not been implemented, see [rstudio/renv#1143](https://github.com/rstudio/renv/issues/1143).

An overview over the system dependencies of R packages can be created
using the function `pak::pkg_sysreqs()`.
In combination with `renv`, we can obtain the system dependencies
of all R packages the current project directly depends on:

```{.r filename="Console"}
# Find all R package dependencies
deps <- renv::dependencies()$Package |>
unique() |>
pak::pkg_deps(dependencies = NA) |>
getElement("package")

# Identify their system dependencies
pak::pkg_sysreqs(deps)
```

The output may look like the following:

```txt
── Install scripts ────────────────── Fedora 40 ──
dnf install -y make pandoc git

── Packages and their system dependencies ────────
fs – make
knitr – pandoc
remotes – git
rmarkdown – pandoc
sass – make
```

We can see that the programs `make`, `pandoc`,
and `git` were identified as system dependencies.
Often, one can obtain their version by running them with the `--version` argument:

```{.bash filename="Terminal"}
make --version
pandoc --version
git --version
```

However, this does not work for all system dependencies.
Specifically, it does not work for libraries -- software that is not supposed to be run on its own.
Identifying their version is beyond the scope of this tutorial.

We also know that we need Quarto to create the PDF,
so let's find out its version as well:

```{.bash filename="Terminal"}
quarto --version
```

If you installed `apaquarto` or any other Quarto extension,
one can query their versions as follows:[^already-included]

[^already-included]: Luckily, the extensions are included in the project folder,
so technically their version is already recorded in the project's files.

```{.bash filename="Terminal"}
quarto list extensions
```

Finally, we know that we installed a $\TeX$ distribution to create the PDF,
so let's find out its version by running:

```{.bash filename="Terminal"}
quarto check
```

The output is quite long and it might look slightly different for you,
but the relevant sections are the following:

```txt
[✓] Checking tools....................OK
TinyTeX: v2024.09
Chromium: (not installed)

[✓] Checking LaTeX....................OK
Using: TinyTex
Path: /home/r155953/.TinyTeX/bin/x86_64-linux
Version: 2024
```

Add these dependencies to the section **Computational Requirements / Dependencies** of your README file.

Of course, all the system dependencies identified until now
may have dependencies on their own. Use your own judgement to decide when not to dig deeper.
Loading