Commit Graph

80 Commits

Author SHA1 Message Date
Georg Baum
97bc443584 Fix regression of f2d2b7c
Thanks Scott for finding the relevant change set!
2013-02-28 22:23:23 +01:00
Georg Baum
f2d2b7cc7d Fix some texl2yx accent bugs
This fixes bug #8554 and some recently introduced busg:
- Encodings::fromLaTeXCommand() can now handle all combining characters,
  not only the one letter ones
- The remainder returned from Encodings::fromLaTeXCommand() must never be
  thrown away in tex2lyx, but output as ERT
- No special case for combining diacritical marks needed anymore in parse_text()
- No special cases for accents and IPA combining diacritical marks needed
  anymore in parse_text()
- special tipa short cuts may only be recognized if the tipa package is loaded
- Use requirements returned by Encodings::fromLaTeXCommand() instead of
  hardcoded registering of tipa and tipax
- Get rid of the name2 variable in parse_text(): We must use name, otherwise
  the extra stuff that might have been put into name vanishes
2013-02-24 15:44:16 +01:00
Georg Baum
9f93983b61 Extend unicodesymbols force flag
As suggested by Günter Milde.
2013-02-19 22:19:10 +01:00
Georg Baum
c0395333b2 Fix force flag for multiple encodings
A comma cannot be used as delimiter, since it is already the flag delimiter.
2013-02-17 10:19:58 +01:00
Pavel Sanda
718eeba60f Another attempt at Encoding::any (we don't compile at linux now). 2013-01-25 21:19:10 -08:00
Uwe Stöhr
9e29dc2338 Encoding.cpp: make it compilable again after [2eea1590/lyxgit] 2013-01-25 23:24:26 +01:00
Julien Rioux
2eea1590b1 Separation of the various names for encodings.
Provide functions for translating to the LyX name
of an encoding from either a LaTeX name or an Iconv
name, with the possibility to specify the package.
This is in anticipation of changing to use the LyX
name of the encoding in the .lyx file format and
allowing multiple lib/encodings entries to have
the same LaTeX name (but different packages!).

The tex2lyx parser needs to worry about the iconv
name of the input encoding, so store that instead
of the latex name.
2013-01-22 23:43:18 +01:00
Georg Baum
7c6a6a05a2 Fix bug #5087 as suggested by Jürgen
Now it is possible to force certain commands only for some encodings.
2013-01-13 21:36:41 +01:00
Georg Baum
ee3ce572a0 Fix import of shift-jis and big5 CJK texts.
These encodings were not defined, since they must not be used as document
encodings (the characters {, } and \ may appear in high bytes, and latex
would be confused). However, they are supported by CJK.sty (which uses a
preprocessor to circumvent the limitations of the latex executable). These
encodings are now defined, but used for import in tex2lyx only.
The test case CJK.tex contained fake tests for shift-jis and big5 (the
japanese and chinese characters were entered using the utf8 encoding), and
therefore the wrong interpretation of these encoding looked as if it worked.
The comments about missing iconv support of shift-jis and big5 were wrong as
well (otherwise shift-jis-plain would not work either).
2012-12-30 20:52:50 +01:00
Lars Gullik Bjønnes
6b2232a29c src/*.cpp: reformatting to increase consistency 2012-10-28 17:42:07 +01:00
Juergen Spitzmueller
398b1a450a properly validate unicode-math 2012-09-24 13:56:37 +02:00
Juergen Spitzmueller
8bf5d4b461 Very basic support for unicode-math
With non-TeX fonts, you can select a 'Non-TeX Font Default' math font, which simply loads unicode-math without actually selecting a math font, this then uses the default math otf font, currently Latin Modern. Other fonts still need to be set manually in the preamble, via \setmathfont.

The implementation suppresses unneeded package requests from unicodesymbols, but the output still uses macros instead of full unicode (both is possible with unicode-math).

The whole thing is a proof of concept, and it needs to be tested. I have tested it with the math manual, which compiles and seems to display correctly if I remove some hardcoded package loadings. OTOH I have not much experience with math.

This addresses #7449 partly.
2012-09-24 13:19:25 +02:00
Juergen Spitzmueller
51d591d168 Factor out method to get a properly encoded latex string 2012-06-30 13:30:48 +02:00
Georg Baum
1a6c599917 Extend the notermination flag to math as well.
Math commands need it as well as text commands. At the same time, this
further unifies the checking for termination and fixes cases of wrong
output (e.g. for 0x2005).
2012-03-25 15:57:38 +02:00
Jürgen Spitzmüller
2cf5de28a9 Add "notermination" flag to unicodesymbols. This tells us not to try any termination of the command (such as '{}' or ' ' ).
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40905 a592a061-630c-0410-9148-cb99ea01b6c8
2012-03-10 13:34:42 +00:00
Jürgen Spitzmüller
84971fb27e * implement possibility to use IPA shortcut notation (the actual shortcuts will follow)
* do not terminate macros by {} if not necessary (prevent kerning violation)

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40891 a592a061-630c-0410-9148-cb99ea01b6c8
2012-03-09 09:05:13 +00:00
Jürgen Spitzmüller
163bc119e6 Do not load font packages with encoding "utf8-plain" (bug #7766, #7782).
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40633 a592a061-630c-0410-9148-cb99ea01b6c8
2012-01-20 06:07:12 +00:00
Georg Baum
bb0432d74a Beautify output of \usepckage statements (each statement is on its own line
now) and move more packages to the new exclude mechanism.
The remaining ones are not so easy.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40442 a592a061-630c-0410-9148-cb99ea01b6c8
2011-12-08 20:05:51 +00:00
Georg Baum
6954c542fb Generalize the esintoramsmath requirement:
Now you can also require a|b|c, and if any of the features is already used,
no other one will be loaded. The first feature wins if none is already used.
This is required for a part of bug #7811.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39884 a592a061-630c-0410-9148-cb99ea01b6c8
2011-10-18 19:32:02 +00:00
Richard Heck
d89d60c5a7 Fix bug #7682. Problem was that we were finding the children using the
BufferList, which knows nothing about clones.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39327 a592a061-630c-0410-9148-cb99ea01b6c8
2011-07-16 13:30:17 +00:00
Stephan Witt
c7e6a677c4 fix compiler warnings in pedantic mode: remove trailing comma after last enum member
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36923 a592a061-630c-0410-9148-cb99ea01b6c8
2010-12-17 19:56:51 +00:00
Enrico Forestieri
f5cc73f583 Avoid unnecessary exceptions.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33516 a592a061-630c-0410-9148-cb99ea01b6c8
2010-02-19 16:31:15 +00:00
Jean-Marc Lasgouttes
18b808e67c add "ansinew" as a synonym of LaTeX encoding "cp1252" (second part of #6142)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31439 a592a061-630c-0410-9148-cb99ea01b6c8
2009-09-22 13:05:43 +00:00
Enrico Forestieri
411b7a1dec Fix display of BibTeX entries in the info field of the citation
dialog by only converting text mode latex macros to unicode points.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30070 a592a061-630c-0410-9148-cb99ea01b6c8
2009-06-12 14:03:57 +00:00
Enrico Forestieri
3175a28893 Fix bug 5836 (http://bugzilla.lyx.org/show_bug.cgi?id=5836)
Cyrillic formatted text in mathmode

If some other letters from some script need to be typeset in italic,
it will suffice adding the flag "mathalpha" to the unicodesymbols file.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@28731 a592a061-630c-0410-9148-cb99ea01b6c8
2009-03-09 06:34:00 +00:00
Jean-Marc Lasgouttes
29117ed909 compilation warning: unused parameter
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@28509 a592a061-630c-0410-9148-cb99ea01b6c8
2009-02-16 10:05:40 +00:00
Enrico Forestieri
7728b5cbb9 Fix bug 5665
http://bugzilla.lyx.org/show_bug.cgi?id=5665


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@28058 a592a061-630c-0410-9148-cb99ea01b6c8
2009-01-09 16:09:41 +00:00
Richard Heck
a05cc2c93e Fix minor problem with fromLaTeXCommand(): We were missing things like
\"{U}ber, since \"{U} was followed by a letter.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27987 a592a061-630c-0410-9148-cb99ea01b6c8
2009-01-04 23:26:04 +00:00
Enrico Forestieri
ef65f0e1af Add clarifying comment.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27969 a592a061-630c-0410-9148-cb99ea01b6c8
2008-12-23 12:49:42 +00:00
Enrico Forestieri
98114f5a82 Take into account that '\' is always part of a LaTeX command and also
that entries in the unicodesymbols file may not start with '\'.
Maybe the method should be renamed as fromLaTeXCode?


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27957 a592a061-630c-0410-9148-cb99ea01b6c8
2008-12-23 02:03:53 +00:00
Jean-Marc Lasgouttes
df8bb4edcd * Encoding.cpp (fromLaTeXCommand): fix bug when the string passed
to the method does not match any of the known unicode symbols.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27953 a592a061-630c-0410-9148-cb99ea01b6c8
2008-12-22 15:23:05 +00:00
Jean-Marc Lasgouttes
28f43b1896 Now tex2lyx is able to set the encoding from what it reads in the preamble.
What works:
- parsing of inputenc should work
- \inputencoding is acted on in the preamble

What does not work:
- \inputencoding in the text
- all the corner cases I have not considered, and all buggy stuff in the
  'what works' paragraph
- InsetLatexAccent are still created, but I do not know when they got added
to the code.

The only notable trick in the code is that I had to disable buffering. Otherwise
the whole text was read before I had a chance to change the encoding...

Finally I remove the artificial limitation that forbid
  \usepackage[opt1,opt2]{package1,package2}



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27592 a592a061-630c-0410-9148-cb99ea01b6c8
2008-11-16 21:51:18 +00:00
André Pönitz
f1cba8ff64 more latin1..utf8 schanges. all of src/* should be utf8 now
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27425 a592a061-630c-0410-9148-cb99ea01b6c8
2008-11-14 15:58:50 +00:00
Enrico Forestieri
bcf3db2dd5 Initialize return variable
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27043 a592a061-630c-0410-9148-cb99ea01b6c8
2008-10-23 00:39:13 +00:00
Enrico Forestieri
d7daeb752e If the "force" flag is in effect and a textmode command from the unicodesymbols
file is used, don't add the \lyxmathsym definition to the preamble if we
already are in textmode. This hopefully smashes all weird cases.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26604 a592a061-630c-0410-9148-cb99ea01b6c8
2008-09-28 21:57:31 +00:00
Enrico Forestieri
5ca3be4d67 In mathmode, treat nonascii chars with diacritical marks as an input method
for entering math accents, such that an umlauted A is translated as \ddot{A},
for example.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26577 a592a061-630c-0410-9148-cb99ea01b6c8
2008-09-26 15:53:15 +00:00
Enrico Forestieri
b5dcdbc960 When in mathmode, always use the mathcommand replacement from the
unicodesymbols file. Also take into account that a unicode symbol
may appear in both mathmode and textmode and thus both the mathmode
and textmode features may be required. As a side effect, the problem
that the \lyxmathsym definition is added to the preamble even when
a unicode symbol appears only in textmode is solved.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26548 a592a061-630c-0410-9148-cb99ea01b6c8
2008-09-25 18:38:25 +00:00
Jürgen Spitzmüller
a2906cb877 ** proper implementation of pLaTeX by Tetsuya Makimura and me, fixes many remaining problems and bugs with language "japanese" (bugs 4863, 4290, 4700 and partially 4697) **
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26200 a592a061-630c-0410-9148-cb99ea01b6c8
2008-08-18 17:26:09 +00:00
Enrico Forestieri
0e834b9342 When producing latex output, check whether a character entered in mathed
can be encoded in the current latex encoding before resorting to the
unicodesymbols file.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25725 a592a061-630c-0410-9148-cb99ea01b6c8
2008-07-20 01:50:54 +00:00
Jean-Marc Lasgouttes
81f12d8c85 silence some compiler warnings
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25669 a592a061-630c-0410-9148-cb99ea01b6c8
2008-07-16 15:05:34 +00:00
Jürgen Spitzmüller
dcc4d58b66 *** Implement GUI names for encodings (part of bug 4971) ***
* lib/encodings:
	- add new column "GUI names"

* src/Encoding.{cpp,h}:
	- read in and handle GUI names

* src/frontends/qt4/GuiDocument.cpp:
	- display GUI names instead of LaTeX names

* po/lyx_pot.py:
* po/Rules-lyx:
* development/scons/SConstruct:
	- add encoding GUI names to the po files.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25558 a592a061-630c-0410-9148-cb99ea01b6c8
2008-07-11 08:56:17 +00:00
Jürgen Spitzmüller
8cbc28d880 * src/Encoding.{cpp,h}:
- build an exception list of characters that must be output as LaTeX command in any case
	  (except in utf8-plain). I.e., the utf8 encodings now also honour the "force" flag.
* lib/unicodesymbols:
	- add "force" flag to combine characters. Fixes rest of bug 4946.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25361 a592a061-630c-0410-9148-cb99ea01b6c8
2008-06-23 18:00:43 +00:00
Enrico Forestieri
90837aaf6e Fix bug 1527
http://bugzilla.lyx.org/show_bug.cgi?id=1527

* src/mathed/*.cpp:
	- Track mode (math or text) when outputting latex code and
	  properly wrap commands that are in the wrong mode with
	  either \ensuremath or \lyxmathsym.

* src/mathed/MathParser.cpp:
	- Parse \ensuremath and \lyxmathsym, such that exported latex
	  produces the same result when imported back.
	- Replace latex commands with corresponding unicode symbols.

* src/Encoding.cpp:
	- Implement Encodings::fromLaTeXCommand() for converting either
	  a single or a sequence of latex commands to unicode symbols.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25270 a592a061-630c-0410-9148-cb99ea01b6c8
2008-06-16 01:21:17 +00:00
Enrico Forestieri
1a2af1197e Allow to specify either text mode or math mode commands (or both) in the
unicodesymbols file. When the command for a mode is not specified, the
other one is used (taking care that it also works in the "wrong" mode).
This allows to avoid the \lyxmathsym macro when a native math command
is available. Patch from Georg, modifications to the unicodesymbols
file by me.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25061 a592a061-630c-0410-9148-cb99ea01b6c8
2008-06-02 01:35:42 +00:00
Enrico Forestieri
a694de895e Fix bug 3938
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25028 a592a061-630c-0410-9148-cb99ea01b6c8
2008-05-31 20:54:50 +00:00
André Pönitz
e1453ef687 lexer cosmetics
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24134 a592a061-630c-0410-9148-cb99ea01b6c8
2008-04-05 21:24:57 +00:00
André Pönitz
c88e7a7ef6 simplify Lexer handling a bit more
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24106 a592a061-630c-0410-9148-cb99ea01b6c8
2008-04-03 20:55:09 +00:00
André Pönitz
11a0458d3f next try...
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24100 a592a061-630c-0410-9148-cb99ea01b6c8
2008-04-02 23:06:22 +00:00
André Pönitz
2012beb58e revert last patch. there's something wrong, possibly unrelated to this
patch, but as this was rather largish...


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24099 a592a061-630c-0410-9148-cb99ea01b6c8
2008-04-02 22:44:33 +00:00
André Pönitz
7677e9487c simplify Lexer use a bit
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24098 a592a061-630c-0410-9148-cb99ea01b6c8
2008-04-02 22:14:45 +00:00