Discussion:
Compound punctuation with active quote mark
Andreï | Андрей Викторович
2014-08-16 19:12:03 UTC
Permalink
Dear sirs,

WinEdt has been getting better and better, but one feature is still missing
so far. It is related to the quote mark (") as an active symbol in some
languages provided by the babel package.

By default, WinEdt highlights paired delimiters and highlights it with red
if no matching pair is found. However, it is not necessarily a quote mark
per se: it is also used as a part of Cyrillic dash ("---), Cyrillic hyphen
allowing breaks ("=) etc. The complete list of combinations can be found in
macros/latex/contrib/babel-contrib/russian/russianb.pdf in Section 3.1.
“Active character”. Can we somehow teach WinEdt to treat compound
punctuation marks as a whole? Or does such feature have to be written by
WinEdt Team?

If it has to be written from scratch, then I have a suggestion for checking
the need for such a feature: if \\usepackage\[.*russian.*\]\{babel\} regex
(perl style) is matched, then toggle special treatment of dumb quote marks.

What are your thoughts?
--
Yours sincerely, | С уважеМОеЌ,
Andreï V. Kostyrka. | АМЎрей ВОктПрПвОч КПстырка.
http://kostyrka.ru, http://kostyrka.ru/blog
WinEdt Team
2014-09-11 20:07:40 UTC
Permalink
Andreï,
Post by Andreï | Андрей Викторович
WinEdt has been getting better and better, but one feature is still
missing so far. It is related to the quote mark (") as an active
symbol in some languages provided by the babel package.
By default, WinEdt highlights paired delimiters and highlights it
with red if no matching pair is found. However, it is not
necessarily a quote mark per se: it is also used as a part of
Cyrillic dash ("---), Cyrillic hyphen allowing breaks ("=) etc. The
complete list of combinations can be found in
macros/latex/contrib/babel-contrib/russian/russianb.pdf in Section
3.1. “Active character”. Can we somehow teach WinEdt to treat
compound punctuation marks as a whole? Or does such feature have to
be written by WinEdt Team?
If it has to be written from scratch, then I have a suggestion for
checking the need for such a feature: if
\\usepackage\[.*russian.*\]\{babel\} regex (perl style) is matched,
then toggle special treatment of dumb quote marks.
What are your thoughts?
Your suggestion can already be implemented in all recent versions
of WinEdt by modifying some settings.

In Delimiters.ini modify the filter for "..." to

MODE_FILTER="*|TeX:RU" // not for TeX:RU

like this:

DELIMITER=""" """
LEFT=""""
RIGHT=""""
ENABLED=1
MODE_FILTER="*|TeX:RU"
APPLY_LINE_LIMIT=1
LINE_LIMIT=99
CASE_SENSITIVE=1
PLAIN=1
CONTROL=0
DOUBLE=0
SINGLE=1
IGNORE=0

Now this symbol will no longer be treated as a delimiter in
documents that are opened in TeX:RU mode.

In Event Handlers (Advanced Section of the Options Interface) open
the file Get Mode (Before). There you will find:

// ==================================================================
// Determine Language Submodes from babel:
// \usepackage[french,german,italian,spanish]{babel}

FindInString("%!0", !"<\\usepackage\[\(*\)\]\{babel\}",2,2,0011);
IfOK(!"LetReg(1,'%#0');",!"JMP(!'UTF');");

FindInString('%!1', !'french', 2,3);
IfOK(!"SetFileMode(!'FR',1,1);");
FindInString('%!1', !'german', 2,3);
IfOK(!"SetFileMode(!'DE',1,1);");
FindInString('%!1', !'italian', 2,3);
IfOK(!"SetFileMode(!'IT',1,1);");
FindInString('%!1', !'spanish', 2,3);
IfOK(!"SetFileMode(!'ES',1,1);");
// add more (or remove some) language modes if required ...

Add russian and RU to make it detect RU submode from babel.
Defaults do not do it for Russian but it is easy to add two lines
(WinEdt-style regex with tag is already there).

Now " will no longer be treated as a delimiter in TeX:RU documents
and RU submode will be automatically appended if you are using bael
with Russian language...

Best regards,

alex

Continue reading on narkive:
Loading...