Description
This tag inserts a typographical variable of integer type in text (See GNML variables for the list of variables), or a custom numeric attribute values, for edition, page and text objects (GN4-1808, available since 2.0.1977.x, see Custom edition/page/text attributes in tags for details).
Parameters and typographical expressions
1.number or a GNML variable of integer type or a custom numeric attribute value. You can also add a simple math operation, e.g. >writei PageNum+1<
Note: The entire edition, page and text objects set of numeric "value kind" attributes (ie: no reference) are available as numeric justification variables, prefixed, for edition attributes, by "ed_" for page attributes, by "pg_", for text attributes, by tx_, therefore named as "ed_attrName", "pg_attrName", "tx_attrName (case sensitive).
2.(optional) mode or formatted string.
Mode |
Meaning |
d |
number |
u |
uppercase Roman number |
l |
lowercase Roman number |
(string) |
it is understood as an indexed list where the first character is the delimiter between elements. See Examples. |
Tag Effects
Effects are visible in the WYSIWYG pane of the Articles main tab or on a page on the Pages main tab. However, because this tag may change the way how the text lines are justified, its effect is indirectly visible in the source pane of the Articles or Pages main tab.
The type and scope
Can be inserted anywhere in text. Local for the paragraph where is inserted, therefore effects cease on the end of that paragraph. Cannot be globalized.
Remarks
The display of dates is not sensitive on the Control Panel date settings.
Display page numbers •To display the current page number, type: >writei PageNum< Note: in an unlinked text, it returns number 1. •To format the page number as Section number, arriving from the Beacon plan, type: >writei pg_externalSectionNumber< •To format the page number as Printable number, arriving from the Beacon plan, type: >writei pg_externalPrintableNumber< The value read from the XML Beacon file can be seen in the page properties within an edition. •To format the page number as ordinal, type: >writei PageNum, ' 1st 2nd 3rd 4th 5th 6th 7th 8th 9th 10th'< •To format the page number as text, type: >writei PageNum, ' One Two Three Four Five Six Seven Eight Nine Ten'< Note: the last two examples above with numbers, expressed as names are suitable only for results in range 1-10. To support a wider range, add more names to the string, e.g. add 11th, or Eleven and so on. As you can see, if the second parameters is specified in >writei...< command, this parameter represents a position-based map of delimited strings against numeric values returned by writei functions. E.g.; >writei PageNum< always returns number, but you can force it to return the name of instead of the number, by specifying the string in which the number's name is on the first position after the delimiter (the delimiter is the space and it is always the first character of such string); therefore, if >writei PageNum< returns number '3' and if '3rd' is the third label in the string, then '3rd' is returned instead of number. •To display the current page number increased by 1, type: >writei PageNum+1< •To display the number of the page from where the text is flowing, type: >writei PrevPageNum< Note: in an unlinked text, it returns number 0. •To display the number of the page where the text is flowing, type: >writei NextPageNum< Note: in an unlinked text, it returns number 0. Displaying years •To display the current year, type: >writei Year< •To display the current year in uppercase roman numbers, type: >writei Year,u< The result is: MM. •To display the specified number as lowercase roman numbers, type: >writei 1999,l< The result is: mcmxcix Displaying dates •To display the current date in format day-month-year, type: >writei Day<->writei Month<->writei Year< The result is: 13-2-2000 (on February, 13 of 2000). •To display the current date in format day-month-year, with the month in roman numerals, type: >writei Day<->writei Month,u<->writei Year< The result is: 13-II-2000 (on February, 13 of 2000). •To display the edition date in format day-month-year, type: >writei EDay<->writei EMonth<->writei EYear< The result is: 13-2-2000 (for the edition date of February, 13 of 2000). •To add the leading zero to the day, type: >writei EDay,',01,02,03,04,05,06,07,08.09,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31'< •To add the weekday to the edition day, type: >writei EWeekDay,',Mon,Tue,Wed,Thu,Fri,Sat,Sun'<,>writei EDay< The result is: Sun,13 (for the edition date of February, 13 of 2000). Displaying numbers as text •To display a number as text, type: >writei 2,' Mon Tue Wed Thu Fri Sat Sun'< The result is: Tue •To display a day of week as text, type: >writei WeekDay,' Mon Tue Wed Thu Fri Sat Sun'< •To display a edition day of week as text, type: >writei EWeekDay,' Mon Tue Wed Thu Fri Sat Sun'< •To display a number as text, when it's necessary to subtract an offset from the supplied number, type: >writei 9,',,,,,,,,Mon,Tue,Wed,Thu,Fri,Sat,Sun'< The result is: Tue Note: this is useful when dealing with Id numbers, which all have a typical offset, therefore, the first member is not id=1 as you may expect, but id=2 or id=6 and so on. >writei ENumberId, ',,,,,,,1st,2nd,3rd,4th,5th,6th,7th,8th,9th,10th'< 1st (if the Id of the current edition number is 7) This can be used to vary the names for edition numbers in styles, refering to Id's in EditionNumberTable rather than to names. Since the Id of the first edition is always different than 1 ('1' is reserved), the additional shifting is applied. To shorten the string and to allow to skip initial Ids (2nd example), the comma delimiter is used instead of space. |