Questions tagged [cross-reference]

a notation or direction at one place (as in a document or file) to pertinent information at another place

365 questions
10
votes
1 answer

Python-Sphinx: Link to Section in external File

I want to link to a section in an external file, but I can't get it to work. The :ref: does not seem to work globally, or do I use it wrong ? .. File: some_file.rst .. _ref_section: Some Section ------------ Paragraph, foo bar lorem…
Niklas R
  • 16,299
  • 28
  • 108
  • 203
10
votes
1 answer

How to choose the text use in a cross-reference with Sphinx?

Using sphinx, I included a figure using the following syntax. .. _struct_NiO: .. figure:: img/NiO.png :align: center :width: 400px long long very long caption ... In another part of the text I used See figure :ref:`struct_NiO` bla bla…
Ger
  • 9,076
  • 10
  • 37
  • 48
9
votes
3 answers

Rmarkdown: cross-reference image included with markdown syntax

I would like to cross-reference an image which I include with the markdown ![caption with spaces](path/to/image.png) syntax. I would like to be able to cross-reference this image as \@ref(fig:caption-with-spaces). I am using…
Sighonide
  • 600
  • 4
  • 15
9
votes
2 answers

How can I put an intersphinx link to an arbitrary method in the standard library documentation?

I am trying to use Sphinx to document a project, but I cannot figure out how to use intersphinx. I use this line: :py:meth:`math.sin` to add the link, but in the output, it shows up bold, not as a link. Although that line does not work, both the…
Ed L
  • 1,947
  • 2
  • 17
  • 30
9
votes
2 answers

Reference to figure and table numbers with Pandoc

I'm trying to make a document with Markdown/restructuredText which will be converted with pandoc to PDF using xelatex. I would like to return reference to figure and tables numbers in the text body. In both Markdown and reSt markup languages, the…
JeanJouX
  • 2,555
  • 1
  • 25
  • 37
9
votes
1 answer

Adding figures and tables after bibliography in Rmarkdown

I want to add tables and figures after the bibliography in an R Markdown document. However, R Markdown documents will by default always add the bibliography to the end of the report. Is there an easy way to add content to the document after the…
SavedByJESUS
  • 3,262
  • 4
  • 32
  • 47
9
votes
2 answers

PyYaml "include file" and yaml aliases (anchors/references)

I had a large YAML file with a massive use of YAML anchors and references, for example: warehouse: obj1: &obj1 key1: 1 key2: 2 specific: spec1: <<: *obj1 spec2: <<: *obj1 key1: 10 The file got too large, so I looked for a…
benams
  • 4,308
  • 9
  • 32
  • 74
9
votes
1 answer

How are PDF files able to be partially displayed while downloading?

According to the PDF 1.7 specification, page 90, Sec 3.4: The preceding sections describe the syntax of individual objects. This section describes how objects are organized in a PDF file for efficient random access and incremental update. A…
myermian
  • 31,823
  • 24
  • 123
  • 215
8
votes
3 answers

Sphinx: cross-reference indexed item

How can I cross-reference an indexed item inside a reStructuredText document? For example, how can I cross-reference SectionB: .. index:: pair: SectionA; SectionB SectionB -------- SectionB description. I tried using the index labels in…
Unbeknown
  • 106
  • 1
  • 5
7
votes
1 answer

Sphinx: how to cross-reference a target generated by a custom directive

I'm having trouble cross-referencing a section generated by a custom directive. Here is the directive: from docutils import nodes from docutils.parsers import rst class TestDirective(rst.Directive): has_content = False required_arguments…
abey
  • 593
  • 10
  • 26
7
votes
1 answer

How to add a cross-reference supplementary figures in bookdown/knitr/Rmarkdown

The cross-referencing of figures works great thanks to the very helpful package bookdown from Yihui Xie. And one can reference figures like described in this question However, I have to separate sets of figures when authoring publications for…
WojciechF
  • 370
  • 2
  • 14
7
votes
2 answers

Is it possible to DRY up yaml?

I am using Rails' 4.1.4 YAML locale files to store some translations, for example: en: words: en: passport: "passport" ticket: "ticket" train: "train" de: words: en: passport: "passport" ticket: "ticket" …
Epigene
  • 3,634
  • 1
  • 26
  • 31
7
votes
5 answers

Generating anchors with PyYAML.dump()?

I'd like to be able to generate anchors in the YAML generated by PyYAML's dump() function. Is there a way to do this? Ideally the anchors would have the same name as the YAML nodes. Example: import yaml yaml.dump({'a': [1,2,3]}) 'a: [1, 2,…
Geoff Lawler
  • 71
  • 1
  • 3
7
votes
1 answer

Resolving name conflicts in references in Sphinx with intersphinx

I am writing docs for my python library Using sphinx, I also added another sphinx documentation with intersphinx. And it works pretty nice, but a few my functions are named the same as in referenced documentation, which leads to shadowing their…
Suor
  • 2,845
  • 1
  • 22
  • 28
6
votes
1 answer

Inline Code Link in Sphinx + reStructuredText

In Markdown, one can create an inline code link like so [`dict.update`](https://docs.python.org/3/library/stdtypes.html#dict.update) Which renders like dict.update. How can get a similar behaviour in reStructuredText / Sphinx? I tried (1) using a…
Hyperplane
  • 1,422
  • 1
  • 14
  • 28
1
2
3
24 25