![]() |
Operations on text | ![]() |
If expr is a string, the length of the string is returned. For instance, <length|Hello> evaluates to 5.
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.
This primitive may be used to concatenate several strings expr-1 until expr-n. For instance, <merge|Hello|World> produces HelloWorld. Inline content (a concat) is converted to a string before being concatenated. The merge primitive may also be used for concatenating tuples, or the bodies of two macros with the same arguments.
Renders a number in a specified way. Supported values for render-as are
Lower case Roman: <number|18|roman> \(\longrightarrow\) xviii.
Upper case Roman: <number|18|Roman> \(\longrightarrow\) XVIII.
Lower case letters: <number|18|alpha> \(\longrightarrow\) r.
Upper case letters: <number|18|Alpha> \(\longrightarrow\) R.
Arabic numbers: <number|18|arabic> \(\longrightarrow\) 18.
Footnotes symbols: <number|2|fnsymbol> \(\longrightarrow\) \({\dagger}\).
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 the current language). The format is similar to the one used by the Unix date command. For instance, <date> evaluates to “November 29, 2026”, <date||french> to “29 novembre 2026” and <date|%d %B om %k:%M|dutch> to “29 november om 2:57”.
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 Document\(\rightarrow\)Language menu. The built-in TeXmacs dictionaries can be found in
$TEXMACS_PATH/langs/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.
Change the case of the letters in content, while preserving its markup. The evaluated mode may be UPCASE (convert all letters to upper case), locase (convert all letters to lower case), Upcase (capitalize the first letter) or first (only keep the first character of a string). For instance, <change-case|hello|UPCASE> yields HELLO.
The find-file primitive searches the file in the directories dir-1 until dir-n and then in the directory of the current document. The find-file-upwards primitive searches the file in the directory of the current document (including its subdirectories) and then in its ancestors; the search goes upwards until a directory whose name is one of stop-1 until stop-n has been searched, and it fails if there is no such ancestor. Both primitives return the name of the file found, relative to the current document when possible, or false if the file could not be found.