3

I would like to be able to hide the dividing line in the fraction that arises from applying a command such as \dfrac.

In particular, what I would like to do is take an expression such as the following:

\dfrac{\partial^2 f}{\partial x^2} + \dfrac{\partial^2 f}{\partial y^2}

and create a duplicate of it which highlights only the fs. I can use \phantom to hide other symbols that occur in the partial derivatives, but I don't know how to use it to hide the fraction bar.

Could anybody suggest a way forward?

OGBond
  • 75

1 Answers1

2

You could employ array environments, or you could define a macro called, say, \nolinefrac that employs the low-level \genfrac macro that's provided by the amsmath package.

enter image description here

\documentclass{article}
\usepackage{amsmath} % for \dfrac, \genfrac, and \text macros
\newcommand{\nolinefrac}[2]{\genfrac{}{}{0pt}{}{#1}{#2}}

\begin{document}

[ \frac{\partial^2 f}{\partial x^2}

\frac{\partial^2 f}{\partial y^2} \quad\text{vs.}\quad \begin{array}{@{}c@{}} \partial^2 f \[0.5ex] \partial x^2 \end{array}

\begin{array}{@{}c@{}} \partial^2 f \[0.5ex] \partial y^2 \end{array} \quad\text{vs.}\quad \nolinefrac{\partial^2 f}{\partial x^2}

\nolinefrac{\partial^2 f}{\partial y^2} ]

\end{document}

Mico
  • 506,678
  • 1
    You beat me just few minutes, I also wrote the suggestion based on \genfrac tag, but you won the race... :-D – MadyYuvi Dec 13 '22 at 06:54
  • Thanks for this. The third one does exactly what I want - if you drag and drop this over the first equation it completely overlaps. – OGBond Dec 14 '22 at 03:59
  • Is there a way to do this without using any macros? I am copying and pasting this equation into an app where macros cannot be defined. – OGBond Dec 14 '22 at 04:00
  • @OGBond - You could replace \nolinefrac{\partial^2 f}{\partial x^2} with \genfrac{}{}{0pt}{}{\partial^2 f}{\partial x^2}, etc. For a more detailed follow-up, I suppose it might help if you provided some more information about this mysterious "app where macros cannot be defined". – Mico Dec 14 '22 at 05:50