Skip to content

How to cross-reference a Section #145

Description

@agila5

Dear all,

I create this issue since I was wondering whether the template provided by rjtools supports cross-references to existing sections of the paper and, in that case, how am I supposed to specify such cross-references. For example, I would like to write something like "The remaining parts of the paper are structured as follows. Section 2 presents the data .... " but I couldn't find any way to do that.

What I've tried so far

I've specified the label of the Section immediately after its title using the following format: # title (#sec:label) and then I started cross-referencing that section using the format \@ref(sec:label). For example:

Image

However, when I knit such document I receive a warning message saying that the document didn't recognise the label:

Image

Moreover, the same label is not properly rendered in the HTML format

Image

but, for some reason, is recognised but erroneously rendered in the PDF format:

Image

Analogous results hold when I specify and reference the label without the sec: prefix.

In case it might be useful, I attach here the .Rmd file (in .txt format) used to generate these results. test.txt

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions