4

I am creating a beamer presentation where I want a heading for a slide in larger font, followed by the body of the slide in smaller font. Problem being, my current approach appears to cause all of the text (even when not in the \huge{} brackets) to be larger font. My setup:

\documentclass[9pt,t]{beamer}

\usetheme{Berkeley}
\usepackage{thumbpdf}
\usepackage{wasysym}
\usepackage{ucs}
\usepackage[utf8]{inputenc}
\usepackage{pgf,pgfarrows,pgfnodes,pgfautomata,pgfheaps,pgfshade}
\usepackage{verbatim}
\usepackage[utf8]{inputenc} 
\usepackage{listings}
\usepackage{color}
\usepackage{amsfonts}
\usepackage{amsmath,amssymb,epsfig,color}
\usepackage{psfrag,subfigure}
\usepackage{times}
%\usepackage{textcomp}
%\usepackage{eurosym}
\usepackage{amsthm,amsmath,amsfonts,mathbbol,mathrsfs,stmaryrd,textcomp}

\begin{document}

\begin{frame}[t]
    \huge{I want this text to be large}

    \bigskip
But this text is also appearing as large. Not what I want!

\end{frame}
\end{document}

So after \bigskip - I need the text to be the normal sized font specified in the \documentclass command.

Also forgive me, I don't know how to compile my code within this post to show the result. Could anyone give me a tip on how to do that?

Thanks

  • 10
    Move the \huge inside the following {} braces, as in {\huge I want this text to be large[sic]}. The braces limit the extent of the \huge influence. \huge is a setting, and does not take an argument. – Steven B. Segletes May 07 '14 at 13:24
  • To show the output of code, compile it on your computer, take a screenshot, and add that to your post. – Torbjørn T. May 07 '14 at 13:27

2 Answers2

6
\documentclass[9pt,t]{beamer}

\usetheme{Berkeley}
\usepackage{thumbpdf}
\usepackage{wasysym}
\usepackage{ucs}
\usepackage[utf8]{inputenc}
\usepackage{pgf,pgfarrows,pgfnodes,pgfautomata,pgfheaps,pgfshade}
\usepackage{verbatim}
\usepackage[utf8]{inputenc} 
\usepackage{listings}
\usepackage{color}
\usepackage{amsfonts}
\usepackage{amsmath,amssymb,epsfig,color}
\usepackage{psfrag,subfigure}
\usepackage{times}
%\usepackage{textcomp}
%\usepackage{eurosym}
\usepackage{amsthm,amsmath,amsfonts,mathbbol,mathrsfs,stmaryrd,textcomp}

\begin{document}

\begin{frame}[t]
    %inside the brace to limit
    {\huge I want this text to be large

    \bigskip}% always make sure end of para is in scope for a size change.
But this text is also appearing as large. Not what I want!

\end{frame}
\end{document}
David Carlisle
  • 757,742
Tarass
  • 16,912
  • 3
    best to include the blank line before rather than after the } so that if the large text takes more than one line it is set on a large baseline rather than normal baseline – David Carlisle May 07 '14 at 13:49
  • @DavidCarlisle I didn't know this. Did I understand what you said, if not, feel free to correct directly. – Tarass May 07 '14 at 13:55
  • You moved the wrong brace:-) – David Carlisle May 07 '14 at 13:59
  • Silly me ! I thaught before { rather afer the } ... – Tarass May 07 '14 at 14:03
  • ahh yes, i do that with other commands so why it didn't click with this one! thanks very much. – brucezepplin May 07 '14 at 14:18
  • @brucezepplin As a general rule, these types of setting-commands are to be avoided; see http://tex.stackexchange.com/q/516/17423. – Sean Allred May 07 '14 at 15:52
  • @SeanAllred But not speaks about \huge, how one should do then ? – Tarass May 07 '14 at 15:58
  • @SeanAllred I don't think the size setting commands are included in that, only those for changing font weight/shape/family. – Torbjørn T. May 07 '14 at 16:00
  • @TorbjørnT. The size settings certainly aren't per se, but I would still usually embed them as some sort of semantic markup. It wouldn't be worth it in this case, but I feared the "other commands" OP referred to were the font-changing ones. (Other than the size commands, I honestly can't remember any other switches that aren't deprecated.) – Sean Allred May 07 '14 at 16:56
1

Another possibility is to call \normalsize on the text after \huge. Using \huge sets everything after it to \huge, thus you can either limit its extend as Tarass' answer shows, or switch it off again by going back to \normalsize. This more limited in usability though.

\documentclass[9pt,t]{beamer}

\usetheme{Berkeley}
\usepackage{thumbpdf}
\usepackage{wasysym}
\usepackage{ucs}
\usepackage[utf8]{inputenc}
\usepackage{pgf,pgfarrows,pgfnodes,pgfautomata,pgfheaps,pgfshade}
\usepackage{verbatim}
\usepackage[utf8]{inputenc} 
\usepackage{listings}
\usepackage{color}
\usepackage{amsfonts}
\usepackage{amsmath,amssymb,epsfig,color}
\usepackage{psfrag,subfigure}
\usepackage{times}
%\usepackage{textcomp}
%\usepackage{eurosym}
\usepackage{amsthm,amsmath,amsfonts,mathbbol,mathrsfs,stmaryrd,textcomp}

\begin{document}

\begin{frame}[t]
    % Huge text after this
    \huge{I want this text to be large}

    \bigskip
    % go back to normalsize here
    \normalsize{But this text is also appearing as large. Not what I want!}

\end{frame}
\end{document}

Here you can find a complete list of available font sizes.

Adriaan
  • 153
  • 2
    You seem to believe that \huge and \normalsize take an argument. They don't: they're declarations. – egreg May 22 '19 at 13:21
  • See https://tex.stackexchange.com/q/462904/4427 – egreg May 22 '19 at 13:26
  • 1
    Simple: calling \huge{text} is essentially the same as \huge text. The command \huge (as well as \normalsize and all other size changing commands) doesn't take an argument. The proper way to use them is as outlined in the other answer. – egreg May 22 '19 at 13:32
  • @egreg thanks, I understand now why my approach works for this case, be it that it is of limited usability in other circumstances. I'll use the {\huge} approach from now on. – Adriaan May 22 '19 at 13:43