[latex3-commits] [git/LaTeX3-latex3-babel] docs: Option 'attribute' in transforms. (ee5f810)

Javier email at dante.de
Sat Nov 13 09:31:26 CET 2021


Repository : https://github.com/latex3/babel
On branch  : docs
Link       : https://github.com/latex3/babel/commit/ee5f8103c58c2a54b178a52687f0c2291d7ceb4e

>---------------------------------------------------------------

commit ee5f8103c58c2a54b178a52687f0c2291d7ceb4e
Author: Javier <email at localhost>
Date:   Sat Nov 13 09:31:26 2021 +0100

    Option 'attribute' in transforms.


>---------------------------------------------------------------

ee5f8103c58c2a54b178a52687f0c2291d7ceb4e
 docs/news/whats-new-in-babel-3.67.md | 41 ++++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)

diff --git a/docs/news/whats-new-in-babel-3.67.md b/docs/news/whats-new-in-babel-3.67.md
index ddb528e..5f54567 100644
--- a/docs/news/whats-new-in-babel-3.67.md
+++ b/docs/news/whats-new-in-babel-3.67.md
@@ -9,3 +9,44 @@
 Eg, `\IfBabelSelectorTF{other, other*}{..]{..}` is true with
 environments. Mainly for extras.
 
+## Turning on and off transforms
+
+Until now, the only way to turn on or off a feature was by switching
+the language, Now, you can associate a user defined transform to an
+attribute, so that it’s active only when it’s set (currently its
+attribute value is ignored). With this mechanism transforms can be set
+or unset even in the middle of paragraphs, and applied to single
+words.
+
+To define, set and unset the attribute, the LaTeX kernel provides the
+macros `\newattribute`, `\setattribute` and `\unsetattribute`. Here is
+an example of how to use this feature:
+```tex
+\documentclass{article}
+
+\usepackage[english]{babel}
+
+\newattribute{\uppervowels}
+
+\babelprehyphenation[attribute=\uppervowels]{english}
+  { ([aeiou]) }
+  { string = {1|aeiou|AEIOU} }
+
+\begin{document}
+
+A short text. {\setattribute{\uppervowels}{1}Another short text.} A short text.
+
+\end{document}
+```
+This will print ‘A short text. AnOthEr shOrt tExt. A short text.’
+
+The transform is applied when the corresponding attribute is set in all
+nodes to be transformed. The ‘context’ in the pattern, that is, the
+characters outside the group `()..()`, when used, are not taken into
+account.
+
+
+
+
+
+





More information about the latex3-commits mailing list.