5

my problem of berkeley

This theme is good,but I want the row a little small, how can I edit it. Thanks

\documentclass[14pt]{beamer}
\usepackage[space,noindent]{ctex}
\usetheme{Berkeley}
\setbeamercolor{normal text}{bg=black!10}
\begin{document}
\kaishu
\title[aaa]{aaa}
\subtitle{aaa}
\author{aaa}
\institute[aaa]{aaa}
\date[aaa]{aaa}
\logo{\includegraphics{TeXlogo.pdf}} % you can % it
\begin{frame}
\titlepage
\end{frame}
\section{aaa}
\subsection{aaa}
\begin{frame}
\frametitle{aaa}
\framesubtitle{aaa}
aaa 1、2、3...
\end{frame}
...

\begin{frame}
aaa...
\end{frame}

...
\section{aaa}
\subsection{aaa}
\begin{frame}
...
\end{frame}
\end{document}

2 Answers2

6

Set the height of the header in your preamble by adjusting \beamer@headheight accordingly:

enter image description here

\documentclass[14pt]{beamer}% http://ctan.org/pkg/beamer
\let\Tiny\tiny% http://tex.stackexchange.com/q/58087/5764
\usetheme{Berkeley}
\makeatletter
\beamer@headheight=1.5\baselineskip
\makeatother
\setbeamercolor{normal text}{bg=black!10}
\begin{document}
\title[Title]{My title}
\subtitle{Subtitle}
\author{Author}
\institute[Institute]{My institute}
\date[Date]{My date}
\logo{\color{blue!50}\scalebox{2}{\TeX}} % you can % it
\begin{frame}
  \titlepage
\end{frame}

\section{A section}
\subsection{A subsection}
\begin{frame}
  \frametitle{Frame title}
  \framesubtitle{frame subtitle}
  Some text
\end{frame}

\begin{frame}
  Some more text
\end{frame}

\section{Another section}
\subsection{Another subsection}
\begin{frame}
  Some final text
\end{frame}
\end{document}

The default is 2.5\baselineskip, which results in 62.5pt (2.5 x 25pt) under the 14pt base font you selected.

Werner
  • 603,163
  • Thanks, it's helpful And if I want to learn to edit other, just go % http://ctan.org/pkg/beamer. to see the document, Am I right? Again thank you for help :-D – ytyyutianyun Oct 18 '13 at 23:47
  • And a error? \let\Tiny=\tiny – ytyyutianyun Oct 18 '13 at 23:52
  • 1
    @ytyyutianyun: You can look at beamer's documentation to learn more about the general principles of presentation. However, each theme holds its own intricacies and make-up. The quick-fix \let\Tiny\tiny is from [How to remove the warnings “Font shape OT1/cmss/m/n' in size <4> not available” and “Size substitutions with differences” inbeamer`?](http://tex.stackexchange.com/q/58087/5764). Alternatively, add \usepackage{lmodern} to your document preamble. – Werner Oct 18 '13 at 23:55
  • Great By the document, I use "\usetheme[width=50pt]{Berkeley}" to set the sidebar width.

    I set the text's line spacing. I use "\setbeamerfont{sidebar}{size*={8pt}{1pt}}" just in the page 197

    – ytyyutianyun Oct 19 '13 at 00:12
  • But how can I set the text in frametitle vertically center(not horizontal alignment), Thanks – ytyyutianyun Oct 19 '13 at 00:21
  • @ytyyutianyun: The frame title is vertically centred, so I would say that you want it horizontally centred... right? – Werner Oct 19 '13 at 04:58
  • No,I think I find reasons, the height include { frame title} and{ framesubtitle}, so without framesubtitle, it looks like the frametitle is in the top.

    Can I cancel the framsubtitle height when I don't use it while I want the framsubtitle height when I use it. All the total height in my example will be the same. It will make the frametitle center without the framsubtitle. Can I do this? Sorry to trouble you and thanks! :-D

    – ytyyutianyun Oct 19 '13 at 05:06
  • @ytyyutianyun: That's not what I see - see image. Without a \framesubtitle the \frametitle is lowered. It may not be completely in the middle, but that's just because the frame title Frame title doesn't have any descenders. See this image that better highlights the vertical alignment of the frame title without a frame subtitle. – Werner Oct 19 '13 at 05:22
  • Yes,you are right, I get false because I set the frame title height too small, so the middle is not apparent. I make it bigger. It's OK now, Thanks for helping. My question is solved. The code "\beamer@headheight" and the book in Page145 "\usetheme[headheight=⟨head height⟩,footheight=⟨foot height⟩]{boxes}" is it same? otherwise, I cannot find any include the "headheight". Then if not; then if you'll allow a slight digression, how do you know the code "\beamer@headheight". Thanks – ytyyutianyun Oct 19 '13 at 06:09
  • 1
    @ytyyutianyun: According to an investigation into the code of the outer theme sidebar, it seems like height would be the appropriate key choice (as in \usetheme[height=<len>]{Berkeley}. However, it doesn't work. I've asked the beamer maintainer in chat, but don't know the solution just yet. Using \beamer@headheight as-is works in the interim. – Werner Oct 19 '13 at 06:20
  • Thank you for solving my problem quickly and efficiently. :-D – ytyyutianyun Oct 19 '13 at 06:35
0

Instead of messing wit beamer's internal lengths, one can simply pass the height option to the sidebar outer theme by using \PassOptionsToPackage{height=1.5cm}{beamerouterthemesidebar} before the theme is loaded:

\documentclass[14pt]{beamer}
%\usepackage[space,noindent]{ctex}

\PassOptionsToPackage{height=1.5cm}{beamerouterthemesidebar}
\usetheme{Berkeley}
\setbeamercolor{normal text}{bg=black!10}
\begin{document}
%\kaishu
\title[aaa]{aaa}
\subtitle{aaa}
\author{aaa}
\institute[aaa]{aaa}
\date[aaa]{aaa}
\logo{\includegraphics[width=1cm]{example-image}} % you can % it
\begin{frame}
\titlepage
\end{frame}
\section{aaa}
\subsection{aaa}
\begin{frame}
\frametitle{aaa}
\framesubtitle{aaa}
aaa 123...
\end{frame}
...

\begin{frame}
aaa...
\end{frame}

...
\section{aaa}
\subsection{aaa}
\begin{frame}
...
\end{frame}
\end{document}