Opened 18 years ago
Closed 16 years ago
#2721 closed defect (fixed)
LyX creates documents without correct orientation
Reported by: | Owned by: | Uwe Stöhr | |
---|---|---|---|
Priority: | high | Milestone: | 1.5.6 |
Component: | converters | Version: | 1.3.7 |
Severity: | normal | Keywords: | patch |
Cc: | j.spitzmueller@…, drummond@…, forenr@…, ps@…, rogermc@… |
Description
When you export a dvi document with landscape format or open one from within LyX
the dvi viewers (tested xdvi and kdvi) are not able to render it properly. It
seems that the dimension information should somehow be embedded in the dvi
documents. The xdvi manpage recommends to use this package within the TeX document:
\usepackage[dvips]{geometry}
Regards,
Sven
Attachments (7)
Change History (47)
comment:1 by , 17 years ago
comment:2 by , 17 years ago
Summary: | LyX creates dvi documents without proper dimension information → LyX creates documents without correct orientation |
---|
comment:3 by , 17 years ago
Owner: | changed from | to
---|
comment:4 by , 17 years ago
op_sys: | other → All |
---|---|
Version: | 1.4.2 → 1.3.7 |
comment:5 by , 17 years ago
Cc: | added |
---|
comment:7 by , 17 years ago
Cc: | added |
---|
comment:10 by , 16 years ago
You can adjust that in the latex header for the document with the \usepackage
line in addition to set the document format to landscape in the lyx document
settings.
comment:11 by , 16 years ago
Cc: | added |
---|
If the geometry solution is used, several things have to be noted:
- geometry changes the page layout, even if loaded without options. So the
\usepackage[dvips]{geometry} "fix" only makes sense if geometry is used anyway.
- There are classes and packages that provide their own methods and don't need
the geometry "fix", e.g. the KOMA classes (when the document option "dvips" is
used) or memoir.
- This solution should only be used for dvi output.
So the geometry fix is only applicable for a subset of documents. The general
solution for this problem is to insert "-paper" in
Tools->Preferences->Output->Latex->DVI viewer paper options. Note that not all
papaer sizes are supported yet (see #4432), but this is easy to fix.
comment:12 by , 16 years ago
Cc: | added |
---|
comment:13 by , 16 years ago
AFAIK, the dimension information is always stored in the dvi file. When
using xdvi as a previewer, an easy workaround is using a wrapper that
looks at the horizontal and vertical dimensions (this may be done with
dvitype) and passes the -paper option to the real xdvi when the horizontal
dimension is greater than the vertical one.
comment:14 by , 16 years ago
We could distribute the xdvil script with LyX in the <lyxdir>/scripts
directory and use it as the DVI previewer when xdvi and dvitype are
detected by the configure.py script. I think that we can use a shell
script, as xdvi is a *nix thing and we can rely on the presence of
/bin/sh.
comment:15 by , 16 years ago
postcript viewer has the same problem (gv here), so dvi wrapper is of no help.
comment:17 by , 16 years ago
Cc: | added |
---|
comment:18 by , 16 years ago
3.6.3.
just for sure - the steps are -
- new file
- document settings -> Page layout -> landscape
- view -> postscript
comment:19 by , 16 years ago
Cannot reproduce, still. Neither with 3.6.1 nor with 3.6.4.
I also get landscape orientation in acroread when viewing the PDF obtained
through either (dvipdfm) or (ps2pdf), but *not* with (pdflatex).
So, when DVI is implied, everything works for me.
comment:20 by , 16 years ago
this is very strange.
attached the problematic document and its outputs.
in my case it is only postscript which gives wrong orintation.
pdf or dvi has correct orientation, but wrong paper set.
comment:21 by , 16 years ago
Intel Mac
OSX 10.5.3
LyX1.5.6svn
TeXShop version Version 2.14-svn (2.14)
I also have the problem trying to produce landscape PDF.
I downloaded the exported .tex file:
%% LyX 1.6.0beta3 created this file. For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[landscape,english]{article}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{babel}
\begin{document}
aaa
\end{document}
then:
- copied its content into a new TeXShop window
- clicked the Typeset button
TeXShop produced a PORTRAIT PDF file.
So the problem appears to be with the TeX installation rather than LyX??
Below is the output from the TeXShop tex console.
I hope someone can see a problem here or suggest something else to try with TeXShop.
Regards,
Roger
Output from the TeXShop tex console:
This is pdfTeXk, Version 3.141592-1.40.3 (Web2C 7.5.6)
\write18 enabled.
%&-line parsing enabled.
entering extended mode
(./test.tex
LaTeX2e <2005/12/01>
Babel <v3.8h> and hyphenation patterns for english, usenglishmax, dumylang, noh
yphenation, arabic, basque, bulgarian, coptic, welsh, czech, slovak, german, ng
erman, danish, esperanto, spanish, catalan, galician, estonian, farsi, finnish,
french, greek, monogreek, ancientgreek, croatian, hungarian, interlingua, ibyc
us, indonesian, icelandic, italian, latin, mongolian, dutch, norsk, polish, por
tuguese, pinyin, romanian, russian, slovenian, uppersorbian, serbian, swedish,
turkish, ukenglish, ukrainian, loaded.
(/usr/local/texlive/2007/texmf-dist/tex/latex/base/article.cls
Document Class: article 2005/09/16 v1.4f Standard LaTeX document class
(/usr/local/texlive/2007/texmf-dist/tex/latex/base/size10.clo))
(/usr/local/texlive/2007/texmf-dist/tex/latex/base/fontenc.sty
(/usr/local/texlive/2007/texmf-dist/tex/latex/base/t1enc.def))
(/usr/local/texlive/2007/texmf-dist/tex/latex/base/inputenc.sty
(/usr/local/texlive/2007/texmf-dist/tex/latex/base/latin9.def))
(/usr/local/texlive/2007/texmf-dist/tex/generic/babel/babel.sty
(/usr/local/texlive/2007/texmf-dist/tex/generic/babel/english.ldf
(/usr/local/texlive/2007/texmf-dist/tex/generic/babel/babel.def))) (./test.aux)
[1{/usr/local/texlive/2007/texmf-var/fonts/map/pdftex/updmap/pdftex.map}]
(./test.aux) ){/usr/local/texlive/2007/texmf-dist/fonts/enc/dvips/cm-super/cm-s
uper-t1.enc}</usr/local/texlive/2007/texmf-dist/fonts/type1/public/cm-super/sfr
m1000.pfb>
Output written on test.pdf (1 page, 5269 bytes).
Transcript written on test.log.
comment:22 by , 16 years ago
Well, my gv opens in landscape mode the .ps file attached to comment 17.
Maybe you should check your configuration?
comment:24 by , 16 years ago
Not for me. This depends on your settings. In "state->gv Options" you have
to select "Swap Landscape" and save.
comment:25 by , 16 years ago
- downloaded exported .ps file.
- changed extension from cgi tp ps.
- double clicked file.
- file opened in Preview.app with text in correct orientation on page for landscape
(although page was displayed as portrait which isn't a problem)
So the big question seems to be, at least for Mac:
How to get LyX produce a PDF file that works like this with Preview??
Re Comment 20:
What "configuration" should be checked and
how should it be set?
comment:26 by , 16 years ago
As problem also occurs on Mac can someone set Platform to All.
Thanks
Roger
comment:27 by , 16 years ago
rep_platform: | PC → All |
---|
Note that if you produce a PDF either through dvipdfm or ps2pdf, there
should be no problem (at least, acroread uses the correct orientation).
The problem arises when producing a PDF through pdflatex. In this case,
the solution would be adding \usepackage[pdftex]{geometry}, but see
comment 6 for the reason this cannot be done.
As regards the configuration, this depends on your application. For X11
applications you should check the .Xresources (or .Xdefaults) file and
individual rc files. I don't know how this works for Mac, so cannot help.
comment:28 by , 16 years ago
attachments.isobsolete: | 0 → 1 |
---|
comment:29 by , 16 years ago
Milestone: | → 1.5.6 |
---|
comment:30 by , 16 years ago
Mac Intel
OSX 10.5.3
Applied "Fix for 1.5".
No changes to "configuration".
View->PDF (ps2pdf) now produces landscape PDF using both Preview and Adobe Reader 8.1.2.
View->PDF (pdflatex) also produces landscape PDF with Adobe Reader 8.1.2 (Preview not checked,
presumed OK)
comment:31 by , 16 years ago
attachment 2653 looks like the right approach. Two nitpicks:
- we do not need the ifpdf package. We can check runparams_.flavor from within
LaTeXFeatures::getMacros and select the appropriate preamble output. This
results in much less preamble code
- we should honour if a class does not need this workaround (memoir is an
example). So we should use mustProvide("papersize") instead of
require("papersize"), then memoir.layout can set "Provides papersize 1".
comment:32 by , 16 years ago
Thanks for the "flavor" hint, but I don't understand what you mean about
mustProvide. We have to "require" papersize and then check whether we
mustProvide it or not (when already provided by the class). But this is
what the patch was already doing, IMO.
comment:33 by , 16 years ago
I don't understand what you mean about mustProvide
You're right. Sorry. I didn't read carefully enough.
comment:34 by , 16 years ago
attachments.isobsolete: | 0 → 1 |
---|
comment:36 by , 16 years ago
Keywords: | patch added |
---|
comment:37 by , 16 years ago
Keywords: | fixedinbranch fixedintrunk added |
---|
Fixed in both trunk and branch:
http://www.lyx.org/trac/changeset/25409
http://www.lyx.org/trac/changeset/25410
comment:38 by , 16 years ago
Re Comment 20:
Maybe you should check your configuration?
i needed to set
GV.swapLandscape: True
in my .gv settings to have it correctly displayed.
comment:39 by , 16 years ago
Keywords: | fixedinbranch fixedintrunk removed |
---|---|
Resolution: | → fixed |
Status: | new → closed |
1.5.6 is ready. Marking FIXED.
comment:40 by , 10 years ago
Component: | export → converters |
---|
Well spotted! Yes,
\usepackage[dvips]{geometry}
should be used when using landscape orientation. This also works for exporting PDF.