Jean-Marc,

Jean-Marc Lasgouttes wrote:

> Ing> 2 It introduces
> Ing> \view_dvi_paper_option "" also in lyxrc. With this option you can
> Ing> overwrite the papersize that is specified when viewing a dvi
> Ing> file. yap (the MikTeX dvi viewer) doesnt have a paper option at
> Ing> all, so you get an error message when viewing a dvi file. When
> Ing> this option is set to blank, i.e. "", no paper size is specified
> Ing> when yap is called. If this command is not given at all nothing
> Ing> is changed.
>
> I do not understand what the semantics of this command is (are?). What
> is its default value?

# \view_dvi_paper ""
# \view_dvi_paper_option allows to specify a paper option to the dvi viewer.
# By default LyX specifies the paper size of the document to the dvi viewer via
the command line option
# -paper size, where size is one of "us","letter","a3","a4" and so on. The
command \view_dvi_paper_option
# allows the user to overwrite the name of the command line flag, i.e. replace
-paper with something else.
# If specified and left blank, i.e. \view_dvi_paper_option "", LyX does not
append the -paper option to the
# dvi command at all. This case is especially useful when viewing your documents
on Windows with yap,
# because yap does not allow a command line option for the paper size.

>
> Ing> I hope that this can be include in the 1.1.4 release and that I
> Ing> didnt introduce side effects because I had to rearrange the dvi
> Ing> preview method a bit. Let me know it this can go in or if I need
> Ing> to change something.
>
> I'd like to include it too, but it depends on Lars' timing. It would
> be a mistake to apply this one or two days before release (OK, I know,
> you already sent it and I did not answer, sorry).

No problem. I understand, but you shouldn't be so scared of introducing bugs in
a release, as I understand the 1.1.x series is still considered alpha isnt it?
While I realize that noone wants to get into the situation as it was with the
old development branch, I still think you should release as often as possible,
or even switch to a snapshot policy where say a snapshot is released every week
or so. But frankly I dont care because I use cvs anyway.

> You will need to
> send also a short description for lyxrc.example, and example of
> invokation, so that the automatic configure script can try to do some
> magic.

Is above ok for lyxrc.example? Dont know about configure - what do you need. I'd
say inlcude the option in lyxrc.example but leave it uncommented. Then all we
need is a hint on Stevens website and patience on the user list.

Roland



>

>
>
> JMarc
>
> Ing> Roland
>
> Ing> --------------71C85E59F99D511FBDE72691 Content-Type: text/plain;
> Ing> charset=us-ascii; name="lyx_cb.patch.1"
> Ing> Content-Transfer-Encoding: 7bit Content-Disposition: inline;
> Ing> filename="lyx_cb.patch.1"
>
> Ing> Index: lyx-devel/src/lyx_cb.C
> Ing> ===================================================================
> Ing> RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyx_cb.C,v
> Ing> retrieving revision 1.38 diff -u -r1.38 lyx_cb.C ---
> Ing> lyx-devel/src/lyx_cb.C 2000/01/11 01:59:00 1.38 +++
> Ing> lyx-devel/src/lyx_cb.C 2000/01/21 19:10:52 @@ -514,8 +514,20 @@
> Ing> path = buffer->tmppath; } Path p(path); - - cmd = command + ' ' +
> Ing> QuoteName(name); + /* + * At this point we check whether the
> Ing> command contains the filename parameter + * $$FName and if that's
> Ing> the case we substitute the real file name otherwise + * the
> Ing> filename is simply appended. + * rokrau 1/12/00 + */ + cmd =
> Ing> command; + std::string::size_type i; + if (
> Ing> (i=command.find("$$FName")) != std::string::npos) + { +
> Ing> cmd.replace(i,7,QuoteName(name)); + } + else + cmd = command + '
> Ing> ' + QuoteName(name);
>
> Ing>    Systemcalls one;
>
> Ing> @@ -712,59 +724,58 @@ // Who cares? //if (!bv->text) // return
> Ing> false; - - string paper; - - // wrong type - char real_papersize
> Ing> = buffer->params.papersize; - if (real_papersize ==
> Ing> BufferParams::PAPER_DEFAULT) - real_papersize =
> Ing> lyxrc->default_papersize; - - switch (real_papersize) { - case
> Ing> BufferParams::PAPER_USLETTER: - paper = "us"; - break; - case
> Ing> BufferParams::PAPER_A3PAPER: - paper = "a3"; - break; - case
> Ing> BufferParams::PAPER_A4PAPER: - paper = "a4"; - break; - case
> Ing> BufferParams::PAPER_A5PAPER: - paper = "a5"; - break; - case
> Ing> BufferParams::PAPER_B5PAPER: - paper = "b5"; - break; - case
> Ing> BufferParams::PAPER_EXECUTIVEPAPER: - paper = "foolscap"; -
> Ing> break; - case BufferParams::PAPER_LEGALPAPER: - paper = "legal";
> Ing> - break; - default: /* If nothing else fits, keep the empty value
> Ing> */ - break; - } + string paper = lyxrc->view_dvi_paper_option; +
> Ing> if (!paper.empty()) { + // wrong type + char real_papersize =
> Ing> buffer->params.papersize; + if (real_papersize ==
> Ing> BufferParams::PAPER_DEFAULT) + real_papersize =
> Ing> lyxrc->default_papersize;
>
> Ing> - if (paper.empty()) { - if (buffer->params.orientation ==
> Ing> BufferParams::ORIENTATION_LANDSCAPE) - // we HAVE to give a size
> Ing> when the page is in - // landscape, so use USletter. - paper = "
> Ing> -paper usr"; - } else { - paper = " -paper " + paper; - if
> Ing> (buffer->params.orientation ==
> Ing> BufferParams::ORIENTATION_LANDSCAPE) - paper+= 'r'; + switch
> Ing> (real_papersize) { + case BufferParams::PAPER_USLETTER: + paper
> Ing> += " us"; + break; + case BufferParams::PAPER_A3PAPER: + paper +=
> Ing> " a3"; + break; + case BufferParams::PAPER_A4PAPER: + paper += "
> Ing> a4"; + break; + case BufferParams::PAPER_A5PAPER: + paper += "
> Ing> a5"; + break; + case BufferParams::PAPER_B5PAPER: + paper += "
> Ing> b5"; + break; + case BufferParams::PAPER_EXECUTIVEPAPER: + paper
> Ing> += " foolscap"; + break; + case BufferParams::PAPER_LEGALPAPER: +
> Ing> paper += " legal"; + break; + default: /* If nothing else fits,
> Ing> keep the empty value */ + break; + } + if (real_papersize==' ') {
> Ing> + // if (paper.empty()) { + if (buffer->params.orientation ==
> Ing> BufferParams::ORIENTATION_LANDSCAPE) + // we HAVE to give a size
> Ing> when the page is in + // landscape, so use USletter. + paper = "
> Ing> -paper usr"; + } else { + // paper = " -paper " + paper; + if
> Ing> (buffer->params.orientation ==
> Ing> BufferParams::ORIENTATION_LANDSCAPE) + paper+= 'r'; + } } - //
> Ing> push directorypath, if necessary - string path =
> Ing> OnlyPath(buffer->fileName()); - if (lyxrc->use_tempdir ||
> Ing> (IsDirWriteable(path) < 1)){ + string path =
> Ing> OnlyPath(buffer->fileName()); + if (lyxrc->use_tempdir ||
> Ing> (IsDirWriteable(path) < 1)) { path = buffer->tmppath; - } - Path
> Ing> p(path); + } + Path p(path); // Run dvi-viewer - string command =
> Ing> lyxrc->view_dvi_command + paper ; + string command =
> Ing> lyxrc->view_dvi_command + " " + paper; bool ret =
> Ing> RunScript(buffer, false, command); return ret; } Index:
> Ing> lyx-devel/src/lyxrc.C
> Ing> ===================================================================
> Ing> RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyxrc.C,v
> Ing> retrieving revision 1.15 diff -u -r1.15 lyxrc.C ---
> Ing> lyx-devel/src/lyxrc.C 2000/01/13 16:28:53 1.15 +++
> Ing> lyx-devel/src/lyxrc.C 2000/01/21 19:10:58 @@ -107,6 +107,7 @@
> Ing> RC_NUMLASTFILES, RC_CHECKLASTFILES, RC_VIEWDVI_COMMAND, +
> Ing> RC_VIEWDVI_PAPEROPTION, RC_DEFAULT_PAPERSIZE, RC_PS_COMMAND,
> Ing> RC_VIEWPS_COMMAND, @@ -224,6 +225,7 @@ {
> Ing> "\\use_personal_dictionary", RC_USE_PERS_DICT }, {
> Ing> "\\use_tempdir", RC_USETEMPDIR }, { "\\view_dvi_command",
> Ing> RC_VIEWDVI_COMMAND }, + { "\\view_dvi_paper_option",
> Ing> RC_VIEWDVI_PAPEROPTION }, { "\\view_pdf_command",
> Ing> RC_VIEWPDF_COMMAND }, { "\\view_ps_command", RC_VIEWPS_COMMAND },
> Ing> { "\\view_pspic_command", RC_VIEWPSPIC_COMMAND } @@ -277,6 +279,7
> Ing> @@ view_ps_command = "ghostview -swap"; view_pspic_command =
> Ing> "ghostview"; view_dvi_command = "xdvi"; + view_dvi_paper_option =
> Ing> "-paper"; view_pdf_command = "xpdf"; default_papersize =
> Ing> BufferParams::PAPER_USLETTER; custom_export_format = "ps"; @@
> Ing> -608,6 +611,13 @@ view_dvi_command = lexrc.GetString(); break;
>
> Ing> + case RC_VIEWDVI_PAPEROPTION: + if (lexrc.next()) +
> Ing> view_dvi_paper_option = lexrc.GetString(); + else +
> Ing> view_dvi_paper_option = ""; + break; + case RC_VIEWPDF_COMMAND:
> Ing> if (lexrc.next()) view_pdf_command = lexrc.GetString(); @@
> Ing> -1072,6 +1082,8 @@ << "\n"; case RC_VIEWDVI_COMMAND: os <<
> Ing> "\\view_dvi_command \"" << view_dvi_command << "\"\n"; + case
> Ing> RC_VIEWDVI_PAPEROPTION: + os << "\\view_dvi_paper_option \"" <<
> Ing> view_dvi_paper_option << "\"\n"; case RC_VIEWPDF_COMMAND: os <<
> Ing> "\\view_pdf_command \"" << view_pdf_command << "\"\n"; case
> Ing> RC_DEFAULT_PAPERSIZE: Index: lyx-devel/src/lyxrc.h
> Ing> ===================================================================
> Ing> RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyxrc.h,v
> Ing> retrieving revision 1.9 diff -u -r1.9 lyxrc.h ---
> Ing> lyx-devel/src/lyxrc.h 2000/01/11 01:59:00 1.9 +++
> Ing> lyx-devel/src/lyxrc.h 2000/01/21 19:10:58 @@ -105,6 +105,8 @@
> Ing> string view_pspic_command; /// program for viewing dvi output
> Ing> (default "xdvi") string view_dvi_command; + /// option for
> Ing> telling the dvi viewer about the paper size + string
> Ing> view_dvi_paper_option; /// program for viewing pdf output
> Ing> (default "xpdf") string view_pdf_command; /// default paper size
> Ing> for local xdvi/dvips/ghostview/whatever
>
> Ing> --------------71C85E59F99D511FBDE72691--

Reply via email to