I am trying to get a theorem inside an alert block to have the same background color as the alert block. I have seen other discussions of this and attempted those solutions, i.e., adding the noamsthm to the options in the documentclass. When I do that the file will no longer compile. Any suggestions? Here is the code:


\usepackage[scale=1.24]{beamerposter} % Use the beamerposter package for laying out the poster

\usetheme{confposter} % Use the confposter theme supplied with this template

\setbeamercolor{block title}{fg=ngreen,bg=white} % Colors of the block titles
\setbeamercolor{block body}{fg=black,bg=white} % Colors of the body of blocks
\setbeamercolor{block alerted title}{fg=white,bg=dblue!70} % Colors of the highlighted block titles
\setbeamercolor{block alerted body}{fg=black,bg=dblue!10} % Colors of the body of highlighted blocks
% Many more colors are available for use in beamerthemeconfposter.sty

% Define the column widths and overall poster size
% To set effective sepwid, onecolwid and twocolwid values, first choose how many columns you want and how much separation you want between columns
% In this template, the separation width chosen is 0.024 of the paper width and a 4-column layout
% onecolwid should therefore be (1-(# of columns+1)*sepwid)/# of columns e.g. (1-(4+1)*0.024)/4 = 0.22
% Set twocolwid to be (2*onecolwid)+sepwid = 0.464
% Set threecolwid to be (3*onecolwid)+2*sepwid = 0.708

\setlength{\paperwidth}{48in} % A0 width: 46.8in
\setlength{\paperheight}{36in} % A0 height: 33.1in
\setlength{\sepwid}{0.024\paperwidth} % Separation width (white space) between columns
\setlength{\onecolwid}{0.22\paperwidth} % Width of one column
\setlength{\twocolwid}{0.464\paperwidth} % Width of two columns
\setlength{\threecolwid}{0.708\paperwidth} % Width of three columns
\setlength{\topmargin}{-0.5in} % Reduce the top margin size

\usepackage{graphicx}  % Required for including images

\usepackage{booktabs} % Top and bottom rules for tables


\title{A Curious Proof of Fermat's Little Theorem} % Poster title

%\author{Michaela Fassler} % Author(s)

%\institute{Southwest Minnesota State University} % Institution(s)



\addtobeamertemplate{block end}{}{\vspace*{2ex}} % White space under blocks
\addtobeamertemplate{block alerted end}{}{\vspace*{2ex}} % White space under highlighted (alert) blocks

\setlength{\belowcaptionskip}{2ex} % White space under figures
\setlength\belowdisplayshortskip{2ex} % White space under equations

\begin{frame}[t] % The whole poster is enclosed in one beamer frame

\begin{columns}[t] % The whole poster consists of three major columns, the second of which is split into two columns twice - the [t] option aligns each column's content to the top

\begin{column}{\sepwid}\end{column} % Empty spacer column

\begin{column}{\onecolwid} % The first column


If $p$ is prime and $a \in  \mathbb{Z}$, then $p$ divides $ a^{\,p} - a$
or in other words, $a^{\,p}\equiv a \pmod{p}$ [1]

How Fermat's Little Theorem is commonly used:
$3^{31} \equiv x \pmod{7}$ \\
By thm, $3^7 \equiv 3 \pmod{7} $ \\
$3^{31} = (3^7)^{4} * (3^3)$ \\
$(3^7)^4 (3^3) \equiv (3^4) * (3^3) \equiv 4*6 \equiv 24 \equiv 3 \pmod{7} $
$ \therefore 3^{31} \equiv 3 \pmod{7} $


\begin{block}{Proof 1: Induction using Binomial Coefficients}

When $a=0$ then $p \, |0^{\,p} - 0$ is always true \\
When $a=1$ then $p \, |1^{\,p} -1$ is always true. \\
Assume $p \,|a^{\,p} - a$ \\ %Inductive hypothesis
Examine $(a+1)^{\,p} - (a+1)$ \\ %n+1%

(a+1)^{\,p} = a^{\,p} + \dbinom{p}{1} a^{\,p-1} + \dbinom{p}{2} a^{\,p-2} + ... + \dbinom{p}{p-1} a+1

(a+1)^{\,p} - a^{\,p} - 1 = \dbinom{p}{1} a^{\,p-1} + \dbinom{p}{2} a^{\,p-2} + ... + \dbinom{p}{p-1} a
%Move a and 1 over%
% p divides right side (cuz combination) therefor p divides the left side%

p \, | \, ((a+1)^{p} - a^{p} - 1) + (a^p - a) %We can add this because it is also divisible by p%

\therefore p \, | \,  (a+1)^{p} -(a+1)
\raggedleft [2]




\end{column} % End of the first column

\begin{column}{\sepwid}\end{column} % Empty spacer column

\begin{column}{\twocolwid} % Begin a column which is two columns wide (column 2)

\begin{column}{\sepwid}\end{column} % Empty spacer column

\begin{column}{\onecolwid} % The third column


\begin{block}{Proof 2: Using Lagrange's Theorem}
\begin{theorem}{Lagrange's Theorem} If G is a finite group and H is a subgroup of G, then the order of H divides the order of G aka $ |H| \,\, \big| \,\, |G|$

If $a=0$ then $a^{\, p} \equiv a \pmod{p} $ is true \\
Assume $ a \neq 0$ \\
Take $\bar{a} = a + p \mathbb{Z} $ \\
So, $ \bar{a} \in ( \mathbb{Z} / p \mathbb{Z} )^{x} $ \\
Let H be a subgroup of $ ( \mathbb{Z} / p \mathbb{Z} )^{x}$ generated by $\bar{a}$ \\
$$ |H| = | \bar{a} |$$
$$ |H| \, \, \big{|} \, \, (\mathbb{Z} / p \mathbb{Z} )^{x} $$
So we can write $$p-1 = m |H| \, , m \in \mathbb{Z} $$ \\
$$ \bar{a} ^{\,p-1} \equiv \bar{a} ^{|H|m} \equiv \bar{1} ^{m} \equiv \bar{1} \pmod{p} $$ \\ %WHY%
Which implies, $$a^{\, p-1} \equiv 1 \pmod{p} $$ \\
$$ \therefore a^{\,p} \equiv a \pmod{p} $$
\raggedleft [3]



\item 1. Alkauskas, Giedrius. A Curious Proof of Fermat's Little Theorem. The American Mathematical Monthly, vol. 116, no. 4, 2009, pp. 362–364. JSTOR, JSTOR, www.jstor.org/stable/40391097. \\
\item 2. Tsumura, Yu. Use Lagrange's Theorem to Prove Fermat's Little Theorem. Problems in Mathematics, 15 Dec. 2016, yutsumura.com/use-lagranges-theorem-to-prove-fermats-little-theorem/. \\
\item 3.  Weisstein, Eric W. Fermat's Little Theorem. From MathWorld--A Wolfram Web Resource. http://mathworld.wolfram.com/FermatsLittleTheorem.html



\end{column} % End of the third column

\end{columns} % End of all the columns in the poster

\end{frame} % End of the enclosing frame

  • Welcome to TeX.SX! Your code is quit long, have a look at minimal working example (MWE). – Bobyandbob Nov 2 '17 at 14:18
  • I edited out some of the code. The real issue is in the first line. Previous threads indicate this should work, but it causes my code to not compile. The code compiles fine without the noamsthm option. – moremath Nov 2 '17 at 14:21
  • 1
    and it might also be an idea to make it compilable. I get an error about an unknown theme – daleif Nov 2 '17 at 14:22
  • I get an error with \documentclass{beamer} \usepackage[scale=1.24]{beamerposter} \usetheme{confposter} \begin{document} \begin{frame} test \end{frame} \end{document} without \usetheme{confposter} it works. Do you have the same problem, if yes probably this could be a mwe? – Bobyandbob Nov 2 '17 at 15:15
  • 1
    Please cut this down to a minimal working example. This should be the smallest amount of code that compiles, without noamsthm, and demonstrates your problem. In addition to clarifying exactly what your problem is, giving a MWE makes it much easier for some one to help you -- and hence much more likely that some one will. The beamer theme confposter seems to be non-standard, so if at all possible leave this out of your MWE -- if you can't leave it out then it is likely that that is the problem! – Andrew Nov 2 '17 at 17:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.