# Rotating text by -90 degrees

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.

-
Can you explain more? Why do you want to rotate the text and maybe show an example. – Leo Liu Dec 17 '11 at 12:39

## 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
『朝发轫于苍梧兮，\\

\end{CJKvert}

\lipsum[2]

\end{document}

-

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.

-
I use XeTeX. Should I use lscape or pdflscape with that? – Village Dec 17 '11 at 11:35
I would use pdflscape, also because of the rotation page attribute, and it supports XeTeX. – Stefan Kottwitz Dec 17 '11 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 '11 at 6:53
\documentclass{article}
\usepackage{pdflscape}
\begin{document}

\begin{landscape}
foo
\end{landscape}

\makeatletter

This seems to have a different effect than with the lscape package. I've updated the question to be more specific. – Village Dec 17 '11 at 12:46
then replace the g@addto@macro{...} with the definition from Stefans answer – Herbert Dec 17 '11 at 13:05