support for the ISO C-series paper formats; fileformat change

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34883 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Uwe Stöhr 2010-07-13 01:06:20 +00:00
parent 9be7c2a0ec
commit e2e63b4b1b
7 changed files with 128 additions and 11 deletions

View File

@ -7,6 +7,10 @@ The good example would be 2010-01-10 entry.
-----------------------
2010-07-13 Uwe Stöhr <uwestoehr@web.de>
* Format incremented to 395: support for ISO C-series paper format;
new parameter \papersize cxpaper with (x = 0 - 6)
2010-07-03 Uwe Stöhr <uwestoehr@web.de>
* Format incremented to 394: support for makebox;
new box parameter \use_makebox

View File

@ -1670,6 +1670,18 @@ def revert_pagesizes(document):
del document.header[i]
def revert_DIN_C_pagesizes(document):
i = 0
" Revert DIN C page sizes to default "
i = find_token(document.header, '\\papersize', 0)
if i != -1:
size = document.header[i][11:]
if size == "c0paper" or size == "c1paper" or size == "c2paper" \
or size == "c3paper" or size == "c4paper" or size == "c5paper" \
or size == "c6paper":
del document.header[i]
def convert_html_quotes(document):
" Remove quotes around html_latex_start and html_latex_end "
@ -1984,10 +1996,12 @@ convert = [[346, []],
[391, []],
[392, [convert_beamer_args]],
[393, [convert_optarg]],
[394, []]
[394, []],
[395, []]
]
revert = [[393, [revert_makebox]],
revert = [[394, [revert_DIN_C_pagesizes]],
[393, [revert_makebox]],
[392, [revert_argument]],
[391, [revert_beamer_args]],
[390, [revert_align_decimal, revert_IEEEtran]],

View File

@ -126,7 +126,7 @@ namespace {
// Do not remove the comment below, so we get merge conflict in
// independent branches. Instead add your own.
int const LYX_FORMAT = 394; // uwestoehr: support for \makebox
int const LYX_FORMAT = 395; // uwestoehr: support for ISO C paper size series
typedef map<string, bool> DepClean;
typedef map<docstring, pair<InsetLabel const *, Buffer::References> > RefCache;

View File

@ -74,7 +74,8 @@ static char const * const string_papersize[] = {
"default", "custom", "letterpaper", "legalpaper", "executivepaper",
"a0paper", "a1paper", "a2paper", "a3paper", "a4paper", "a5paper",
"a6paper", "b0paper", "b1paper", "b2paper","b3paper", "b4paper",
"b5paper", "b6paper", "b0j", "b1j", "b2j", "b3j", "b4j", "b5j",
"b5paper", "b6paper", "c0paper", "c1paper", "c2paper", "c3paper",
"c4paper", "c5paper", "c6paper", "b0j", "b1j", "b2j", "b3j", "b4j", "b5j",
"b6j", ""
};
@ -173,13 +174,20 @@ static PaperSizeTranslator initPaperSizeTranslator()
translator.addPair(string_papersize[16], PAPER_B4);
translator.addPair(string_papersize[17], PAPER_B5);
translator.addPair(string_papersize[18], PAPER_B6);
translator.addPair(string_papersize[19], PAPER_JISB0);
translator.addPair(string_papersize[20], PAPER_JISB1);
translator.addPair(string_papersize[21], PAPER_JISB2);
translator.addPair(string_papersize[22], PAPER_JISB3);
translator.addPair(string_papersize[23], PAPER_JISB4);
translator.addPair(string_papersize[24], PAPER_JISB5);
translator.addPair(string_papersize[25], PAPER_JISB6);
translator.addPair(string_papersize[19], PAPER_C0);
translator.addPair(string_papersize[20], PAPER_C1);
translator.addPair(string_papersize[21], PAPER_C2);
translator.addPair(string_papersize[22], PAPER_C3);
translator.addPair(string_papersize[23], PAPER_C4);
translator.addPair(string_papersize[24], PAPER_C5);
translator.addPair(string_papersize[25], PAPER_C6);
translator.addPair(string_papersize[26], PAPER_JISB0);
translator.addPair(string_papersize[27], PAPER_JISB1);
translator.addPair(string_papersize[28], PAPER_JISB2);
translator.addPair(string_papersize[29], PAPER_JISB3);
translator.addPair(string_papersize[30], PAPER_JISB4);
translator.addPair(string_papersize[31], PAPER_JISB5);
translator.addPair(string_papersize[32], PAPER_JISB6);
return translator;
}
@ -1230,6 +1238,13 @@ bool BufferParams::writeLaTeX(odocstream & os, LaTeXFeatures & features,
case PAPER_B3:
case PAPER_B4:
case PAPER_B6:
case PAPER_C0:
case PAPER_C1:
case PAPER_C2:
case PAPER_C3:
case PAPER_C4:
case PAPER_C5:
case PAPER_C6:
case PAPER_JISB0:
case PAPER_JISB1:
case PAPER_JISB2:
@ -1480,6 +1495,27 @@ bool BufferParams::writeLaTeX(odocstream & os, LaTeXFeatures & features,
case PAPER_B6:
ods << ",b6paper";
break;
case PAPER_C0:
ods << ",c0paper";
break;
case PAPER_C1:
ods << ",c1paper";
break;
case PAPER_C2:
ods << ",c2paper";
break;
case PAPER_C3:
ods << ",c3paper";
break;
case PAPER_C4:
ods << ",c4paper";
break;
case PAPER_C5:
ods << ",c5paper";
break;
case PAPER_C6:
ods << ",c6paper";
break;
case PAPER_JISB0:
ods << ",b0j";
break;
@ -1536,6 +1572,13 @@ bool BufferParams::writeLaTeX(odocstream & os, LaTeXFeatures & features,
case PAPER_B3:
case PAPER_B4:
case PAPER_B6:
case PAPER_C0:
case PAPER_C1:
case PAPER_C2:
case PAPER_C3:
case PAPER_C4:
case PAPER_C5:
case PAPER_C6:
case PAPER_JISB0:
case PAPER_JISB1:
case PAPER_JISB2:
@ -2235,6 +2278,34 @@ string BufferParams::paperSizeName(PapersizePurpose purpose) const
if (purpose == DVIPS || purpose == DVIPDFM)
return string();
return "b6";
case PAPER_C0:
if (purpose == DVIPS || purpose == DVIPDFM)
return string();
return "c0";
case PAPER_C1:
if (purpose == DVIPS || purpose == DVIPDFM)
return string();
return "c1";
case PAPER_C2:
if (purpose == DVIPS || purpose == DVIPDFM)
return string();
return "c2";
case PAPER_C3:
if (purpose == DVIPS || purpose == DVIPDFM)
return string();
return "c3";
case PAPER_C4:
if (purpose == DVIPS || purpose == DVIPDFM)
return string();
return "c4";
case PAPER_C5:
if (purpose == DVIPS || purpose == DVIPDFM)
return string();
return "c5";
case PAPER_C6:
if (purpose == DVIPS || purpose == DVIPDFM)
return string();
return "c6";
case PAPER_JISB0:
if (purpose == DVIPS || purpose == DVIPDFM)
return string();

View File

@ -1437,6 +1437,13 @@ void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) c
case PAPER_B3:
case PAPER_B4:
case PAPER_B6:
case PAPER_C0:
case PAPER_C1:
case PAPER_C2:
case PAPER_C3:
case PAPER_C4:
case PAPER_C5:
case PAPER_C6:
case PAPER_JISB0:
case PAPER_JISB1:
case PAPER_JISB2:

View File

@ -779,6 +779,13 @@ GuiDocument::GuiDocument(GuiView & lv)
cb->addItem(qt_("B4"));
cb->addItem(qt_("B5"));
cb->addItem(qt_("B6"));
cb->addItem(qt_("C0"));
cb->addItem(qt_("C1"));
cb->addItem(qt_("C2"));
cb->addItem(qt_("C3"));
cb->addItem(qt_("C4"));
cb->addItem(qt_("C5"));
cb->addItem(qt_("C6"));
cb->addItem(qt_("JIS B0"));
cb->addItem(qt_("JIS B1"));
cb->addItem(qt_("JIS B2"));

View File

@ -62,6 +62,20 @@ enum PAPER_SIZE {
///
PAPER_B6,
///
PAPER_C0,
///
PAPER_C1,
///
PAPER_C2,
///
PAPER_C3,
///
PAPER_C4,
///
PAPER_C5,
///
PAPER_C6,
///
PAPER_JISB0,
///
PAPER_JISB1,