Difference between revisions of "Command/definereferenceformat"

From Wiki
Jump to navigation Jump to search
 
Line 38: Line 38:
 
</context></cd:example><cd:example title="">The <code>label</code> option uses a defined {{cmd|labeltext}} instead of an explicit text.
 
</context></cd:example><cd:example title="">The <code>label</code> option uses a defined {{cmd|labeltext}} instead of an explicit text.
 
<context source="yes">
 
<context source="yes">
 +
\setcounter[userpage][4]
 
\definereferenceformat
 
\definereferenceformat
 
     [atfig]
 
     [atfig]
Line 47: Line 48:
 
\placefigure[][fig:cow]{A beautiful cow}{\externalfigure[cow][width=2cm]}
 
\placefigure[][fig:cow]{A beautiful cow}{\externalfigure[cow][width=2cm]}
 
</context>
 
</context>
{{bug|1=<code>type=page</code> appears broken with the current wiki version --[[User:Taco|Taco]] ([[User talk:Taco|talk]]) 15:23, 5 September 2020 (CEST)}}</cd:example></cd:examples>
+
(the page number is off-by-one because of how the wiki creates its bitmaps)</cd:example></cd:examples>
 
<cd:notes></cd:notes>
 
<cd:notes></cd:notes>
 
<cd:seealso>
 
<cd:seealso>

Latest revision as of 10:05, 29 October 2021


\definereferenceformat

Summary

The command \definereferenceformat is used for predefining reference formats.

Settings

\definereferenceformat[...][...][...=...,...]
[...]name
[...]name
...=...,...inherits from \setupreferenceformat

Description

Predefine reference text, so that for example you won't have to type \in{Equation}[eq:somelabel] all the time.

Examples

Example 1

\definereferenceformat
   [ineq]
   [left=(,
    right=),
    text=Equation,]

\placeformula[eq:pythagoras]
\startformula
  a^2+b^2=c^2
\stopformula

This is explained in \ineq[eq:pythagoras].

Example 2

The label option uses a defined \labeltext instead of an explicit text.

\setcounter[userpage][4]
\definereferenceformat
    [atfig]
    [label=page,
     type=page]

The animal (\atfig[fig:cow]) is black and white and produces milk.

\placefigure[][fig:cow]{A beautiful cow}{\externalfigure[cow][width=2cm]}

(the page number is off-by-one because of how the wiki creates its bitmaps)

Notes

See also

Help from ConTeXt-Mailinglist/Forum

All issues with: