## LaTeX forum ⇒ Math & Science ⇒ Derivatives 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

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 (

$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.

Frits
Posts: 169
Joined: Wed Feb 02, 2011 6:02 pm
Contact:
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!)

latexhelp1
Posts: 141
Joined: Sun Jun 12, 2011 6:30 am
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.

\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
Contact:
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!)

Stefan Kottwitz
Posts: 8708
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:
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.

\item Compare with $f '(x)$ or $f ^\prime(x)$

gives:

model.png (13.78 KiB) Viewed 2793 times

Stefan

latexhelp1
Posts: 141
Joined: Sun Jun 12, 2011 6:30 am
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

%\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.

\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.

cgnieder
Site Moderator
Posts: 1985
Joined: Sat Apr 16, 2011 7:27 pm
Location: Germany
Contact:
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:
\documentclass{article}\newcommand\deriv{^{\mkern1mu\prime}} \begin{document}$f'(x)=x^2$ $f\deriv(x)=x^2$\end{document}

prime.jpg (1.95 KiB) Viewed 2788 times
Clemens
------------------------------
chemmacros · chemformula · leadsheets · xsim

latexhelp1
Posts: 141
Joined: Sun Jun 12, 2011 6:30 am
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.


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:
\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.

cgnieder
Site Moderator
Posts: 1985
Joined: Sat Apr 16, 2011 7:27 pm
Location: Germany
Contact:
The space added in my example is
1mu

Just change it to a value you feel appropriate, e.g.
1.5mu
Clemens
------------------------------
chemmacros · chemformula · leadsheets · xsim

ChenMeng
Posts: 1
Joined: Mon Aug 07, 2017 3:07 am
Location: Peking, China
Contact:
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:

\documentclass{beamer}\begin{document}\begin{frame}$f^{\prime}(x).$\end{frame}\end{document}

pdfLaTeX gives:
pdflatex_mwe.png (10.63 KiB) Viewed 868 times

while XeLaTeX gives:
xelatex_mwe.png (9.85 KiB) Viewed 868 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?