* lib/encodings:

- add new encoding utf8-plain for the sake of XeTeX users (bug 3526)
* src/BufferParams.cpp:
	- implement new encoding (skip inputenc)
	- fix logic error with thailatex

* src/Buffer.cpp:
* lib/lyx2lyx/LyX.py:
* lib/lyx2lyx/lyx_1_5.pyx:
* development/FORMAT:
	- format increment to 267
	- reset encoding to utf8 on reversion.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18198 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jürgen Spitzmüller 2007-05-04 12:27:00 +00:00
parent ce3fce19c4
commit ced73c33e6
6 changed files with 30 additions and 6 deletions

View File

@ -1,6 +1,10 @@
LyX file-format changes
-----------------------
2007-05-04 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
* format incremented to 267: add plain utf8 encoding (for XeTeX).
2007-04-29 Uwe Stöhr <uwestoehr@web.de>
* format incremented to 266:

View File

@ -16,6 +16,11 @@ End
Encoding utf8x utf8x UTF-8
End
# A plain utf8 encoding that does not use the inputenc package.
# Such an encoding is required for XeTeX.
Encoding utf8-plain utf8-plain UTF-8
End
# This encoding is used to typeset Armenian using the armtex package
Encoding armscii8 armscii8 ARMSCII-8
End

View File

@ -74,7 +74,7 @@ format_relation = [("0_06", [200], generate_minor_versions("0.6" , 4)),
("1_2", [220], generate_minor_versions("1.2" , 4)),
("1_3", [221], generate_minor_versions("1.3" , 7)),
("1_4", range(222,246), generate_minor_versions("1.4" , 4)),
("1_5", range(246,267), generate_minor_versions("1.5" , 0))]
("1_5", range(246,268), generate_minor_versions("1.5" , 0))]
def formats_list():

View File

@ -1198,6 +1198,18 @@ def revert_utf8x(document):
document.inputencoding = get_value(document.header, "\\inputencoding", 0)
def revert_utf8plain(document):
" Set utf8plain encoding to utf8. "
i = find_token(document.header, "\\inputencoding", 0)
if i == -1:
document.header.append("\\inputencoding auto")
else:
inputenc = get_value(document.header, "\\inputencoding", i)
if inputenc == "utf8-plain":
document.header[i] = "\\inputencoding utf8"
document.inputencoding = get_value(document.header, "\\inputencoding", 0)
def convert_changes(document):
" Switch output_changes off if tracking_changes is off. "
i = find_token(document.header, '\\tracking_changes', 0)
@ -1338,9 +1350,11 @@ convert = [[246, []],
[263, [normalize_language_name]],
[264, [convert_cv_textclass]],
[265, [convert_tableborder]],
[266, []]]
[266, []],
[267, []]]
revert = [[265, [revert_armenian]],
revert = [[266, [revert_utf8plain]],
[265, [revert_armenian]],
[264, [revert_tableborder]],
[263, [revert_cv_textclass]],
[262, [revert_language_name]],

View File

@ -141,7 +141,7 @@ using std::string;
namespace {
int const LYX_FORMAT = 266;
int const LYX_FORMAT = 267;
} // namespace anon

View File

@ -898,7 +898,7 @@ bool BufferParams::writeLaTeX(odocstream & os, LaTeXFeatures & features,
// thailatex does not use the inputenc package, but sets up
// babel directly for tis620-0 encoding, therefore we must
// not request inputenc for tis620-0 encoding
if (!encodings.empty() || doc_encoding != "tis620-0") {
if (!encodings.empty() && doc_encoding != "tis620-0") {
os << "\\usepackage[";
std::set<string>::const_iterator it = encodings.begin();
std::set<string>::const_iterator const end = encodings.end();
@ -916,8 +916,9 @@ bool BufferParams::writeLaTeX(odocstream & os, LaTeXFeatures & features,
os << "]{inputenc}\n";
texrow.newline();
}
// utf8-plain is for XeTeX users (inputenc not desired)
} else if (inputenc != "default" && inputenc != "tis620-0" &&
inputenc != "ascii") {
inputenc != "ascii" && inputenc != "utf8-plain") {
os << "\\usepackage[" << from_ascii(inputenc)
<< "]{inputenc}\n";
texrow.newline();