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?

0

1 Answer 1

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}
4
  • 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, 2022 at 6: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, 2022 at 3: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, 2022 at 4: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, 2022 at 5:50

Not the answer you're looking for? Browse other questions tagged .