我正在使用“thumbs”包在我的页面上生成包含章节信息的 tumb 索引。
\addthumb{First Section}{\thesection}{white}{lightgray}
我想做的是将文本旋转 90°。我尝试了“旋转”包,但它对我来说不起作用:
\addthumb{First Section}{\begin{sideways}\parbox{5cm}{\centering \Large \textbf{\thesection}}\end{sideways}}{white}{lightgray}
该术语本身确实可以正常工作,只是在 thumbindex 环境中不行。是否有可能实现这一点?
感谢您的任何建议!
更新:
\documentclass[a4paper,10pt,titlepage]{article}
\usepackage[ansinew]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\usepackage{color}
\usepackage[width=1cm, height=1.2cm, eventxtindent=5pt, oddtxtexdent=5pt]{thumbs}
\usepackage{rotating}
\begin{document}
\section{Intro} \label{chap:1}
\addthumb{First Section}{\thesection}{white}{lightgray}
text
\end{document}
答案1
这是一个tikz
解决方案。
\documentclass{article}
\usepackage{tikz}
\newcommand{\tikzmark}[1]{\tikz[overlay, remember picture] \node[coordinate] (#1) {};}
\newcommand{\mythumb}{%
\tikzmark{a}% %% <---put a % here
\begin{tikzpicture}[remember picture,overlay]
\node[rotate=90,minimum width=1.2cm,minimum height=1cm,fill=gray!30,font=\large\bfseries,text=white,anchor=south west] at ([yshift=1cm]a-|current page.north east) {\thesection};
\end{tikzpicture}%
}
\begin{document}
\section{Intro} \label{chap:1}
\mythumb
text
\end{document}