mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 01:59:02 +00:00
add pure ASCII encoding for LaTeX export
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17224 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
e04b3303a1
commit
6bf6c8453d
@ -1,6 +1,10 @@
|
||||
LyX file-format changes
|
||||
-----------------------§
|
||||
|
||||
2007-02-16 Georg Baum <Georg.Baum@post.rwth-aachen.de>
|
||||
|
||||
* format incremented to 260: Allow ascii \inputencoding
|
||||
|
||||
2007-02-14 Georg Baum <Georg.Baum@post.rwth-aachen.de>
|
||||
|
||||
* format incremented to 261: \output_changes is now considered
|
||||
|
@ -114,3 +114,7 @@ End
|
||||
|
||||
Encoding pt254 pt254 PT254
|
||||
End
|
||||
|
||||
# Pure 7bit ASCII encoding (partially hardcoded in LyX)
|
||||
Encoding ascii ascii ascii
|
||||
End
|
||||
|
@ -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" , 3)),
|
||||
("1_5", range(246,262), generate_minor_versions("1.5" , 0))]
|
||||
("1_5", range(246,263), generate_minor_versions("1.5" , 0))]
|
||||
|
||||
|
||||
def formats_list():
|
||||
|
@ -1210,6 +1210,18 @@ def convert_changes(document):
|
||||
document.header[j] = "\\output_changes false"
|
||||
|
||||
|
||||
def revert_ascii(document):
|
||||
" Set ascii encoding to auto. "
|
||||
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 == "ascii":
|
||||
document.header[i] = "\\inputencoding auto"
|
||||
document.inputencoding = get_value(document.header, "\\inputencoding", 0)
|
||||
|
||||
|
||||
##
|
||||
# Conversion hub
|
||||
#
|
||||
@ -1230,9 +1242,11 @@ convert = [[246, []],
|
||||
[258, [convert_lyxline]],
|
||||
[259, [convert_accent, normalize_font_whitespace]],
|
||||
[260, []],
|
||||
[261, [convert_changes]]]
|
||||
[261, [convert_changes]],
|
||||
[262, []]]
|
||||
|
||||
revert = [[260, []],
|
||||
revert = [[261, [revert_ascii]],
|
||||
[260, []],
|
||||
[259, [revert_utf8x]],
|
||||
[258, []],
|
||||
[257, []],
|
||||
|
@ -141,7 +141,7 @@ using std::string;
|
||||
|
||||
namespace {
|
||||
|
||||
int const LYX_FORMAT = 261;
|
||||
int const LYX_FORMAT = 262;
|
||||
|
||||
} // namespace anon
|
||||
|
||||
|
@ -876,7 +876,8 @@ bool BufferParams::writeLaTeX(odocstream & os, LaTeXFeatures & features,
|
||||
os << "]{inputenc}\n";
|
||||
texrow.newline();
|
||||
}
|
||||
} else if (inputenc != "default" && inputenc != "tis620-0") {
|
||||
} else if (inputenc != "default" && inputenc != "tis620-0" &&
|
||||
inputenc != "ascii") {
|
||||
os << "\\usepackage[" << from_ascii(inputenc)
|
||||
<< "]{inputenc}\n";
|
||||
texrow.newline();
|
||||
|
@ -211,6 +211,9 @@ CharInfoMap unicodesymbols;
|
||||
Encoding::Encoding(string const & n, string const & l, string const & i)
|
||||
: Name_(n), LatexName_(l), iconvName_(i)
|
||||
{
|
||||
if (n == "ascii")
|
||||
// ASCII can encode 128 code points and nothing else
|
||||
start_encodable_ = 128;
|
||||
if (n == "utf8" || n == "utf8x")
|
||||
// UTF8 can encode all 1<<20 + 1<<16 UCS4 code points
|
||||
start_encodable_ = 0x110000;
|
||||
|
@ -592,6 +592,7 @@ int switchEncoding(odocstream & os, BufferParams const & bparams,
|
||||
// only, but it is the best we can do.
|
||||
if ((bparams.inputenc == "auto" || bparams.inputenc == "default") &&
|
||||
oldEnc.name() != newEnc.name() &&
|
||||
oldEnc.name() != "ascii" && newEnc.name() != "ascii" &&
|
||||
oldEnc.name() != "tis620-0" && newEnc.name() != "tis620-0") {
|
||||
lyxerr[Debug::LATEX] << "Changing LaTeX encoding from "
|
||||
<< oldEnc.name() << " to "
|
||||
|
Loading…
Reference in New Issue
Block a user