Am 03.07.2012 20:22, schrieb Georg Baum:
I tested my commits as best as I could do. I also committed testfiles and
updated existing ones.
The new files cannot be exported by LyX again, so they do not show that
much.
I don't understand. I can import XeTeX-polyglossia.tex and then re-export it. Attached is the
original file and the re-exported file. Diffing them you see that everything is in place and nothing
is lost.
IMO it is absolutely necessary to run regression tests before each
tex2lyx commit, because meanwhile it has reached a complexity that cannot be
tested manually anymore.
You mean automated tests? Currently I check that all our testcases work and they cover almost
everything we support in tex2lyx. I don't know how an automated testing could set up.
If you run the regression tests, you will also see that some of your changes
broke the defaults for math package loading.
I don't see this at a quick look I now had. Could you please give me a ponter to a case or file that
does not work anymore?
It was probably caused by the merged build. It should not happen anymore if
you switch to standard build.
I'll do so.
The other question from my private mail was how to encode strings in
tex2lyx correctly. I tried to fix http://www.lyx.org/trac/ticket/8230.
Could you please have a look or give me a hint how this can be done?
All strings that you get from the parser in tex2lyx are in utf8, thus non-
ascii characters are encoded with 1 to 3 bytes. If you need to check for
single characters that are possibly non-ascii, you need to convert the
string to docstring first. Then the length of the string is equal to the
number of characters, so you can safely calculate indices. If you need to
output the non-ascii characters, do not forget to convert them back to
string (not char!) again.
Ah, I tried to output as char and that failed. I'll try now with strring and
propose a patch.
thanks and regards
Uwe
\documentclass{article}
\usepackage{fontspec}
\setmainfont[Mapping=tex-text]{Linux Libertine O}
\setsansfont[Scale=0.75,Mapping=tex-text]{Linux Biolinum O}
\setmonofont{Linux Biolinum O}
\usepackage{xunicode}
\usepackage{polyglossia}
\setdefaultlanguage[variant=british, ordinalmonthday = false]{english}
\setotherlanguage{albanian}
\setotherlanguage[variant=polytonic]{greek}
\setotherlanguage{syriac}
\begin{document}
\part{df}
1 English \textgreek[variant=ancient]{ancient Greek} English
\textgreek[numerals=arabic, variant=ancient]{ancient G\textsf{reek} with Arabic
numerals} English
\begin{albanian}%
\part{df}
2 Albanian \textgreek{Greek} Albanian \textsc{smallcaps}
\end{albanian}%
\begin{hebrew}%
\part{df}
3 Hebrew
\end{hebrew}%
%empty language paragraph
\begin{albanian}%
\end{albanian}%
\end{document}
%% LyX 2.1.0svn created this file. For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[albanian,greek,hebrew,british]{article}
\usepackage{fontspec}
\setmainfont[Mapping=tex-text]{Linux Libertine O}
\setsansfont[Scale=0.75,Mapping=tex-text]{Linux Biolinum O}
\setmonofont{Linux Biolinum O}
\usepackage{xunicode}
\usepackage{polyglossia}
\setdefaultlanguage[variant=british]{english}
\setotherlanguage{albanian}
\setotherlanguage{greek}
\setotherlanguage{hebrew}
\begin{document}
\part{df}
1 English \textgreek[variant=ancient]{ancient Greek} English
\textgreek[numerals=arabic, variant=ancient]{ancient
G\textsf{reek} with Arabic numerals} English
\begin{albanian}%
\part{df}
2 Albanian \textgreek{Greek} Albanian \textsc{smallcaps}
\end{albanian}%
\begin{hebrew}%
\part{df}
3 Hebrew
%empty language paragraph
\end{hebrew}%
\end{document}