I used the rotating package to rotate the symbol 90 positive degrees and that worked well. But I also want to rotate it 270 positive degrees and then it ends up hanging down on the line below. How can one rotate symbols any degree while it stays on the same line?
[Tex/LaTex] How to rotate text inline
inline()rotating
Related Solutions
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}
method 1 You may achieve some of what you want by changing the anchor point of the node. In addition you may also change the outer sep
or use xshift
, yshift
or shift
. Be careful with the shift
commands: the order in which they appear in the node settings has an effect on the result. For example:
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{positioning}
\begin{document}
\begin{tikzpicture}
\node [draw] (first) {1};
\node [draw, right=of first, opacity=0.5] {2};
\node [draw=red, right=of first,rotate=90,anchor=north] {2};
\node [draw=blue, right=of first,rotate=90,anchor=north,outer sep=-4pt] {2};
\node [draw=green, right=of first,xshift=-0.4cm,rotate=90,anchor=north] {2};
\node [draw=cyan, right=of first,rotate=90,anchor=north,xshift=-0.4cm] {2};
\end{tikzpicture}
\end{document}
The result is
method 2 This is a modification of the answer from ignasi: rotate the text within the node and also specifying a minimum size for the node. Specifying a minimum size makes sure the node is square.
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{positioning}
\begin{document}
\begin{tikzpicture}[every node/.style={minimum size=1cm}]
\node [draw] (first) {1};
\node [draw, right=of first, opacity=0.5] {2};
\node [draw, right=of first] {\rotatebox{90}{2}};
\end{tikzpicture}
\end{document}
The result is
Best Answer
You can use
\rotatebox
(from thegraphicx
package) with theorigin=c
option instead; a little example: