Operations on text

<length|expr>
(length of a string)

If expr is a string, the length of the string is returned. For instance, <length|Hello> evaluates to 5.

<range|expr|start|end>
(extract a substring)

Return the substring of expr starting at position start and ending at position end (not included). For instance, <range|hottentottententententoonstelling|9|15> evaluates to tenten.

<merge|expr-1||expr-n>
(concatenate strings)

This primitive may be used to concatenate several strings expr-1 until expr-n. For instance, <merge|Hello|World> produces HelloWorld.

<number|number|render-as>
(alternative rendering of numbers)

Renders a number in a specified way. Supported values for render-as are

roman
Lower case Roman: <number|18|roman> ⟶ xviii.
Roman
Upper case Roman: <number|18|Roman> ⟶ XVIII.
alpha
Lower case letters: <number|18|alpha> ⟶ r.
Alpha
Upper case letters: <number|18|Alpha> ⟶ R.

<date>

<date|format>

<date|format|language>
(obtain the current date)

Returns the current date in a specified format (which defaults to a standard language-specific format when empty) and a specified language (which defaults to English). The format is similar to the one used by the Unix date command. For instance, <date> evaluates to “November 5, 2007”, <date||french> to “5 novembre 2007” and <date|%d %B om %k:%M|dutch> to “5 November om 12:20”.

<translate|what|from|into>
(translation of strings)

Returns the translation of a string what of the language from into the language into, using the built-in TeXmacs dictionaries. The languages should be specified in lowercase letters. For instance, <translate|File|english|french> yields “Fichier”.

The list of currently available languages can be checked in the DocumentLanguage menu. The built-in TeXmacs dictionaries can be found in

$TEXMACS_PATH/languages/natural/dic

When attempting to use a non-existing dictionary, the program may quit. For most purposes, it is more convenient to use the localize macro, which converts a string from English into the current language.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".