10

Using lscape from the graphics package, one can rotate all of the text within \begin{landscape} and \end{landscape} by 90 degrees, while permitting the text to break across pages. Is there a way to rotate the text in the same manner, but -90 degrees?

Update:

The desired result is to rotate all of the text within the body of the page, but not the page itself, and not the footnotes. The use is connected with this question: Vertical Chinese text with XeTeX, however, using a minipage is not a good option, as the long material does not properly wrap at the end of the page. However, the lscape solution rotates the text 90 degrees in the wrong direction.

Here is an example of the code using lscape which rotates the text 90 degrees:

\documentclass{article}
\usepackage{lscape}
\begin{document}
    \begin{landscape}
        This is some text.
    \end{landscape}
\end{document}

Note, with the above code that footnotes and headers are not changed. When compiled with xelatex, and viewed in a PDF reader, the page is not turned to landscape mode. I hope this behavior can be copied, but with -90 rotation of the text only.

1
  • Can you explain more? Why do you want to rotate the text and maybe show an example.
    – Leo Liu
    Dec 17, 2011 at 12:39

3 Answers 3

2

Redefining landscape

I was wrong. lscape instead of pdflscape should be used here, because the text will be also rotated. And patch the command as Stefan Kottwitz do.

You can define a new environment to rotate the page by -90 degrees, without changing the definiton of landscape environment. To do this, you can use

\let\antilandscape\landscape
\let\endantilandscape\endlandscape
\def\LS@antirot{%
  \setbox\@outputbox\vbox{\hbox{\rotatebox{-90}{\box\@outputbox}}}}
\patchcmd{\antilandscape}{\LS@rot}{\LS@antirot}{}{} % require etoolbox package

Vertical typesetting example

It is quite difficult to get everything well in vertical mode. The following example shows how to get proper footnote for vertical Chinese text. There are still more things to do, you can try.

\documentclass[UTF8]{ctexart}
\usepackage{etoolbox}
\usepackage{lscape}
\makeatletter
\let\antilandscape\landscape
\let\endantilandscape\endlandscape
\def\LS@antirot{%
  \setbox\@outputbox\vbox{\hbox{\rotatebox{-90}{\box\@outputbox}}}}
\patchcmd{\antilandscape}{\LS@rot}{\LS@antirot}{}{}

\newfontlanguage{Chinese}{CHN}
\setCJKfamilyfont{songvert}[Script=CJK,Language=Chinese,Vertical=RotatedGlyphs]{SimSun}
\newcommand*\songvert{\CJKfamily{songvert}\punctstyle{plain}\CJKmove}

\newcommand*\CJKmovesymbol[1]{\raise.35em\hbox{#1}}
\newcommand*\CJKmove{\punctstyle{plain}% do not modify the spacing between punctuations
  \let\CJKsymbol\CJKmovesymbol
  \let\CJKpunctsymbol\CJKsymbol}

\newenvironment{CJKvert}
  {\antilandscape
   \appto{\normalfont}{\songvert}\songvert
   \let\oldfootnote\footnote
   \renewcommand\footnote[1]{\oldfootnote{\songvert##1}}%
   \renewcommand\thefootnote{[\chinese{footnote}]}%
   \def\vert@makefnmark{\hbox{\normalfont\@thefnmark\space}}%
   \let\old@makefntext\@makefntext
   \long\def\@makefntext##1{{%
     \let\@makefnmark\vert@makefnmark
     \old@makefntext{##1}}}%
  }
  {\endantilandscape}

\makeatother

\usepackage{lipsum}

\begin{document}

\lipsum[1]

\begin{CJKvert}
\parindent=0pt
『朝发轫于苍梧兮,\\
夕余至乎县圃。\\
欲少留此灵琐兮,\\
日忽忽其将暮。\\
吾令羲和弭节兮,\\
望崦嵫而勿迫。』\footnote{屈原《离骚》}
\end{CJKvert}

\lipsum[2]

\end{document}
10

You could redefine \LS@rot:

\makeatletter
\renewcommand*{\LS@rot}{%
  \setbox\@outputbox\vbox{\hbox{\rotatebox{-90}{\box\@outputbox}}}}
\makeatother

Originally, it uses 90 as argument for \rotatebox. \makeatletter and \makeatother are used because of the @ in the macro's name.

Perhaps you don't use pdfTeX, because you use lscape, not pdflscape. However, if you would use pdfTeX with lscape, you may consider setting \pdfpageattr{/Rotate 270} at the end of the landscape environment, possibly by redefining or patching \endlandscape.

3
  • 1
    I use XeTeX. Should I use lscape or pdflscape with that?
    – Village
    Dec 17, 2011 at 11:35
  • 1
    I would use pdflscape, also because of the rotation page attribute, and it supports XeTeX.
    – Stefan Kottwitz
    Dec 17, 2011 at 11:39
  • @Village: You should use lscape, because the angle 90 defined in pdflscape is wrong, and what's more you need not rotate the page for vertical Chinese typesetting.
    – Leo Liu
    Dec 18, 2011 at 6:53
7
\documentclass{article}
\usepackage{pdflscape}
\begin{document}

\begin{landscape}
 foo
\end{landscape}

\makeatletter
\g@addto@macro{\landscape}{\PLS@Rotate{-90}}
\makeatother

\begin{landscape}
 foo
\end{landscape}

\end{document}
2
  • 1
    This seems to have a different effect than with the lscape package. I've updated the question to be more specific.
    – Village
    Dec 17, 2011 at 12:46
  • then replace the g@addto@macro{...} with the definition from Stefans answer
    – user2478
    Dec 17, 2011 at 13:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .