[latex3-commits] [git/LaTeX3-latex3-babel] master: Syntax highlight in news-guides. Fix #117. (b8246fd)

Javier email at dante.de
Thu Feb 25 15:40:03 CET 2021


Repository : https://github.com/latex3/babel
On branch  : master
Link       : https://github.com/latex3/babel/commit/b8246fd32ab27a29c84bc1dca37b059dedc76e33

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

commit b8246fd32ab27a29c84bc1dca37b059dedc76e33
Author: Javier <email at localhost>
Date:   Thu Feb 25 15:40:03 2021 +0100

    Syntax highlight in news-guides. Fix #117.


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

b8246fd32ab27a29c84bc1dca37b059dedc76e33
 locale/ro/babel-ro.ini                             |   8 ++++----
 .../guides/non-standard-hyphenation-with-luatex.md |  20 +++++++++-----------
 news-guides/guides/old-and-deprecated-functions.md |   2 +-
 ...ing-babelprovide-to-modify-or-extend-locales.md |  12 ++++++------
 .../guides/which-method-for-which-language.md      |  10 +++++-----
 news-guides/media/babel-top.png                    | Bin 457286 -> 185904 bytes
 news-guides/news/whats-new-in-babel-3.38.md        |   4 ++--
 news-guides/news/whats-new-in-babel-3.41.md        |   2 +-
 news-guides/news/whats-new-in-babel-3.43.md        |   2 +-
 news-guides/news/whats-new-in-babel-3.44.md        |   6 +++---
 news-guides/news/whats-new-in-babel-3.45.md        |   4 ++--
 news-guides/news/whats-new-in-babel-3.46.md        |   4 ++--
 news-guides/news/whats-new-in-babel-3.48.md        |   4 ++--
 news-guides/news/whats-new-in-babel-3.49.md        |   2 +-
 news-guides/news/whats-new-in-babel-3.51.md        |   2 +-
 news-guides/news/whats-new-in-babel-3.52.md        |   2 +-
 news-guides/news/whats-new-in-babel-3.53.md        |   5 ++++-
 news-guides/news/whats-new-in-babel-3.54.md        |   2 +-
 18 files changed, 46 insertions(+), 45 deletions(-)

diff --git a/locale/ro/babel-ro.ini b/locale/ro/babel-ro.ini
index 0215ffc..31970c2 100644
--- a/locale/ro/babel-ro.ini
+++ b/locale/ro/babel-ro.ini
@@ -11,8 +11,8 @@
 
 [identification]
 charset = utf8
-version = 1.2
-date = 2020-06-30
+version = 1.3
+date = 2021-02-25
 name.local = română
 name.english = Romanian
 name.babel = romanian
@@ -38,7 +38,7 @@ appendix = Anexa
 contents = Cuprins
 listfigure = Listă de figuri
 listtable = Listă de tabele
-index = Glosar
+index = Index
 figure = Figura
 table = Tabela
 part = Partea
@@ -61,7 +61,7 @@ appendix = Anexa
 contents = Cuprins
 listfigure = List\u a de figuri
 listtable = List\u a de tabele
-index = Glosar
+index = Index
 figure = Figura
 table = Tabela
 part = Partea
diff --git a/news-guides/guides/non-standard-hyphenation-with-luatex.md b/news-guides/guides/non-standard-hyphenation-with-luatex.md
index fb9e60b..9a61c3a 100644
--- a/news-guides/guides/non-standard-hyphenation-with-luatex.md
+++ b/news-guides/guides/non-standard-hyphenation-with-luatex.md
@@ -3,7 +3,7 @@
 These notes refer to a new feature in babel, in 3.37. With works only with LaTeX using the luatex engine.
 
 Here is a simple example of a declaration:
-```
+```tex
 \babelposthyphenation{ngerman}{ck}{
   { no = c, pre = k- },
   {}
@@ -25,7 +25,7 @@ The items in the replacement list are of four kinds:
 4) With `remove` the node is, well, removed (ie, it's like and empty `string=`).
 
 The pattern is matched with lua empty captures, which are automatically added before and after the string. You may set other empty captures, to reduce the number of items in the replacement list, like
-```
+```tex
 \babelposthyphenation{ngerman}{avery()long()pattern}{
   string = L,
   string = OOO,
@@ -37,7 +37,7 @@ The pattern is matched with lua empty captures, which are automatically added be
 Dots, characters classes (with %) and char-sets (with `[]`, including complementing and ranges) are allowed, too. When using the dot, be aware it matches `|` and `=`, too. A matched `|` or `=` cannot be currently replaced by a string.
 
 Ordinary captures are allowed _inside_ the empty captures (the must resolve to exactly one character). In the pattern, the syntax {n} is a backreference matching the _n_-th capture inside the empty captures. This syntax can be used in the replacement strings, with the corresponding capture:
-```
+```tex
 \babelposthyphenation{ngerman}{([fmtrp]) | {1}}{
   { no = {1}, pre = {1}{1}- },
   remove,
@@ -52,7 +52,7 @@ Ordinary captures are allowed _inside_ the empty captures (the must resolve to e
 Since the percent sign has a quite different meaning in lua and tex, as a convenience the {} syntax can be used to enter character classes in the pattern, too (ie, {d} becomes %d, but note {1} is not the same as %1).
 
 And here is a complete example:
-```
+```tex
 \documentclass{article}
 
 \usepackage[ngerman]{babel}
@@ -78,7 +78,7 @@ Aufführende Aufführendem Aufführenden Aufführender Aufführendes
 ```
 
 In the replacement list, there is an extended syntax which allows to map the captured characters. For example, `{2|ΐΰῒῢ|ίύὶὺ}` means: if the second captured char is ΐ replace it with ί, ύ with ύ, and so on. This feature is particularly useful when a letter changes if there is a hyphen, and also when transliterating. Here is a partial example of the latter (the full example is [here](../news/whats-new-in-babel-3.44.md), with digraphs and trigraphs):
-```
+```tex
 \babelprehyphenation{transrussian}
   {([ABVGDEËZIJKLMNOPRSTUFHÈY"abvgdeëzijklmnoprstufhèy'])}{
   string = {1|ABVGDEËZIJKLMNOPRSTUFHÈY"abvgdeëzijklmnoprstufhèy'%
@@ -89,15 +89,14 @@ In the replacement list, there is an extended syntax which allows to map the cap
 A few further examples:
 
 * In Spanish, if there are one or two vowels between two hyphenation points, the first one takes precedence (in other words, the second one is penalised):
-```
+```tex
 \babelposthyphenation{ngerman}{[aeiouáéíóú]|[aeiouáéíóú][aeiouáéíóú]|}{
   {}, {}, {}, {},
   { pre=-, penalty=1000, data=4 },
 }
 ```
 * In Greek, a diaeresis disappears if the vowel group is broken (see Németh, _TUGboat_ 87):
-```
-
+```tex
 \babelposthyphenation{ngerman}{greek}{α|ΐο}{
   {},
   remove,
@@ -108,8 +107,7 @@ A few further examples:
 In cases like this, you may want to use maps as described above.
 
 * In Dutch, _omaatje_ becomes _oma- tje_:
-```
-
+```tex
 \babelposthyphenation{dutch}{aa|tje}{
   {},
   { no = a , pre= - },
@@ -118,7 +116,7 @@ In cases like this, you may want to use maps as described above.
 }
 ```
 * To duplicate explicit hyphens:
-```
+```tex
 \babelposthyphenation{polish}{.=.}{
   {},
   { no = -, pre = -, post = -, data = 1 },
diff --git a/news-guides/guides/old-and-deprecated-functions.md b/news-guides/guides/old-and-deprecated-functions.md
index 1c17216..745f081 100644
--- a/news-guides/guides/old-and-deprecated-functions.md
+++ b/news-guides/guides/old-and-deprecated-functions.md
@@ -5,7 +5,7 @@
 A couple of tentative macros were provided by `babel` <3.9g with a partial solution for “Unicode” fonts. These macros are now deprecated — use `\babelfont`. A short description follows, for reference:
 * `\babelFSstore{babel-language}` sets the current three   basic families (rm, sf, tt) as the default for the language given.
 * `\babelFSdefault{babel-language}{fontspec-features}` patches `\fontspec` so that the given features are always passed as   the optional argument or added to it (not an ideal solution).
-```
+```tex
 \setmainfont[Language=Turkish]{Minion Pro}
 \babelFSstore{turkish}
 \setmainfont{Minion Pro}
diff --git a/news-guides/guides/using-babelprovide-to-modify-or-extend-locales.md b/news-guides/guides/using-babelprovide-to-modify-or-extend-locales.md
index 14f2a08..0c24eca 100644
--- a/news-guides/guides/using-babelprovide-to-modify-or-extend-locales.md
+++ b/news-guides/guides/using-babelprovide-to-modify-or-extend-locales.md
@@ -3,21 +3,21 @@
 As explained in the manual, `\babelprovide` is an all-purpose command to both define a new language and modify an existing language. This article provides examples on how to modify a language loaded as a package option.
 
 **All the examples assume:**
-```
+```tex
 \usepackage[english]{babel}
 ```
 
 ### Changing the hyphenation rules
 
 Because there are several criteria, or you must follow and editorial style. The following example just uses the default Spanish rules in English
-```
+```tex
 \babelprovide[hyphenrules=spanish]{english}
 ```
 
 ### Native digits
 
 The required ones are already defined in the corresponding `ini` files, but they can be modified and even added as shown:
-```
+```tex
 \babelprovide[numbers/digits.native=abcdefghij]{english}
 ```
 This example is somewhat absurd, but now `\englishdigits{264}` will print `cge`. ⚠ It doesn't work with `pdftex` yet, only `xetex` and `luatex`.
@@ -25,14 +25,14 @@ This example is somewhat absurd, but now `\englishdigits{264}` will print `cge`.
 ### Dates
 
 Currently they can be changed only with imported data:
-```
+```tex
 \babelprovide[import, date.gregorian/date.long = {[d] ([MMMM]) [y]}]{english}
 ```
 
 ### Set the hyphen to none
 
 Only with `luatex`:
-```
+```tex
 \babelprovide[typography/prehyphenchar = 0]{english}
 ```
 This setting *may* work with `xetex`, but getting rid of the hyphen char in this engine is not trivial, because you must rely on the font, and not all fonts behave the same, but `babel` 3.46 will do its best.
@@ -40,7 +40,7 @@ This setting *may* work with `xetex`, but getting rid of the hyphen char in this
 ### New counters
 
 You can define new counters freely, and assign them to `\alph`:
-```
+```tex
 \babelprovide[counters/alphabetic = á é í ó ú, % Define a counter named `alphabetic`
               alph = alphabetic                % Assign it to `\alph`
               ]{english}
diff --git a/news-guides/guides/which-method-for-which-language.md b/news-guides/guides/which-method-for-which-language.md
index e193705..24bdbae 100644
--- a/news-guides/guides/which-method-for-which-language.md
+++ b/news-guides/guides/which-method-for-which-language.md
@@ -11,23 +11,23 @@ _Document under development. Only XeTeX and LuaTeX._ (I like to thank Loren Davi
 There are two ways to load a language, which use different definition files. At first this duality may seem inconvenient, but this way the transition to a more modern system where locales can be easily defined and interoperate can be done smoothly.
 
 The first one is:
-```
+```tex
 \usepackage[italian]{babel}
 ```
 It will load the old good Italian language definition file. This procedure is the **preferred one in most languages where an `ldf` exists**, but there are exceptions (for example, Arabic and Hebrew). In general, you should do this for **European languages written in Latin and Cyrillic** scripts, as well as for **Vietnamese**. For **Greek**, it may depend on your needs, and very often both methods will be fine. If you want modern and ancient Greek at the same time, the next one is usually better.
 
 The second method is:
-```
+```tex
 \usepackage[thai, provide=*]{babel}
 ```
 This will load data from an `ini` file. This is usually the correct method for languages written in **non-European scripts**, like Thai, Hindi, Sanskrit, Marathi, Malayalam, Lao, Khemer, Bengali, Gujarati, Telugu, Kannada, Sinhala, Tamil, Amharic, or Burmese. In short **simple CJK** texts, this is also the preferred method, but in more complex ones you should resort to some CKJ framework like luatexja, xeCJK, kotex, and the like.
 
 Some languages may require additional options. Examples are Arabic, Hebrew and Syriac. With LuaTeX:
-``` 
+```tex
 \usepackage[arabic, bidi=basic, provide=*]{babel}
 ```
 With XeTeX:
-``` 
+```tex
 \usepackage[arabic, bidi=bidi-r, provide=*]{babel}
 ```
 
@@ -82,7 +82,7 @@ Some examples follow (well, not yet). Remember there are  [examples here](https:
 ### Arabic
 
 Recommended basic settings for a monolingual Arabic document in `luatex` (please, note your browser might not be rendering correctly the source code):
-```
+```tex
 \documentclass{article}
 
 \usepackage[arabic, provide=*, bidi=basic, layout=counters.tabular]{babel}
diff --git a/news-guides/media/babel-top.png b/news-guides/media/babel-top.png
index 97a0b23..cb12fe4 100644
Binary files a/news-guides/media/babel-top.png and b/news-guides/media/babel-top.png differ
diff --git a/news-guides/news/whats-new-in-babel-3.38.md b/news-guides/news/whats-new-in-babel-3.38.md
index f6e1330..26c64cd 100644
--- a/news-guides/news/whats-new-in-babel-3.38.md
+++ b/news-guides/news/whats-new-in-babel-3.38.md
@@ -11,7 +11,7 @@ currently to line breaking) and fonts can be automatically set based on
 script blocks, without explicit mark up (only `luatex`). A full example
 is:
 
-```
+```tex
 \documentclass{article}
 
 % Load russian and english
@@ -47,6 +47,6 @@ Until now, the information in the `identification` section was stored
 in ‘private’ macros (ie, with `@`s). Now, they are exposed with the
 fully expandable command `\localeinfo`. For example, to get the
 locale code:
-```
+```tex
 \localeinfo{tag.bcp47}
 ```
\ No newline at end of file
diff --git a/news-guides/news/whats-new-in-babel-3.41.md b/news-guides/news/whats-new-in-babel-3.41.md
index 3263015..a4db9c2 100644
--- a/news-guides/news/whats-new-in-babel-3.41.md
+++ b/news-guides/news/whats-new-in-babel-3.41.md
@@ -12,7 +12,7 @@ There are several way to use them (for the availabe styles in each language, see
 * `\localecounter{style}{counter}`. like  `\localecounter{lower}{section}` 
 * In `\babelprovide`, as an argument to the keys `alph` and `Alph`, which redefine what `\alph` and `\Alph` print:
 
-```
+```tex
 \documentclass{article}
 
 \usepackage{babel}
diff --git a/news-guides/news/whats-new-in-babel-3.43.md b/news-guides/news/whats-new-in-babel-3.43.md
index def3d65..f13fac7 100644
--- a/news-guides/news/whats-new-in-babel-3.43.md
+++ b/news-guides/news/whats-new-in-babel-3.43.md
@@ -6,7 +6,7 @@
 
 The most relevant new feature is the [loading on the fly](whats-new-in-babel-3.39.md) based on BCP 47 codes. It must be activated explicitly, because they are meant for special tasks (most document are mainly monolingual). Mapping from BCP 47 codes to locale names are not hardcoded in `babel`. Instead the data is taken from the `ini` files, which means currently about 250 tags are already recognized
 
-```
+```tex
 \documentclass{article}
 
 \usepackage[danish]{babel}
diff --git a/news-guides/news/whats-new-in-babel-3.44.md b/news-guides/news/whats-new-in-babel-3.44.md
index e4e53bc..e1a266d 100644
--- a/news-guides/news/whats-new-in-babel-3.44.md
+++ b/news-guides/news/whats-new-in-babel-3.44.md
@@ -9,7 +9,7 @@
 ## Optional argument for `\foreignlanguage`
 
 By default, neither `\foreignlanguage` nor `otherlanguage*` switch the date or the captions. If for some reason you needed them, you had to write something like `{\selectlanguage{..} ..}`, which is not always the most convenient way. Now, you can write, say:
-```
+```tex
 \foreignlanguage[date]{polish}{\today}
 ```
 In addition, you can switch captions with `captions`. There are plans to add more options and to extend this mechanism to `\selectlanguage`. 
@@ -52,7 +52,7 @@ Performance is still somewhat poor.
 ### Example 1: transliteration
 
 Here is an example of what can be done currently. Consider the following definitions:
-```
+```tex
 \babelprovide[import=ru]{transrussian}
 
 % Note the order is relevant. First 3-letter groups, then 2-letter ones
@@ -99,7 +99,7 @@ we get the following output:
 ### Example 2: combining chars
 
 Currently, `lualatex` doesn't deal with combining chars out of the box. As a result, and depending on the language, chars could not be composed correctly and valid hyphenation points could be discarded. As a workaround, you can use `\babelprehyphenation` in the following way:
-```
+```tex
 \documentclass{article}
 
 \usepackage[spanish]{babel}
diff --git a/news-guides/news/whats-new-in-babel-3.45.md b/news-guides/news/whats-new-in-babel-3.45.md
index 0b32222..8e7e7f7 100644
--- a/news-guides/news/whats-new-in-babel-3.45.md
+++ b/news-guides/news/whats-new-in-babel-3.45.md
@@ -42,7 +42,7 @@ A couple of wrong settings have been fixed: `prehyphenchar` in Hindi was set to
 ## Appendix. Using an external program for dates
 
 An example with Windows and Powershell. Create a file named `hijridate.ps1`:
-```
+```powershell
 $today = [datetime]::Now
 
 $calendar = New-Object System.Globalization.HijriCalendar
@@ -56,7 +56,7 @@ Then:
 PowerShell.exe -WindowStyle hidden ./hijridate.ps1 >today.tex 
 ```
 and a file is generated with something like:
-```
+```tex
 \def\HijriDay{9}
 \def\HijriMonth{10}
 \def\HijriYear{1441}
diff --git a/news-guides/news/whats-new-in-babel-3.46.md b/news-guides/news/whats-new-in-babel-3.46.md
index 227ad22..cc2b4d2 100644
--- a/news-guides/news/whats-new-in-babel-3.46.md
+++ b/news-guides/news/whats-new-in-babel-3.46.md
@@ -3,11 +3,11 @@
 ## More BCP 47
 
 Now, BCP 47 codes may be used to select languages loaded as package or class options, if desired. Because this feature is mainly meant for special uses, it must be explicitly turned on with:
-```
+```tex
 \babeladjust{ bcp47.toname = on }
 ```
 The best place for this feature to be activated is just after loading `babel`, especially if there are some `\babelprovide`. For example, 
-```
+```tex
 \documentclass{book}
 \usepackage[spanish, english]{babel}
 \babeladjust{ bcp47.toname = on }
diff --git a/news-guides/news/whats-new-in-babel-3.48.md b/news-guides/news/whats-new-in-babel-3.48.md
index 88f5d46..e7595cc 100644
--- a/news-guides/news/whats-new-in-babel-3.48.md
+++ b/news-guides/news/whats-new-in-babel-3.48.md
@@ -11,7 +11,7 @@ For the reasons explained [here](../guides/localizing-counters.md), the new feat
 Captions for numbered elements are hardcoded with the counter placed after it, clearly having English and a few other languages in mind. But in Hungarian, for example, the counter comes before, and in CJK languages it can be even surrounded by two strings (第 1 章). Now, keys in the `captions` section ending with `.template` set how the elements are ordered.
 
 For example:
-```
+```ini
 [captions]
 chapter.template = [[prechapter]] [chapter] [[postchapter]]
 prechapter = 第
@@ -28,7 +28,7 @@ The captions allowing this king of templating are `chapter`, `appendix` in `book
 There is a new section in `ini`  files for labels and how counters are used in some contexts.
 
 As a first tool, there is a way to map some standard counters to another ones, with keys ending with `map`, preceded by `arabic`, `roman`, `Roman`, `alph`, `Alph`, `fnsymbol`. For example:
-```
+```ini
 [labels]
 ; Map roman to informal (eg, Japanese 一 二 三 四 etc.):
 roman.map = informal   
diff --git a/news-guides/news/whats-new-in-babel-3.49.md b/news-guides/news/whats-new-in-babel-3.49.md
index 60a85ba..6e630bf 100644
--- a/news-guides/news/whats-new-in-babel-3.49.md
+++ b/news-guides/news/whats-new-in-babel-3.49.md
@@ -9,7 +9,7 @@
 The standard way to set a language in LaTeX is by means of class or package options. Class options can be recognized by packages to act accordingly, and `babel` is not an exception. However, until now `ini` files had to be loaded following a separate mechanism, which was clearly not ideal, because it doesn't set the language as a global option, which may be required in many applications.
 
 Now there is a package option to tell `babel` to load all or some languages passed as options with `\babelprovide` and not from the `ldf` file, with a few typical cases, as for instance:
-```
+```tex
 \documentclass[hindi]{article}
 
 \usepackage[provide=*]{babel}
diff --git a/news-guides/news/whats-new-in-babel-3.51.md b/news-guides/news/whats-new-in-babel-3.51.md
index 6caf15f..edc4cd4 100644
--- a/news-guides/news/whats-new-in-babel-3.51.md
+++ b/news-guides/news/whats-new-in-babel-3.51.md
@@ -5,7 +5,7 @@
 ## Common interface to redefine captions 
 
 The way strings for captions are defined has evolved to overcome some limitations in older versions, and as a result there were several procedures to modify them, depending on the language or how the language is loaded. Now they can be redefined with `\setlocalecaption`, as for instance:
-```
+```tex
 \setlocalecaption{english}{contents}{Table of Contents}
 ```
 
diff --git a/news-guides/news/whats-new-in-babel-3.52.md b/news-guides/news/whats-new-in-babel-3.52.md
index 2a382db..398cdfe 100644
--- a/news-guides/news/whats-new-in-babel-3.52.md
+++ b/news-guides/news/whats-new-in-babel-3.52.md
@@ -13,7 +13,7 @@ The code has been refactored and in many cases there will be a huge speed boost
 ### Penalties
 
 Penalties can be inserted with both `\babelprehyphenation` and `\babelposthyphenation` with the key `penalty`, which can be combined (and usually must be) with `insert` (described below). Since in `\babelprehyphenation` `|` stands for a space, you can prevent, for example, the word «a» from being at the beginning of a line with:
-```
+```tex
 \babelprehyphenation{english}{|a|}{
  {insert, penalty=10000},
  {}, {}, {}}
diff --git a/news-guides/news/whats-new-in-babel-3.53.md b/news-guides/news/whats-new-in-babel-3.53.md
index 0802408..219be76 100644
--- a/news-guides/news/whats-new-in-babel-3.53.md
+++ b/news-guides/news/whats-new-in-babel-3.53.md
@@ -4,7 +4,10 @@
 
 ## Templates in `\setlocalecaption`
 
-`\setlocalecaption` has been extended to recognize the templating mechanism already available in `ini` files for some captions, explained in [What's new in babel 3.48](whats-new-in-babel-3.48.md). It can be used in `ldf` files, too. Usage is simple: ``` \setlocalecaption{japanese}{chapter.template}{[[prechapter]] [chapter] [[postchapter]]} ```
+`\setlocalecaption` has been extended to recognize the templating mechanism already available in `ini` files for some captions, explained in [What's new in babel 3.48](whats-new-in-babel-3.48.md). It can be used in `ldf` files, too. Usage is simple:
+```tex
+\setlocalecaption{japanese}{chapter.template}{[[prechapter]] [chapter] [[postchapter]]}
+```
 
 This new feature is related to issue [#111](https://github.com/latex3/babel/issues/111)
 
diff --git a/news-guides/news/whats-new-in-babel-3.54.md b/news-guides/news/whats-new-in-babel-3.54.md
index 1238a23..0386f7d 100644
--- a/news-guides/news/whats-new-in-babel-3.54.md
+++ b/news-guides/news/whats-new-in-babel-3.54.md
@@ -13,7 +13,7 @@ Graphical elements in bidi texts are particularly problematic because they must
 This version improves the situation and now RTL inside a `\put` in the `picture` environment is correctly detected and properly typeset, at least in typical cases. Requires `pict2e`. There is a minor caveat: the contents of `\put` are parsed twice in order to detect if it contains some RTL text, which means global assignments are executed also twice. This is, however, very infrequent.
 
 Support for `pgfpicture` has been improved and now `\tikz` is recognized, too. Here is an example:
-```
+```tex
 \documentclass{article}
 
 \usepackage[arabic, provide=*, bidi=basic]{babel}





More information about the latex3-commits mailing list.