Showstring Quick Reference
ArborX

Open the Documentation Legend

Summary

This chapter is a quick reference for 3B2 showstring syntax.

Introduction

This chapter contains examples of various syntax that you may require when working with show strings. It is designed to be used as a reference.

In the right hand column there is an example of show string syntax. In the left hand column there is a brief explanation of each show string example.

The chapter consists of five sections:

Jumping

10  Other Related Topics

This will allow you to quickly move to the section that is relevant to the current task. Each section is broken down into subjects such as counters, variables, getvars etc.

Setting

Counters

<?show +1a> <?show +1x(1)> <?show +x(1)>

Adding constant value of 1 to counter.

<?show =a> <?show =0x(1)> <?show =x(1)>

Reset counter to zero.

<?show -1a> <?show -1x(1)> <?show -x(1)>

Subtract 1 from counter.

<?show =*5a> <?show =*5x(1)>

Multiply counter by 5.

<?show =/5a> <?show =/5x(1)>

Divide counter by 5.

<?show +1x(^named)> <?show =1?x(^named)>

Named counters.

<?show =vx(1)x(2)>

Set a counter to the value of another counter in same stream.

<?show ="@vtx1"0x(1)x(2)>

Set x(2) to x(1) at end of previous page from "tx1". You can use -3 to get the value from 4 pages before.

<?show ="@vtx1"1x(1)x(2)>

Set x(2) to x(1) at end of current page from "tx1".

<?show ="@vtx1"2x(1)x(2)>

Set x(2) to x(1) at end of next page from "tx1". The larger the number, the more forward the relative page e.g 5 would be 4 pages from current.

<?show ="@vtx1"$01535vx(1)x(2)> <?show ="@vtx1"9999x(1)x(2)>

Set x(2) to x(1) from last page. Note: If you use a large relative page number (even if that page does not exist), then you get the last known value.

<?show ="@vtx1"1=>

Get ALL counters from tx1 at end of current page.

<?show =^"stream"x(1)>

Set x(1) to content of a stream - must be a number.

<?show =^var^x(1)>

Set x(1) to content of a variable - must be a number.

<?show =^'var'x(1)>

As above but with ' to mark end of variable name.

<?show =^id#^x(1)>

Set x(1) to attribute value - must be a number.

<?show =v01536x(1)>

Set xcounter to getvar 01536 (total number of pages).

<?show =^(v21620/10000)x(1)>

Set x1 to getvar 21620 (baseline position) divided by 10000.

<?show $60#?show ==^var_$^id#^^x(2)$62#>

Set x(2) to content of indexed variable - must only contain a number.

<?show $60#?show ==^'var_$^id#'x(2)$62#>

As above, but using ' to mark the variable name.

<?show =^{var_^id#}x(2)>

As above, but using an indirect variable. The variable must only contain a number.

<?show =^"*mini"x(1)&#62;>

x(1) is equal to the result of a mini script. The mini script must return a number.

Getvars

<?show =^(v21620/10000)x(1)>

x1 is = to getvar (baseline position) divided by 10000.

<?show "^pages"$01536v>

Show getvar to a variable.

<?show "^baseline"$^(v21620/10000)>

Show getvar for baseline position, but divide it enroute.

<?show =v01536x(1)>

Set xcounter to getvar.

Streams

<?show "stream"hello>

Show to a reference (default) stream.

<?show "stream.tx"hello>

Show to a text stream.

<?show +"stream"hello>

Add to end of stream.

<?show -"stream"hello>

Add to start of stream.

<?show "stream">

Flush stream.

<?show "stream1";"stream2"hello>

Show to a stream, and copy to a 2nd stream. This only makes a copy if "stream2" is empty or does not exist.

<?show =^"stream"x(1)>

Set x(1) to content of a stream.

<?show "stream"$^var>

Show a variable to a stream.

<?show "^var"$^"ref">

Show content of a stream to a variable.

<?show "ref2"$^"ref1">

Show content of stream to stream.

<?show $60#?show "ref_$x(1)"$x(1)$62#>

Show value of a counter to an indexed stream.

<?show $60#?show "ref_$^id#"$x(1)$62#>

Show value of a counter to an indexed stream based on attribute value.

<?show "stream"$y"/\60\\47\tag\62\/ct">

Yank (cut) to a stream, everything upto </tag>

<?show "stream"$1,1y"/\60\\47\tag\62\/ct">

Copy.

<?show "stream"$1,1,63y"/\60\\47\tag\62\/ct">

Copy with options to allow &ref; etc.

<?show $60#?show "figure_$^id#"$$1,0,63y"/\\60\\\\47\\fig\\62\\/ct"$62#>

Yank to an indexed stream everything upto </fig>

<?show $60#?show "figure_$x(1)"$$1,0,63y"/\\60\\\\47\\fig\\62\\/ct"$62#>

Yank to an indexed stream everything upto </fig>

<?show "stream"$1,0,0,-1y"/\60\\47\tag\62\/ct">

Yank from the parent (-1) use when the tag yanking is nested 1 level deep.

Variables

<?show "^var">

Fush var.

<?show =^var^x(1)>

Set x(1) to content of a variable.

<?show =^'var'x(1)>

As above but with ' (single quote) to mark end of variable name.

<?show "stream"$^var>

Show a variable to a stream.

<?show "^var2"$^var1>

Show to variable2 the content of variable1.

<?show "^var"$^"ref">

Show content of a stream to a variable.

<?show $60#?show "^var_$x(1)"$x(1)$62#>

Show value of counter to indexed variable.

<?show $60#?show "^var_$^id#"$x(1)$62#>

Show value of counter to indexed variable based on attribute value.

<?show $60#?show "^figure(x(1))"$$1,0,63y"/\\60\\\\47\\fig\\62\\/ct"$62#>

Yank to array.

<?show "^array_var(x(1))"$x(2)>

Pass the value of x(2) to an array.

<?show "^{bib_ref_^id#}"$x(1)>

Show value of x(1) to indirect variable.

<?show =1x(3)> <?show "^array(x(3))"$^{att_^id#}> <?show $^array(1)>

array(1) is value of indirect variable. ^att_ and current value of attribute 'id'.

<?show $60#?show ==^var_$^id#^^x(2)$62#>

.... x(2) is equal to content of indexed variable.

<?show $60#?show ==^'var_$^id#'x(2)$62#>

As above, but using ' to mark the variable name.

<?show "^var"$^(^var+1)><?show $^var>

Add constant value to a variable.

<?show "^pages"$01536v>

Show getvar to a variable.

<?show "^baseline"$^(v21620/10000)>

Show getvar for baseline position, but divide it enroute.

<?show "^var"$^!" xpath syntax here ">

Show an XPath result to a variable.

Auto loading of images

<ENTITY="sp00001" SYSTEM="j:/David/Imports/Bwcar.tif"/>

Show value of attribute to a variable.

<?show "^{^ENTITY#}"$^SYSTEM#>

Indirect variable – create a variable (whose name will be whatever the value of the attribute ENTITY is). Into this variable pass the value of the attribute SYSTEM, e.g. <ENTITY="gr1" SYSTEM="FLOWER.TIF"> so the name of the variable created will be ^gr1 and it will contain the string "FLOWER.TIF". This would be just like the following ^gr1=FLOWER.TIF.

<CoverArt image_source="sp00001"/>

Auto imports the raster. The image will automatically be linked and the internal name will match the external name.

<?show [$$]\\raster(50%,p)==":1::$^{^image_source#}"[$$]>

Create an inline raster. Autoload it, however do nothing if the graphic is missing ( :1:: ). The name of the figure to load, is contained within the a variable. The name of the variable is whatever the current value of the attribute "image_source" is <fig image_source="gr1">. Using the example above, the variable ^gr1 currently contains the string "flower.tif". Therefore this should be the graphic that is autoloaded and displayed.

Displaying

Misc.

$10# $131# $262# $0x3047# $12359#

Output - characters by code (return/emspace/pagebreak......unicode character).

[style] [?tic=red]

Output <style> or <?pi> (without any interpretation).

Counters

<?show $x(1)> <?show $5x(1)> <?show $6x(1)> <?show $9x(1)> <?show $10x(1)>

Display the counter in various format types, e.g. 1 2 3, a b c, i ii iii, month, day.

<?show $105x(1)>

Display ALL capital letters. e.g. A B C, MAY, THURSDAY.

<?show $205x(1)>

Display INITIAL capital letters, e.g. A B C, May, Thursday.

<?show $0,-2,130x(1)

Padding - if xcounter if less than 2 digits output a figure space to the left of the digit.

Variables

<?show $^var> <?show $^var^> <?show $^'var'>

Display value of variable.

<?show $^array_var(1)>

Output array.

<?show $^array_var(x(1))>

Output array based on counter value.

<?show $^array_var_$x(1)>

Output indexed variable.

<?show $^id#> <?show $^id#^>

Display attribute value of id.

<tag attribute-with-dot="hello"> <?show $^'attribute.with.dot'#>

Display attribute if attribute name contains dots.

<tag attribute-with-dashes="hello"> <?show $^attribute_with_dashes#>

Display attribute value if attribute name contains dashes.

<?show $^(10%3)>

Display the mod that cannot be divided into 10/3 remains = 1.

<?show "^var"7> <?show $^(^var%4)>

Display the mod that cannot be divided into 7 remains = 3.

<?show $^((^width*90)/100)>

Display 90% of ^width

<?show $105^(^appendix)>

Capitalise whole word. The variable ^appendix must contain a number.

<?show $205^(^appendix)>

Capitalise first letter only.

<^?show ^{^CGRef#}

Outputs the contents of a variable with same name as attribute.

<?show $^"*mini">

Runs a mini script.

<?th==$^"*mini"^pt>

Runs a mini script then uses the result if the last var and mini script have the same name.

<^?th=^id#>

No need to use a showstring. Also $ not required.

<?show "ref"22pt> <^?th=^"ref">

Processing instruction using the value of a stream.

<?show "^ref"10> <^?th=^'ref'pt>

Processing instruction using the value of a variable, with quotes to indicate the start and end of the variable name.

<^?th=^(2*x(1))pt>

Produce a text height that is based on the expression (2 times value of x(1)).

<^?tw=^(^(x(2))-^(x(1)))h>

Produce a text height that is based on the expression (x(2) minus the value of x(1)).

<^?th=^(x(1))pt>

Produce a text height that is based on the expression (1 times value of x(1)).

<^?th=^(x(^var))pt>

Produce a text height that is based on the expression (1 times value of an xcounter – this would be a named counter).

<^ref_^id#>

If <^ref_^id#> is within <tag id="title"> then the tag <ref_title> would be applied.

&^ref_^(x(1));

Similar to above.

<?th+=5pt>

Add 5pt to current point size.

<?th +=-5pt

Subtract 5pt.

<^tpl=^(10+5)mm>

Left margin is 15mm.

<?show $^!" xpath syntax here ">

Allows you to use XPath with a showstring.

Auto loading of images

<ENTITY="sp00001" SYSTEM="j:/David/Imports/Bwcar.tif"/>

Show value of attributte to a variable.

<?show "^{^ENTITY#}"$^SYSTEM#>

Indirect variable – create a variable (whose name will be whatever the value of the attribute ENTITY is ). Into this variable pass the value of the attribute SYSTEM e.g. <ENTITY=”gr1” SYSTEM=”FLOWER.TIF”> so the name of the variable created will be ^gr1 and it will contain the string "FLOWER.TIF". This is just like the following: ^gr1=FLOWER.TIF

<CoverArt image_source="sp00001"/>

Auto imports the raster.

<?show [$$]\\raster(50%,p)==":1::$^{^image_source#}"[$$]>

Create an inline raster. Autoload it, however do nothing if the graphic is missing ( :1:: ). The name of the figure to load, is contained within the a variable. The name of the variable is whatever the current value of the attribute "image_source" is, e.g: <fig image_source="gr1"> Using the example above, the variable ^gr1 currently contains the string "flower.tif". Therefore this should be the graphic that is autoloaded and displayed.

<$$>\raster(50%,p)="Advent_logo"<$$>

Display raster.

<?show [$$]\\raster($^scale#,p)=="$^image#"[$$]>

As above but using attributes.

<?show [$$]\\raster($^(^scale#/2)%,p)=="$^image#"[$$]>

As above but divide the ^scale# by 2.

<$$>\raster(50%,p)="<?show $^image#>"<$$>

Display raster.

<?attr 0> useful for scanning ahead when XPath is not available.

<?show $^_#>

Display current element name.

<?attr 0>

Move to next element.

<attr 0,-3>

Tag containing ?attr is nested 3 levels deep go back to main stream, then move to next element.

Streams

<?show $^"stream">

Display content of stream.

<?show $60#ref_$x(1)$62#>

Display content of indexed stream.

<?show $60#ref_$^id#$62#>

Display content of indexed stream based on attribute.

<?show $60#?show $$^var_$x(1)$62#>

Display the content of indexed variable.

<?show $60#?show $$^var_$^id#$62#>

Display the content of indexed variable based on attribute.

Getvars

<?show $^(v01627+1)>

Display table column +1.

<?show $106^(^01535)>

Display last page number as I II III IV V etc.

Testing

Counters

<?show =1?x(1)> <?show +4?x(1)> <?show -6?x(1)>

IF testing counter against number.

<?show =1!x(1)> <?show +4!x(1)> <?show -6!x(1)>

IF NOT testing.

<?show =.1?x(1)> <?show =.1!x(1)>

Odd/even (binary) tests.

<?show =16?x(1)=0x(1)[?tic=red]>

Test and change.

<?show =12?x(1)=.1?g$261#>

Multiple tests (both must be true).

<?show -{10?x(1)+1x(1)[col]>

While (loop) - x1 is less than 10 output tag [col] you must increment a counter otherwise you will not be able to exit the loop.

<?show -{^column_start#^?x(1)+1x(1)[?tbcstrt]

While (loop) - x1 is less attribute output tag [?tbcstrt]

<?show =vx(1)?x(2)>

Test a counter against another counter.

<?show =^"stream"?x(1)>

If x counter is equal to stream.

<?show =^id#?x(1)>

If x counter is equals attribute id.

<?show =^var?x(1)>

If x counter is equals ^var.

<?show ="@stx1"x(1)> <?show ="@Stx1"x(1)>

Size of stream/style/reference.

<?show ="@xrg1"x(1)> <?show ="@Xrg1"x(1)>

If tag exists then x(1)=1 if not x(1)=0

<?show ="@tbody"x(1)> <?show ="@Tbody"x(1)>

Type of tag: 0=text 1=style 2=reference 3=object 4=raster 5=page 6=footnote 7=bullet 17=comment 20=script 32=colour 33=bookmark.

<?show ="@cbody"x(1)> <?show ="@Cbody"x(1)>

Class of tag: 0=text (style/reference/text stream) 1=object 2=raster 3=page 4=colour 5=bookmark

<?show ="@lrg1"x(1)> <?show ="@Ltx1"x(1)>

Load state: 0=unloaded 1=loaded 2=loaded and changed

Variables

<?show =0?x(1)=^(^var)?^(2)hello>

AND multiple tests (both must be true).

<?show =^(?="a","a"|?="a","b")?^(1)hello>

OR multiple tests (either can be true).

<?show =5?^var^>

If var is equal to 5.

<?show =^(?+^(^var1(x(1))),^(^array(x(1))))?^(1)hello>

If TRUE that ^var(1) is greater than ^array(1)

<?show =^(?+^var1,1)?^(1)>

var1 is greater than the number 1.

<?show =^(?+^var1,^var2)?^(1)>

var1 is greater than var2

<?show =^(?+^(^var1),^(^var2))?^(1)>

var1 is greater than var2

<?show ?+^(^varA),^(^varB)>

If varA is 'greater' than varB.

<?show ?=^(^varA),^(^varB)>

If varA is 'equal' to varB

<?show ?-^(^varA),^(^varB)>

If varA is 'less' than varB

<?show ?+-^(^varA),^(^varB)>

If varA is 'not equal' to varB

<?show ?+=^(^varA),^(^varB)>

If varA is 'greater than or equal' to varB

<?show ?-=^(^varA),^(^varB)>

If varA is 'less than or equal' to varB

<?show =^(?=^var,"hello")?^(1)>

The variable var matches the word 'hello'.

<?show =^(?=^var,"hello")?^(1)=^(?+^(^var1),^(^var2))?^(1)>

Both are TRUE.

<?show =^(?=^"stream1","hello")?^(1)>

stream1 matches the word 'hello'.

<?show =^(?=^"stream1","")?^(1)>

stream1 is empty.

<?show =^(?=^"stream1",^"stream2")?^(1)>

stream1 matches stream2.

<?show =^(?=^"stream1",^var)?^(1)>

stream1 matches var

<?show =^(?=^(((10+5)*10)/2),75)?^(1)>

The expression matches 75.

<?show =^(?=#^var2,"1..10i")?^(1)>

var2 is a number between 1 and 10.

<?show +0?^(?/^var3,"[1-5]")>

If var contains a number between 1 to 5 anywhere. Note: the character position is returned.

<?show +0?^(?/^var4,"[^a-zA-Z]")>

var4 contains anything other than just letters.

<?show +0?^(?/^var,"h.llo")>

var contains 5 characters and the second character could be anything.

<?show +0?^(?/^var,"^h.*o")>

var starts with 'h' contains zero or more characters followed by the letter 'o'.

<?show +0?^(?/^var,"^h.*o$")>

var starts with a 'h' contains zero or more characters and ends with the letter 'o'.

<?show "^var1"abc> <?show "^var2"123abcxyz> <?show +0?^(?/^var2,^var1)hello>

Search for the contents of ^var1 within ^var2.

INCORRECT <?show +0?^(?/@^var,"^<TAG>[0-9]")hello> CORRECT <?show "^regex"^$60#TAG$62#\[0\-9]> CORRECT <?show +0?^(?/@^check_num,^regex)hello>

Case sensitive search. If true that the U/C element <TAG> followed by a number was at the start of ^var the output 'hello'. Note: It is not possible to search directly for TAG, you must pass this to another variable and then search within that new variable.

<?show +0?^(?/^__#(1),"m")hello>

Does indexed attribute (1) contain an 'm'.

<?show $^(?/^__#(1),"m")>

Show the position of the first 'm' in indexed attribute (1).

<?show $^(?/^__#(1),"[0-9]")>

As above but looking for a number.

<?show =^(?=@"a","a")?^(1)>

Both characters are the same case.

<?show =^(?="A","a")?^(1)>

Both characters are the same with case sensitive turned off (converted to lowercase).

<?show =^(?+@"b","a")?^(1)>

'b' has a higher value (ISO) than a 'a'.

<?show =^(?=@"apple","Apple")?^(0)>

The two words are not the same case.

<?show =^(?=@^var,^var5)?^(0)>

The contents of the vars is not the same case.

<?show =^(?=^var,^attribute#)?^(1)>

The variable ^var and the attribute are the same.

<?show =^(?=^attribute#,"hello")?^(1)>

The attribute and the word 'hello' are the same.

<?show =^(?=^attribute#,^"stream1")?^(1)>

The attribute and stream1 are the same.

<?show =^(?=^var3,^(?=^var1,^var2))?^(1)hello>

Compare ^var1 and ^var2 and returns 1 or 0 then compare this against ^var3

<?showifdef "id" hello>

If the attribute id is defined, then output 'hello'.

<?showifdef "id=bold"hello>

If the attribute was present, and = bold.

<?showifdef "id*=c*"hello>

If attribute was present and its value begin with a 'c' or 'C'.

<?showifdef "id@*=c*"hello>

If attribute was present, and its value begin with a U/C 'C'.

<?showifdef !"font" goodbye

If attribute was not present.

<?showifdef !"font=bold"goodbye

If attribute was present, but not equal to 'bold'.

<showifdef !"id/=(appendix*)|(section*)" hello>

Regular expression - if 'id' was not defined as "appendix" or "appendix1" or "appendix2" or "section" or "section1" or "section2".

<showifdef !"id/@=(appendix*)|(section*)" hello>

Case sensitive version of above.

<?showifdef "id#=1..5i" hello>

Was id between 1 and 5.

<?showifnum "id" hello>

If attribute starts with a number.

<showifnum !"id"goodbye>

If attribute does not start with a number.

<tag ID=10,12> or <tag ID,10,12>

<?showifdef "ID" $62#?th==$^ID#(1)pt$62#> <?showifdef "ID" $62#?tlb==$^ID#(2)pt$62#>

<style ID=10,12>

<?showifdef "_ _(1)" $62#?th==$^_ _#(1)pt$62#> <?showifdef "_ _(2)" $62#?tlb==$^_ _#(2)pt$62#>

<name=10,12 col=red,1>

<?showifdef "_ _(1)" $62#?th==$^_ _#(1)pt$62#> <?showifdef "_ _(2)" $62#?tlb==$^_ _#(2)pt$62#> <?showifdef "col" $62#?tic==$^col#(1)$62#> <?showifdef "col" $62#?tul==$^col#(2)$62#>

<?th?12pt=10pt>

If current point size is 12pt then change to 10pt.

<?tic?red=blue>

If the current text colour is red, then change the text to be coloured blue.

<?tf?"times"="times-b">

If the current font is times, then change it to times bold.

<^?tlb=^(^line#-v21620)pt>

Processing instruction for leading using "variable substitution" which will give the line spacing which is the result of the expression (value of the attribute "line" minus the getvar for "baseline position").

<?bk [?tic=red]>......paragraph text here.....<?ek>

If the two commands are not on the same line then an instruction can be issued at the <?bk> position. e.g reduce point size until text fits on a single line.

Streams

<?show =^(?=^"stream1",^"stream2")?^(1)>

If contents of streams are equal.

<?show =^(?+-^"stream",^var)?^(1)>

If the contents of a stream is NOT equal to var.

<?show =^"stream"?x(1)>

If x counter is equal to stream.

Getvars

<?show =^(?+^(v21620/10000),^(24))?^(1)[?tic=red]>

If baseline greater than 24mm.

<?show =^(v1647)?^(2)>

If current amount of columns = 2.

<?show =v01535?g>

If on last page.

<?show +0?^01611$262#>

If greater than 1st line on page then pagebreak.

Call Outs

<?:loop> <#><?tic=red><#><?tic=black> <?{loop>

Everytime a # appears in the paragraph the text change alternate colours. Note: The # is suppressed from screen.

<#,9>"<?tic=red>

Use a tab rather than a #, and preserve the tab.

<?:loop> <#,":;+"><?}char_$11690v><?-> <?:char_:><?tic=red><?{loop><?-> <?:char_;><?tic=blue><?{loop><?-> <?:char_+><?tic=magenta><?{loop><?->

3 possible callout characters These can appear in any order. Getvar 11690 provides a string representation of the 'called out' character. This can be used directly in a show string to re-insert the character.

<?:loop> <#,131,"Aa"><?}char_$01619v><?-> <?:char_65>Upper Case A<?{loop><?-> <?:char_97>Lower Case a<?{loop><?-> <?:char_101>emspace<?{loop><?->

Getvar 01691 provides the 3B2-ASCII code of the character. This is useful for characters that are difficult or impossible to represent in a label, for example, paragraph ends, tabs, angle brackets, or to distinguish upper/lower case.

<#;0><#;1><#;-><#;+>

Disables existing callouts. Within Maths, you may want to ignore callouts etc. Turning callouts off, stops them from being triggered when the relevant character is encountered, but still remembers the callout characters and location, so that it can be turned on again. <#;0>=off, <#;1> = on <#;->= off and increments a counter. <#;+>= on and decrements the counter only when zero are callouts re-enabled. <#;-> and <#;+> can thus be nested.

Jumping

Basics

<?}label>

Jump forward to fixed label.

<?:label>

A fixed label.

<?{looping_label>

Jump back to fixed label.

<?}label with spaces>

Demonstrating that jumps can have spaces if they want to, rather than have to use undescores.

<?:label with spaces>

Demonstarting that labels can have spaces if they want to, rather than have to use undescores.

<?–}prefix_1>

Jump back one tag level to label :prefix_1.

<?–>

Exit.

<?–2>

Exit, and return 2 levels back to where jump occurred.

Jumping

Counters

<?}prefix_$x(1)>

Jump to label with current value of x1.

<?}Prefix_=1?x(1)YES>

Jump to label :prefix_YES if x1 equals 1.

<?}con=1?x(1)sta=2?x(2)nt>

Jump to one of 3 possible labels depending on which test is passed.

<?{+1x(2)=^id#^?x(2)chk_bibr>

Add one to x(2) and if it is then equal to the id, then jump to :chk_bibr.

<?{-1x(2)no_bibr>

Subtract 1 from x(2) and jump to :no_bibr.

The following was used by cross references to decide which of 3 possible outputs to use depending how far away certain frames were from their cross reference. A stream attached to each frame had to capture its page number and store this in x(1)

<?}page_=1?^(x(1)-g)next=.1?g_opposite>

Jump to one of 3 labels.

<?:page_>See page ???<?->

Jumps to here if you are on the same page or more than 1 page away.

<?:page_next>See page ???<?->

Jumps to here if the advert is 1 page away from the ref, but not opposite i.e the advert is on the back of the ref page.

<?:page_next_opposite>See opposite page<?->

If the cross reference is on a left page, and the frame is on the opposite right page you will jump to here.

Variables

<?}prefix_$^id#>

Jump to label with current value of attribute id.

<?:const_$^id#>

Label using attribute value.

<?}prefix_$^var>

Jump to var value.

<?}prefix_$^var(x(1))>

Jump to array value.

<?}tag_$^_#>

Jump to label using tag name.

<?}prefix=^(?=^var1,^var2)?^(1)YES>

Jump IF comparison is true.

<?}=^(?=^var,^attribute#)?^(1)label>

Jump if variable equals attribute.

<?}value_$^(?=^id1#,"")^_$^(?=^id2#,"")^>

Jumps to various <?:value_0_0> depending if either of the attributes were defined.

<?{+1x(2)=^id#^?x(2)chk_bibr>

Add one to x(2) and if it is then equal to the id, then jump to :chk_bibr.

<?}prefix_$^amount_appendix(x(2))^>

Jump to value of array.

<?}+0?^(?=@/^id#,"[A-Z]")^upper> <?}+0?^(?=@/^id#,"[a-z]")^lower> <?}+0?^(?=@/^id#,"[0-9]")^number>

Jump to label if the value of attribute is in certain regular expression range.

<?show +0?^(?/^__#(1),"m")[?-}label]> <?show +0?^(?/^__#(1),"[0-9]")[?-}label]> <?show +0?^(?/^__#(1),"[^0-9]")[?-}label]>

As above but for indexed attribute.

<?showifdef "id" [?–}label]>

If the attribute was defined then jump to a :label.

<?showifdef "id" $60#?- -}label_$x(1)$62#>

As above but the :label uses a counter value.

Streams

<?}const_$^"stream">

Jump to stream value.

Getvars

<?}prefix_$0000v>

Jump to label with getvar value.

3B2 Expressions operators

The following table summarises the operators post version 9 and also lists the previously supported operators for completeness.

Pri

C

Before

Post 8.13o

Description

U

!

! not

Logical NOT

~

~

_not

Bitwise NOT

-

-

Unary minus

+

+

Unary plus

0

*

*

Multiply

/

/

Divide

%

%

Remainder

1

+

+

Add

-

-

Subtract

2

<

< lt

Less than

<=

<= le

Less than or equal to

>

> gt

Greater than

>=

>= ge

Greater than or equal to

3

==

== eq

Equal

!=

!= ne

Not equal

4

&

:

_and

Bitwisre AND

5

^

^

_xor

Bitwise eXclusive OR

6

|

|

_or

Bitwise OR

7

&&

: : && and

Logical AND

8

| |

| | or

Logical OR

7.1 

Expressions tips

— 3B2 does not care about spacing around operators when there is no ambiguity. For example, ^(borg) is the same as ^(b or g). However, ^(geq2) is not the same as ^(g eq 2), it is parsed as ^(ge q 2) and is meaningless.

— The result of comparison and logical operators is 1 (true) or 0 (false).

— Operator priority is the same as C/Java etc. Referring to the table above, operators in the top priority group bind the most tightly and the bottom group most loosely. For example, ^(a or b and c) is the same as ^(a or (b and c)) and ^(a == 1 and g == 3) does what you think it should do.

Other Related Topics

Running heads - Input

<?"running head text",6,1>

Group 1 (specified text).

<?"running head text",8,1>

Group 1 (specified text,show at point of insertion).

<?"running head text",6,2>

Group 2 (specified text).

<?"|y/\60\\47\tag\62\/ct",6,1>

Group 1 (extract/cut).

<?"|y/\60\\47\tag\62\/ct",8,1>

Group 1 (extract/copy).

<?"|1,63y/\60\\47\tag\62\/ct",8,1>

Group 1 (extract/copy with all options).

Running heads - Output

<?show $0"strm0">

Group 1 (brought forward/use previous ref).

<?show $1"strm0">

Group 1 (first on page/use previous ref).

<?show $2"strm0">

Group 1 (last on page/use previous ref).

<?show $0,0,2"strm0">

Group 2 (brought forward/use previous ref).

<?show $1,0,2"strm0">

Group 2 (first on page/use previous ref).

<?show $2,0,2"strm0">

Group 2 (last on page/use previous ref).

<?show $1,0,3"strm0">

group 3 (first on page/use previous ref)

<?show $1,0,10"strm0">

Group 10 (first on page/use previous ref).

<?}prefix_$1"strm0">

Jump to label that matches first running head on page.

Anchors

<?"anchor_name",5,"anchor_condition">

Basic anchor reference.

Indexing

<?"Company|Advent",4>

Group 1.

<?"company|advent",4,0,2>

Group 2.

<?"company|advent",4,0,4>

Group 3.

<?"company|advent",4,0,8>

Group 4.

<?"company|advent",4,0,16>

Group 5.

<?"Maa^McDonald",4>

Group 1 (sort as).

Bookmarks

<?"mark1",13,"Pdf description",1,0,0,0,0mm,0mm,0mm,0mm>

bookmark that will display entire page

<?tbklnk="mark1">

hypertext link to bookmark

Footnotes

<?"|fn1",3> <?"|">

Group 1 (inline to named).

<?"|fn1",9> <?"|">

Group 2 (inline to named).

<?"|fn1",10>

Group 3 (inline to named).

<?"|fn1",11>

Group 4 (inline to named).

<?"|fn1",12>

Group 5 (inline to named).

<?"||fnote",3> <?"|">

Group 1 (inline to auto).

<?"||fnote",12>

Group 5 (inline to auto).

<?"|fn1",3;"/\60\\/fn\62\/tc"></fn>

Group 1 (inline to named/user defined terminator </fn> rather than <?"|">).

<?show [?"||fnote",3;0,999]$^var[?"|"]>

Group 1 (inline to auto) use the content of ^var rather than getting it from the main stream. Note that the hierarchy needs to be set to Current (999).


Document created on 09-Oct-2002 (revision 0.0)