Math & ScienceDerivatives in Beamer

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
latexhelp1
Posts: 141
Joined: Sun Jun 12, 2011 6:30 am

Derivatives in Beamer

Post by latexhelp1 »

In beamer, how do you express derivatives, like f'(x)? When I do that, the prime sign is placed almost directly above the f rather than between the f and the (

Code: Select all

$m '(f) > 0$ 
I would appreciate any help! :)
Last edited by latexhelp1 on Wed Jan 18, 2012 12:12 am, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Frits
Posts: 169
Joined: Wed Feb 02, 2011 6:02 pm

Re: Derivatives in Beamer

Post by Frits »

Please provide a Minimal Working Example of you document. I think the problem is not beamer but something else in your preamble, as I'm not experiencing this when making a beamer document without calling any other packages.
howtoTeX.com - Your LaTeX resource site (Tips, Tricks, Templates and more!)
Follow howtoTeX on twitter
latexhelp1
Posts: 141
Joined: Sun Jun 12, 2011 6:30 am

Derivatives in Beamer

Post by latexhelp1 »

Thank you so kindly for responding. I hope it is not a problem but I am providing all of my packages because I do not know which one would be causing this problem.

Code: Select all

\documentclass[professionalfont]{beamer}
\mode<presentation>
\usetheme{Warsaw}
\usetheme{CambridgeUS}
\begin{document}

\frame
{
\frametitle{Slide Title}
\textbf{Model:} 
\vspace{0.05cm}
\begin{itemize}
\item Utility increases with consumption: $m '(c) > 0$ 
\end{itemize}
}

\end{document}
Frits wrote:Please provide a Minimal Working Example of you document. I think the problem is not beamer but something else in your preamble, as I'm not experiencing this when making a beamer document without calling any other packages.
Last edited by latexhelp1 on Tue Feb 07, 2012 8:21 am, edited 1 time in total.
Frits
Posts: 169
Joined: Wed Feb 02, 2011 6:02 pm

Re: Derivatives in Beamer

Post by Frits »

I don't see the problem, I still get a 'normal' prime next to the character (m) and before the opening bracket.
howtoTeX.com - Your LaTeX resource site (Tips, Tricks, Templates and more!)
Follow howtoTeX on twitter
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Derivatives in Beamer

Post by Stefan Kottwitz »

Instead of f' you could also write f^\prime. You speak of f'(x), but your example code shows m'(c). m is lower than f, perhaps that's why you think the prime sign is too high.

Your code plus

Code: Select all

\item Compare with $f '(x)$ or $f ^\prime(x)$
gives:
model.png
model.png (13.78 KiB) Viewed 9842 times
Stefan
LaTeX.org admin
latexhelp1
Posts: 141
Joined: Sun Jun 12, 2011 6:30 am

Derivatives in Beamer

Post by latexhelp1 »

Thank you for your responses. I implemented this change but don't see much difference in the output. Shouldn't there be more space between the prime and function? See the attached slide. Here's the code

Code: Select all

%\documentclass[fleqn]{beamer}
%\mode<presentation>

\documentclass[professionalfont]{beamer}
\mode<presentation>
\usetheme{Warsaw}
\usetheme{CambridgeUS}

\beamertemplatenavigationsymbolsempty

\begin{document}

\frame
{
\frametitle{Title}

\textbf{Model:} 
\vspace{0.05cm}
\begin{itemize}
\item Original derivative: $m '(f) > 0$ 
\item New derivative: $a ^\prime(f) < 0$
\end{itemize}
}

\end{document}
Stefan_K wrote:Instead of f' you could also write f^\prime. You speak of f'(x), but your example code shows m'(c). m is lower than f, perhaps that's why you think the prime sign is too high.

Your code plus

Code: Select all

\item Compare with $f '(x)$ or $f ^\prime(x)$
gives:
model.png
Stefan
Last edited by latexhelp1 on Tue Feb 07, 2012 8:21 am, edited 2 times in total.
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Derivatives in Beamer

Post by cgnieder »

latexhelp1 wrote:[...] Shouldn't there be more space between the prime and function? [...]
If you want more space between the prime and the function you could do something like his:

Code: Select all

\documentclass{article}
\newcommand\deriv{^{\mkern1mu\prime}}

\begin{document}
$f'(x)=x^2$

$f\deriv(x)=x^2$
\end{document}
prime.jpg
prime.jpg (1.95 KiB) Viewed 9837 times
site moderator & package author
latexhelp1
Posts: 141
Joined: Sun Jun 12, 2011 6:30 am

Derivatives in Beamer

Post by latexhelp1 »

Thank you for sending this along!! Is there a way to make yet more space? These difference seems to be subtle and I would like more space.

Code: Select all

%\documentclass[fleqn]{beamer}
%\mode<presentation>

\documentclass[professionalfont]{beamer}
\mode<presentation>
\usetheme{Warsaw}
\usetheme{CambridgeUS}
\useoutertheme{miniframes}
\usefonttheme{serif}
\usepackage{beamerthemesplit}
\usepackage{color}
\usepackage{bm}
\usepackage{bbm}
\usepackage{amsmath}
%\usepackage{pdfsync}
\usepackage{multirow}
\usepackage{booktabs}
\usepackage{setspace}
\usepackage{amsfonts}
\usepackage{amsmath}
\usepackage{rotating}
\usepackage{graphicx}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{epic}
\usepackage{eepic}
\usepackage{eepicemu}
\usepackage{epsf}
\usepackage{verbatim}
\usepackage{hyperref}
%\usepackage{showkeys} %Shows labels in compilation
%\usepackage{syntonly} %Runs document but doesn't produce pdf: faster
\usepackage{mathptmx}
\usepackage[scaled]{helvet}
\usepackage{pstricks,pst-node,pst-tree}
\usepackage{fix-cm}

\newcommand\deriv{^{\mkern1mu\prime}}

\newcommand{\ind}{\mathbf{1}}
\newrgbcolor{darkred}{.75 0 0.15}
\newrgbcolor{darkerred}{.45 0 0.15}
%\hypersetup{linkbordercolor=red, filecolor=red, linkcolor=red}
\usebuttontemplate{\color{darkerred}\insertbuttontext}

\beamertemplatenavigationsymbolsempty

\begin{document}

\frame
{
\frametitle{Title}

\textbf{Model:} 
\vspace{0.05cm}
\begin{itemize}
\item Original derivative: $m '(f) > 0$ 
\item New derivative: $a\deriv(f) < 0$
\end{itemize}
}

\end{document}
cgnieder wrote:
latexhelp1 wrote:[...] Shouldn't there be more space between the prime and function? [...]
If you want more space between the prime and the function you could do something like his:

Code: Select all

\documentclass{article}
\newcommand\deriv{^{\mkern1mu\prime}}

\begin{document}
$f'(x)=x^2$

$f\deriv(x)=x^2$
\end{document}
prime.jpg
Last edited by latexhelp1 on Thu Feb 02, 2012 11:08 pm, edited 1 time in total.
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Derivatives in Beamer

Post by cgnieder »

The space added in my example is

Code: Select all

1mu
Just change it to a value you feel appropriate, e.g.

Code: Select all

1.5mu
site moderator & package author
User avatar
ChenMeng
Posts: 1
Joined: Mon Aug 07, 2017 3:07 am

Derivatives in Beamer

Post by ChenMeng »

Hi all,

I'm sorry to disturb, however, there might be something new for this thread.

I met the same problem here, and since the OP didn't show his/her compiler, I tried different compilers for the MWE. Interestingly, different compliers give different result.

MWE:

Code: Select all

\documentclass{beamer}
\begin{document}
\begin{frame}
\[
  f^{\prime}(x).
\]
\end{frame}
\end{document}
pdfLaTeX gives:
pdflatex_mwe.png
pdflatex_mwe.png (10.63 KiB) Viewed 7917 times
while XeLaTeX gives:
xelatex_mwe.png
xelatex_mwe.png (9.85 KiB) Viewed 7917 times
which is obviously inappropriate.

In XeLaTeX version, a simple line of \usepackage[T1]{fontenc} solves the problem.

Is this a bug of beamer or XeLaTeX? It might be linked to the Latin Modern Font?
Post Reply