mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-09 10:47:57 +00:00
Add paper options when invoking dvipdfm.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_1_6@1409 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
e3bd167f2a
commit
3a7f26a0d3
@ -1,3 +1,7 @@
|
|||||||
|
2001-01-27 Dekel Tsur <dekelts@tau.ac.il>
|
||||||
|
|
||||||
|
* src/converter.C (dvipdfm_options): New method.
|
||||||
|
|
||||||
2001-01-26 Dekel Tsur <dekelts@tau.ac.il>
|
2001-01-26 Dekel Tsur <dekelts@tau.ac.il>
|
||||||
|
|
||||||
* src/mathed/math_parser.C (LexGetArg): Fix crash when loading
|
* src/mathed/math_parser.C (LexGetArg): Fix crash when loading
|
||||||
|
@ -173,7 +173,10 @@ bool Formats::View(Buffer const * buffer, string const & filename,
|
|||||||
if (format_name == "dvi" &&
|
if (format_name == "dvi" &&
|
||||||
!lyxrc.view_dvi_paper_option.empty()) {
|
!lyxrc.view_dvi_paper_option.empty()) {
|
||||||
command += " " + lyxrc.view_dvi_paper_option;
|
command += " " + lyxrc.view_dvi_paper_option;
|
||||||
command += " " + converters.dvi_papersize(buffer);
|
string paper_size = converters.papersize(buffer);
|
||||||
|
if (paper_size == "letter")
|
||||||
|
paper_size = "us";
|
||||||
|
command += " " + paper_size;
|
||||||
if (buffer->params.orientation
|
if (buffer->params.orientation
|
||||||
== BufferParams::ORIENTATION_LANDSCAPE)
|
== BufferParams::ORIENTATION_LANDSCAPE)
|
||||||
command += 'r';
|
command += 'r';
|
||||||
@ -606,6 +609,9 @@ bool Converters::Convert(Buffer const * buffer,
|
|||||||
if (conv.from == "dvi" && conv.to == "ps")
|
if (conv.from == "dvi" && conv.to == "ps")
|
||||||
command = add_options(command,
|
command = add_options(command,
|
||||||
dvips_options(buffer));
|
dvips_options(buffer));
|
||||||
|
else if (conv.from == "dvi" && prefixIs(conv.to, "pdf"))
|
||||||
|
command = add_options(command,
|
||||||
|
dvipdfm_options(buffer));
|
||||||
|
|
||||||
lyxerr << "Calling " << command << endl;
|
lyxerr << "Calling " << command << endl;
|
||||||
if (buffer)
|
if (buffer)
|
||||||
@ -872,7 +878,7 @@ bool Converters::runLaTeX(Buffer const * buffer, string const & command)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
string const Converters::dvi_papersize(Buffer const * buffer)
|
string const Converters::papersize(Buffer const * buffer)
|
||||||
{
|
{
|
||||||
char real_papersize = buffer->params.papersize;
|
char real_papersize = buffer->params.papersize;
|
||||||
if (real_papersize == BufferParams::PAPER_DEFAULT)
|
if (real_papersize == BufferParams::PAPER_DEFAULT)
|
||||||
@ -893,7 +899,7 @@ string const Converters::dvi_papersize(Buffer const * buffer)
|
|||||||
return "legal";
|
return "legal";
|
||||||
case BufferParams::PAPER_USLETTER:
|
case BufferParams::PAPER_USLETTER:
|
||||||
default:
|
default:
|
||||||
return "us";
|
return "letter";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -914,9 +920,7 @@ string const Converters::dvips_options(Buffer const * buffer)
|
|||||||
result += ' ' + buffer->params.paperwidth;
|
result += ' ' + buffer->params.paperwidth;
|
||||||
result += ',' + buffer->params.paperheight;
|
result += ',' + buffer->params.paperheight;
|
||||||
} else {
|
} else {
|
||||||
string paper_option = dvi_papersize(buffer);
|
string paper_option = papersize(buffer);
|
||||||
if (paper_option == "us")
|
|
||||||
paper_option = "letter";
|
|
||||||
if (paper_option != "letter" ||
|
if (paper_option != "letter" ||
|
||||||
buffer->params.orientation != BufferParams::ORIENTATION_LANDSCAPE) {
|
buffer->params.orientation != BufferParams::ORIENTATION_LANDSCAPE) {
|
||||||
// dvips won't accept -t letter -t landscape. In all other
|
// dvips won't accept -t letter -t landscape. In all other
|
||||||
@ -925,11 +929,32 @@ string const Converters::dvips_options(Buffer const * buffer)
|
|||||||
result += ' ' + paper_option;
|
result += ' ' + paper_option;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (buffer->params.orientation == BufferParams::ORIENTATION_LANDSCAPE)
|
if (buffer->params.orientation == BufferParams::ORIENTATION_LANDSCAPE &&
|
||||||
|
buffer->params.papersize2 != BufferParams::VM_PAPER_CUSTOM)
|
||||||
result += ' ' + lyxrc.print_landscape_flag;
|
result += ' ' + lyxrc.print_landscape_flag;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
string const Converters::dvipdfm_options(Buffer const * buffer)
|
||||||
|
{
|
||||||
|
string result;
|
||||||
|
if (!buffer)
|
||||||
|
return result;
|
||||||
|
|
||||||
|
if (buffer->params.papersize2 != BufferParams::VM_PAPER_CUSTOM) {
|
||||||
|
string paper_size = papersize(buffer);
|
||||||
|
if (paper_size != "b5" && paper_size != "foolscap")
|
||||||
|
result = "-p "+ paper_size;
|
||||||
|
|
||||||
|
if (buffer->params.orientation == BufferParams::ORIENTATION_LANDSCAPE)
|
||||||
|
result += " -l";
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
vector<Converters::Vertex> Converters::vertices;
|
vector<Converters::Vertex> Converters::vertices;
|
||||||
|
|
||||||
|
|
||||||
|
@ -215,10 +215,12 @@ public:
|
|||||||
string const & from_file, string const & to_file_base,
|
string const & from_file, string const & to_file_base,
|
||||||
string const & from_format, string const & to_format);
|
string const & from_format, string const & to_format);
|
||||||
///
|
///
|
||||||
string const dvi_papersize(Buffer const * buffer);
|
string const papersize(Buffer const * buffer);
|
||||||
///
|
///
|
||||||
string const dvips_options(Buffer const * buffer);
|
string const dvips_options(Buffer const * buffer);
|
||||||
///
|
///
|
||||||
|
string const dvipdfm_options(Buffer const * buffer);
|
||||||
|
///
|
||||||
void Update(Formats const & formats);
|
void Update(Formats const & formats);
|
||||||
///
|
///
|
||||||
void UpdateLast(Formats const & formats);
|
void UpdateLast(Formats const & formats);
|
||||||
|
Loading…
Reference in New Issue
Block a user