Open ritosonn opened 3 years ago
+theorem?*?:(`xxx`){ ... }
command registers the key theorem:xxx
, and you can refer to the key with \ref
command like this:
+theorem?*?:(`thm`){}
+proof{
Theorem \ref(`theorem:thm`); is ...
}
You will find the text "Theorem 0.0.1 is ..." in the artifact.
So the command \ref-theorem
exists for shortcuts and is not always necessary.
If you want to omit the prefixed text "Theorem" and the string theorem:
at the beginning of the key, you can define the \ref-theorem
with the either of following codes:
let-inline \ref-theorem label = {Theorem \ref(`theorem:`^label);}
or
let-inline ctx \ref-theorem label = read-inline ctx {Theorem \ref(`theorem:`^label);}
Both are legitimate ways to shorten the text Theorem \ref(`theorem:thm`);
to the text \ref-theorem(`thm`);
.
How to implement \ref-theorem in the stdjareport (I'm beginner in the SATySFi language)
If you plan to modify the stdjareport.satyh
you can write like this:
module StdJaReport : sig
% (... signatures of others ...)
direct \ref-theorem : [string] inline-cmd
end = struct
% (... implementations of others ...)
let-inline \ref-theorem label = {Theorem \ref(`theorem:`^label);}
end
But it is not recommended to edit the local stdjareport.satyh
directly, because the changes may cause conflicts or be overridden by future updates.
Instead, you can define it locally as in the example you presented, or create your own package file like this file.
Or, of course, sending a pull request to this repository is welcome ;)
On SATySFibook (web, v1) page 22, it says that the users can use
\ref-theorem
command as a cross reference of theorems, but this file made compile error.error message:
I checked
stdjareport.satyh
,\ref-theorem
doesn't define in this file. Then I checked https://github.com/xecua/dotfiles/blob/aa4a9c77e26e39888b1712ae2652002d2fbc6de3/satysfi/packages/mylib/stdjareport-ext.satyh and implemented it as follows:Questions:
\ref-theorem
in thestdjareport
(I'm beginner in the SATySFi language)