Commit Graph

165 Commits

Author SHA1 Message Date
Juergen Spitzmueller
09b2e337f7 Make textcommabelow feature conditional on encoding 2018-05-05 15:43:54 +02:00
Günter Milde
fa35f552cd Drop "force" from replacements for letters with comma-below accent. 2018-05-04 15:29:12 +02:00
Juergen Spitzmueller
b68bbe8c2e 0x2dd is not covered by utf8 inputenc yet (TL 2018) 2018-04-30 14:50:19 +02:00
Juergen Spitzmueller
0b2fae66e3 unicodesymbols: add general way to require a feature only for specific encodings
A feature can now be required only for specific input or font encodings:
- <feature>=enc1;enc2...  Require the feature <feature> only if the
                          character is used in one if the specified font
                          or input encodings.
- <feature>!=enc1;enc2... Require the feature <feature> only if the
                          character is used in a font or input encoding
                          that is not among the specified.
2018-04-28 13:31:29 +02:00
Juergen Spitzmueller
02d37932d0 \textcyr -> \textcyrillic
Use the command as defined by Babel. This allows us to use the (more
advanced) Babel command if provided instead of rolling our own.

I add a dummy file format change in case it turns out we need to
do something here for old documents (e.g. with user preamble definitions)
2018-04-21 16:28:15 +02:00
Günter Milde
ed3f6801bd Remove spurious no-break space. 2018-01-31 11:01:11 +01:00
Günter Milde
0d9708ef04 Use LaTeX macros instead of Latin transcription for Greek characters.
Use the LaTeX internal character representation (LICR) macros
provided by lgrenc.def (since version 0.8 from 2013-05-13)
in lib/unicodesymbols. This fixes the PDF bookmarks (except for the
legacy input encoding iso-8859-7) and solves the problem of a missing
"v" character in Libertine LGR fonts (see lyx-users from 2018-01-29).

The ctest unicodesymbols/008-greek-and-coptic_iso8859-7_pdf2" now fails
(due to #9681). This is not a regression, as it is already
"unreliable" (wrong output, Latin character instead of Greek).

Drop compatibility definition of \~ as perispomeni accent
(that was required with lgrenc.def < 0.8).
2018-01-30 22:31:08 +01:00
Günter Milde
24021a425e Force "textdegree" for encoding koi8-u. 2017-05-01 10:35:20 +02:00
Günter Milde
58a4cd3082 Remove workaround for bug in TeXLive2005. 2017-04-25 18:45:51 +02:00
Günter Milde
7b5de36a75 Use xfrac package for "fraction characters".
The xfrac package is the "state of the art" for "split-level" (nice) fractions.
Character replacements look consistent, scale properly and fit in the line.

Fixes #5220.
2016-12-18 23:42:15 +01:00
Günter Milde
15fd79201e lib/unicodesymbols tests and fixes.
Test unicodesymbols for most supported input encodings with Kornel's addition to ctests.

Add required "forces" to unicodesymbols:
* utf8x does not support all characters supported by LyX
* several 8-bit encodings map characters to math-mode commands - force replacement in text-mode so that LyX can wrap them in \\ensuremath.

Fix a misalignment (wrong replacements) in the Cyrillic Unicode block.

Use \\mathscr for Mathematical Script characters in Mathematical Alphanumeric Characters (in line with the characters in other unicode blocks.
2016-11-15 23:50:41 +01:00
Günter Milde
1805b41564 Fallback definitions for unicode paragraph/line break.
Convert characters 0x2028  LINE SEPARATOR and
0x2029 PARAGRAPH SEPARATOR to LaTeX equivalent.
(Just in case they slipped somehow into the source.)
2016-11-10 12:45:27 +01:00
Günter Milde
6674a91573 lib/unicodesymbols test update and fixes.
First run of Kornels patch for tests with all input encodings in lib/encodings.

Remove redundant sample files - keep only one sample and change the input encoding in the test script.

Put remaining failing test in "unreliableTests" for later sorting...
2016-11-09 21:15:14 +01:00
Günter Milde
6ff89c4b95 Do not convert \\\\textbackslash to 0x29f5.
Do not use REVERSE SOLIDUS OPERATOR for backwards conversion of
\\\\textbackslash in LyX and tex2lyx.

Both, \\\\ (005C REVERSE SOLIDUS = backslash) and 0x29f5 map to
\\\\textbackslash but 005c is the preferred back-transformation.

Otherwise, using \\\\ in "mathematical text" leads to literal 0x29f5 in the LyX
source which leads to "missing character" errors with non-TeX fonts.
2016-10-17 09:04:56 +02:00
Günter Milde
9c0f829d12 lib/unicodesymbols fixes and tests
Unicode blocks 125, 152, and 246
2016-10-11 00:38:17 +02:00
Günter Milde
52fbe6ea26 lib/unicodesymbols: fix test sample
The package "dictsym"provides symbols for maps and dictionaries.
Should it be used in unicodefonts or is it "too exotic"?
2016-10-08 22:48:13 +02:00
Günter Milde
efa844702c unicodesymbols fixes.
force=utf8 is required for most characters provided by add-on packgages
and (almost) all mathematical characters, because these are not
set up for inputencs utf8

unicodesymbols.py failed here (python 2.7 under Linux) before the simple fix
included in this commit.
2016-10-08 16:57:52 +02:00
Günter Milde
30c9c8e81a lib/unicodesymbols tests: add comments and remove spurious test samples. 2016-09-22 12:10:39 +02:00
Günter Milde
559c895130 lib/unicodesymbols: tests and fixes, Blocks 87 - 91
Also add more "stmaryrd" symbols.
2016-09-20 08:16:39 +02:00
Günter Milde
e82e48c44d lib/unicodesymbols: replace TABs. 2016-09-20 08:16:21 +02:00
Günter Milde
5156416279 lib/unicodesymbols tests and fixes: Block Dingbats. 2016-09-18 17:08:56 +02:00
Günter Milde
f957d32ed3 lib/unicodesymbols tests and fixes: Block Miscellaneous Symbols.
* add \Coffeecup and \Wheelchair

* add "force=utf8" where required

* uninvert tests: ctest works again after Kornel fixed the problem in 9f1b80a2af
2016-09-16 12:10:48 +02:00
Günter Milde
c79b7c1496 lib/unicodesymbols tests and fixes.
Blocks Box Drawing, Block Elements, Geometric Shapes.
2016-09-14 22:06:11 +02:00
Günter Milde
e08a372927 lib/unicodesymbols tests and fixes
* Test blocks Mathematical Symbols, Miscellaneous Technical, Control Pictures
* fix Fahrenheit symbol
* add force=utf8 where required
2016-09-13 22:08:24 +02:00
Günter Milde
e62d20fc01 lib/unicodesymbols fixes
"vdots" fails in text mode, if "mathdots" is loaded.

package "ascii": remove invalid command "\\ascii", let LyX terminate commands
2016-09-12 11:46:30 +02:00
Günter Milde
754cb3d18a Test and fix lib/unicodesymbols for Letterlike Symbols, Number Forms and Arrows blocks. 2016-09-10 22:43:57 +02:00
Günter Milde
99310b7e3f Fix export of Unicode characters (Unicode blocks <=72)
Fix problems revealed by hand-compiling an examining the test samples in autotests/export/Unicode-characters/:

* new definitions
* fixed definitions
* "force=utf8" when required
* some IPA symbols fail without the "extraipa" package
* fix direction of "textcommaaboveright"
2016-09-10 12:35:51 +02:00
Günter Milde
b9a47dff4e Test and fix lib/unicodesymbols for Latin, Greek, and Cyrillic. 2016-09-08 23:22:51 +02:00
Günter Milde
bc72b4602f Math definitions of Greek symbol variants for lib/unicodesymbols
+ test sample for Greek and Coptic Unicode block
2016-09-08 23:22:51 +02:00
Georg Baum
f69d11f97b Add more lib/symbols unicodemapping
There are still many math symbols in lib/symbols that lack a corresponding
entry in lib/unicodesymbols, although a clear mapping exists. This commit
adds some of them (not all yet). In the future we should probably move the
information from both files into one database.
2016-08-27 11:52:31 +02:00
Georg Baum
5b04b91d54 whitespace 2016-07-02 14:52:46 +02:00
Georg Baum
521c0cde3a Add some symbols from fontmath.ltx
These are all in lib/symbols, but we did not yet know the corresponding unicode
numbers. unicodesymbols does still not contain all symbols from lib/symbols.
2016-06-30 22:25:56 +02:00
Georg Baum
4df8117a9d Escape backslashes
The parser that reads unicodesymbols uses backslashes to escape quotes, so
every backslash that is part of a LaTeX command needs to be escaped as well.
There are more candidates in the greek and cyrillic sections, but I don't
know those commands, so I did not touch them.
2016-06-26 20:36:44 +02:00
Georg Baum
f35ed0c168 Improve \AA and \aa tex2lyx import
The lib/unicodesymbols part is based on work by Günter Milde:

Both, \r{A} and \AA (rsp. \r{a} and \aa) are equivalent standard LICR macros
for Aring/aring  as well as the deprecated "angstrom sign" character (212B).

However, with \AA for 212B and \r{A} for 00C5, tex2lyx converts \AA to the
deprecated "angstrom sign" which is missing in many fonts including the
Unicode version of Latin Modern.

I added the normalize_c() calls so that tex2lyx prefers the precomposed forms
(these are better editable in LyX) and the deprecated flag.
2016-01-08 21:06:24 +01:00
Günter Milde
e1a54ebbe4 Force replacement for U2015 (horizontal bar/quotation dash). 2015-12-14 23:53:39 +01:00
Günter Milde
1814739853 Fix #9770 (unicodesymbols for wasysym) 2015-10-28 11:35:25 +01:00
Günter Milde
d0af891eb2 Fix #9764, combining diacritical characters for line below (part 1).
Correct mappings in lib/unicodesymbols (see #9764 for details).
2015-10-19 18:34:48 +02:00
Günter Milde
268bd0075e Add LICR replacement for COMBINING MACRON BELOW. 2015-08-26 22:46:59 +02:00
Günter Milde
00e1936d81 unicodesymbols: "textgreek" must not be used together with "combining".
With the current code, this leads to output like "\\\\textgreek{\\\\~}"
which results in a LaTeX error as the accent macro \\\\~ expects an argument.
2015-08-13 10:55:04 +02:00
Günter Milde
3f6b034167 Fix Ticket #9607 (support comma below accent in unicodesymbols).
LaTeXFeatures defines \textcommabelow and \textcommaabove based on a 
generic \LyXTextAccent and declares TextCompositeCommands for the Baltic 
letters in the T1 font encoding, using \textcommaabove for the small letter g 
and \textcommabelow else.

This allows overwriting of the composite definition for other font encodings. 
Especially, it does not interfere with the polish/baltic font encoding L7x 
(supported by LatinModern and TeXGyre fonts)  that provides pre-composed 
glyphs.
2015-07-12 16:21:25 +02:00
Günter Milde
476a073c61 Greek subsript letters require "textgreek" flag.
Add the "textgreek" feature to entries for greek subscript letters
in "unicodesymbols".
2015-07-11 18:18:28 +02:00
Günter Milde
5a47e4bc70 Fix #9636 textgreek: restore compatibility with lgrenc.def.
Greek characters with perispomeni (tilde) accent were not properly shown
in the output document, because the "textgreek" feature re-defined \~ in
a way incompatible with lgrenc.def since version 0.8  (2013-05-13)
(package greek-fontenc).

The compatibility-definition is required for older versions of the font setup
(before the move of "lgrenc.def" from "babel" to "greek-fontenc").
It is now done with "ProvideTextCommand" to not overwrite the more complete
implementation in lgrenc.def.
With the compatibility definition, combined diacritics with tilde
must be input with the tilde first (e.g. \~>, not \>~).
"unicodesymbols" is changed accordingly.

Also, some LICRs for combining Greek diacritical characters were added to
Unicodesymbols.
2015-07-11 15:39:02 +02:00
Günter Milde
2a7deb802a Remove "notermination" flags from combining characters in "unicodesymbols".
This fixes bug #9615.

The "notermination" flag tells LyX, that terminating an LICR macro with {} is 
not necessary. This is normally the case for all macros with non-alphabetical
name (e.g. \{).

However, combining diacritical characters are converted to *accent macros*,
which expect an argument (the base character). 
In Unicode, the base character precedes the combining character, 
in LaTeX the combining character precedes the base character. 
LyX changes the order of the two characters to get this right,
e.g. "x" + "combining tilde" becomes "\~{x}". 

In the special case there is no preceding character (e.g. at the start of the 
document or a paragraph), Unicode shows the combining diacritical character
without base character.
The replacement is currently not "terminated" (e.g. "\~"), because of the 
"notermination=text" flags in "unicodesymbols". 
The accent macros take the *following* character as base character, which is
clearly not intended.
In case of a paragraph consisting of just one combining diacritical character,
LaTeX compilation fails with an error.

With the patch, LyX writes the accent macros with an empty argument,
e.g.  "\~{}", the output is similar to the view in the GUI with the diacritical 
character on its own, not on the follwoing character.
2015-07-09 11:54:37 +02:00
Georg Baum
f61555cf48 Improve alignment 2015-06-14 14:16:49 +02:00
Juergen Spitzmueller
ca1aea5427 Revert "remove unneeded notermination tags in unicodesymbols (bug #9615)"
This reverts commit a6fdc1196b.

The issue needs more discussion. See #9615.
2015-06-14 13:44:50 +02:00
Georg Baum
0cd7d1f699 Support very much greater/less than
This is bug #9612. The patch is from Günter Milde. He wrote:
The patch uses the "long" macro names (\llless and \gggtr) to minimize
name-clash probability. (There is, e.g., a name clash of \lll with Babel's
polish.ldf (cf. bug #6197))
2015-06-11 20:40:04 +02:00
Juergen Spitzmueller
a6fdc1196b remove unneeded notermination tags in unicodesymbols (bug #9615)
Patch by Guenter Milde
2015-06-11 11:14:01 +02:00
Juergen Spitzmueller
0c8019a903 consistent replacement for CEDILLA in unicodesymbols (bug #9614)
Patch by Guenter Milde
2015-06-11 11:11:26 +02:00
Georg Baum
507cc07c2d Add commented ASCII control pictures
The list was taken by a patch from Jürgen for bug #5704.
2015-05-08 22:00:40 +02:00
Juergen Spitzmueller
23e8db3e5c Fixes and additions to the textcyr macros in unicodesymbols
Patch by Guenter Milde.

See #8600.
2015-01-24 17:29:41 +01:00