Preliminaries

You can find the solutions for this exercise as well as the following ones in the exercises folder in the workshop material. You can also navigate the workshop material online (including exercises and solutions).

You can copy code from the exercise and solution files by clicking on the small blue clipboard icon in the upper right corner of the boxes showing the code.

Exercises

In this exercise you will create revision letter that quotes sections of the revised manuscript.

Exercise 1

Draft a revision letter. Create a new revision letter, add some reviewer comments and your responses to them. Then make some changes to the manuscript and use labelled quotes to insert the revised sections into the revision letter without copy-pasting.
Make sure that you set label_quotes: yes in the YAML front matter of your manuscript. Otherwise the labelled quote-tags will be visible in the rendered manuscript.

Solution

In the manuscript the labelled paragraph could look like this:

<@~{#quote-name}
This is the revised paragraph. It's so good that I want to show it in the revision letter!
~@>

To automatically quote this paragraph in the revision letter, you can do the following.

```{r}
quote_from_tex("quote-name", file = "path/to/revision.tex")
```



Exercise 2

Create a version of your manuscript with marked-up channges.

  1. Rename the .tex file of your manuscript.
  2. Edit the manuscript and knit it.
  3. Go to https://3142.nl/latex-diff/ and create a diff of the two manuscript versions.
  4. Compile the diff into a PDF in RStudio.



Bonus

Bonus 1

Use labelled quotes to insert the revised sections with highlighted changes into the revision letter without copy-pasting.

Solution

In diff the labelled paragraph could look like this:

% <@~{#revised-paragraph}

Implicit learning refers to the ability to adapt to regularities
inherent in the environment in the absence of conscious awareness
about the ongoing learning process itself or \DIFdelbegin
\DIFdel{about the outcome of what is learned}\DIFdelend \DIFaddbegin
\DIFadd{bla bla bla}\DIFaddend . This ability is fundamental for
human beings as it allows us to act optimally in stable environments
with relatively little effort.

 % ~@>

To automatically quote this paragraph in the revision letter, you can do the following.

```{r}
quote_from_tex("revised-paragraph", file = "path/to/diff.tex")
```

Solutions

After you have tried yourself, feel free to have a look at our solutions.