LaTeX forum ⇒ 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

Postby latexhelp1 » Tue Jan 17, 2012 2:51 pm

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 (

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

Postby Frits » Tue Jan 17, 2012 5:05 pm

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

Postby latexhelp1 » Tue Jan 17, 2012 5:56 pm

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.

  1. \documentclass[professionalfont]{beamer}
  2. \mode<presentation>
  3. \usetheme{Warsaw}
  4. \usetheme{CambridgeUS}
  5. \begin{document}
  6.  
  7. \frame
  8. {
  9. \frametitle{Slide Title}
  10. \textbf{Model:}
  11. \vspace{0.05cm}
  12. \begin{itemize}
  13. \item Utility increases with consumption: $m '(c) > 0$
  14. \end{itemize}
  15. }
  16.  
  17. \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:

Postby Frits » Tue Jan 17, 2012 10:10 pm

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: 8529
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:

Postby Stefan Kottwitz » Tue Jan 17, 2012 11:17 pm

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

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


gives:

model.png
model.png (13.78 KiB) Viewed 2439 times


Stefan
Site admin

latexhelp1
Posts: 141
Joined: Sun Jun 12, 2011 6:30 am

Postby latexhelp1 » Tue Jan 17, 2012 11:29 pm

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

  1. %\documentclass[fleqn]{beamer}
  2. %\mode<presentation>
  3.  
  4. \documentclass[professionalfont]{beamer}
  5. \mode<presentation>
  6. \usetheme{Warsaw}
  7. \usetheme{CambridgeUS}
  8.  
  9. \beamertemplatenavigationsymbolsempty
  10.  
  11. \begin{document}
  12.  
  13. \frame
  14. {
  15. \frametitle{Title}
  16.  
  17. \textbf{Model:}
  18. \vspace{0.05cm}
  19. \begin{itemize}
  20. \item Original derivative: $m '(f) > 0$
  21. \item New derivative: $a ^\prime(f) < 0$
  22. \end{itemize}
  23. }
  24.  
  25. \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

  1. \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: 1974
Joined: Sat Apr 16, 2011 7:27 pm
Location: Germany
Contact:

Postby cgnieder » Tue Jan 17, 2012 11:55 pm

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:
  1. \documentclass{article}
  2. \newcommand\deriv{^{\mkern1mu\prime}}
  3.  
  4. \begin{document}
  5. $f'(x)=x^2$
  6.  
  7. $f\deriv(x)=x^2$
  8. \end{document}

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

latexhelp1
Posts: 141
Joined: Sun Jun 12, 2011 6:30 am

Postby latexhelp1 » Wed Jan 18, 2012 12:02 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.

  1. %\documentclass[fleqn]{beamer}
  2. %\mode<presentation>
  3.  
  4. \documentclass[professionalfont]{beamer}
  5. \mode<presentation>
  6. \usetheme{Warsaw}
  7. \usetheme{CambridgeUS}
  8. \useoutertheme{miniframes}
  9. \usefonttheme{serif}
  10. \usepackage{beamerthemesplit}
  11. \usepackage{color}
  12. \usepackage{bm}
  13. \usepackage{bbm}
  14. \usepackage{amsmath}
  15. %\usepackage{pdfsync}
  16. \usepackage{multirow}
  17. \usepackage{booktabs}
  18. \usepackage{setspace}
  19. \usepackage{amsfonts}
  20. \usepackage{amsmath}
  21. \usepackage{rotating}
  22. \usepackage{graphicx}
  23. \usepackage{amssymb}
  24. \usepackage{amsthm}
  25. \usepackage{epic}
  26. \usepackage{eepic}
  27. \usepackage{eepicemu}
  28. \usepackage{epsf}
  29. \usepackage{verbatim}
  30. \usepackage{hyperref}
  31. %\usepackage{showkeys} %Shows labels in compilation
  32. %\usepackage{syntonly} %Runs document but doesn't produce pdf: faster
  33. \usepackage{mathptmx}
  34. \usepackage[scaled]{helvet}
  35. \usepackage{pstricks,pst-node,pst-tree}
  36. \usepackage{fix-cm}
  37.  
  38. \newcommand\deriv{^{\mkern1mu\prime}}
  39.  
  40. \newcommand{\ind}{\mathbf{1}}
  41. \newrgbcolor{darkred}{.75 0 0.15}
  42. \newrgbcolor{darkerred}{.45 0 0.15}
  43. %\hypersetup{linkbordercolor=red, filecolor=red, linkcolor=red}
  44. \usebuttontemplate{\color{darkerred}\insertbuttontext}
  45.  
  46. \beamertemplatenavigationsymbolsempty
  47.  
  48. \begin{document}
  49.  
  50. \frame
  51. {
  52. \frametitle{Title}
  53.  
  54. \textbf{Model:}
  55. \vspace{0.05cm}
  56. \begin{itemize}
  57. \item Original derivative: $m '(f) > 0$
  58. \item New derivative: $a\deriv(f) < 0$
  59. \end{itemize}
  60. }
  61.  
  62. \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:
  1. \documentclass{article}
  2. \newcommand\deriv{^{\mkern1mu\prime}}
  3.  
  4. \begin{document}
  5. $f'(x)=x^2$
  6.  
  7. $f\deriv(x)=x^2$
  8. \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: 1974
Joined: Sat Apr 16, 2011 7:27 pm
Location: Germany
Contact:

Postby cgnieder » Wed Jan 18, 2012 12:06 am

The space added in my example is
Just change it to a value you feel appropriate, e.g.
Clemens
------------------------------
chemmacros · chemformula · leadsheets · xsim

User avatar
ChenMeng
Posts: 1
Joined: Mon Aug 07, 2017 3:07 am
Location: Peking, China
Contact:

Postby ChenMeng » Mon Aug 07, 2017 3:18 pm

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:

  1. \documentclass{beamer}
  2. \begin{document}
  3. \begin{frame}
  4. \[
  5. f^{\prime}(x).
  6. \]
  7. \end{frame}
  8. \end{document}


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


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


Return to “Math & Science”

Who is online

Users browsing this forum: No registered users and 4 guests