Doc Refs#
Proofscape gives you various ways to make document references (“doc refs”), which means making connections between the Content Types of notes and charts on the one hand, with docs on the other.
Specifically, a doc ref is made when you define Doc Widgets in annotations and Sphinx pages, and when you define Doc labels on nodes in deductions.
Doc ref strings#
A doc ref string is a string of the form:
DOC#CODE
where DOC
is a (relative) libpath resolving to a doc info object (see below),
and CODE
is a box combiner code (see below).
Doc ref strings may be used at various places in the Proofscape library, such as in Doc Widgets and Doc labels.
Alternatively, in such contexts there is also usually an option to specify the doc info object and the combiner code separately. See the relevant reference sections for details.
Doc Info Objects#
A doc info object is an object (in the JSON sense – see Proofscape-flavored JSON) defining information about a document. It is used for identifying a document, and is necessary for making references from doc widgets and doc labels.
It should be defined either in a .pfsc
file or under a pfsc
directive
in an .rst
file, and may look roughly like this:
MyDocument = {
docId: "pdffp:0123456789abcdef",
url: "https://example.org/some/document/itself.pdf",
aboutUrl: "https://example.com/docinfo.html",
title: "We Love Math",
author: "Martha and Matthew Matician",
year: 2023,
}
Below we define the required and optional fields for doc info objects.
Required Fields#
Field |
Value |
---|---|
|
String identifying the document. Format is At present only one The |
Optional Fields#
Field |
Value |
---|---|
|
A URL pointing directly to the document itself. Will be used by PISE to automatically load the document. |
|
The URL of a page where instructions can be found, for obtaining the document.
Usually offered only if a |
|
the title of the document |
|
the author of the document |
|
year of publication |
|
publisher |
|
ISBN |
|
eBookISBN |
|
DOI |
Box Combiner Codes#
The box combiner language is a simple language for describing combinations of boxes in PDFs and other archival documents.
In PISE, you can interactively select one or more boxes, i.e. rectangular areas on one or more pages of the document, and then generate a combiner code to indicate the way those boxes should be arranged to form a selection from the document. See, for example, Define a doc label in the Authors’ Tutorial.
A full combiner code is a concatenation of individual commands (see table below).
Each command (except the “Box” command) must be terminated with a semicolon ;
.
Whitespace is ignored.
Command |
Format |
Meaning |
---|---|---|
Version |
|
Indicates the version of the Combiner Code language. Must come at the start of the code. Currently |
Box |
|
Defines a box in a page, by recording the page number within the document, the dimensions of the page at the time the box was drawn, and the position and dimensions of the box. Usually not written by hand, but instead generated by PISE after the user draws a box. |
Scale |
|
Records the zoom scale of the document at the time that the boxes were drawn. Although this information could be determined from the box codes themselves, that requires loading the document and comparing. The Scale command makes it possible to know the zoom without loading the document. |
x-shift |
|
Shifts the “cursor” in the x-dimension, adjusting the offset at which the next box (if any) will appear. Positive shift moves to the right, negative to the left. |
y-shift |
|
Shifts the “cursor” in the y-dimension, adjusting the offset at which the next box (if any) will appear. Positive shift moves down, negative up. |
Newline |
|
Like hitting “return” in a text editor, resets the x-coordinate of the cursor to zero, and sets the y-coordinate so that the next box appears immediately below the lowest boxes already drawn. |
z-index |
|
Just like the CSS z-index property, this is an integer that can be used to elevate the box combination, above or below others that may also be present in the same document. |