0

I'm writing the manuscript of my paper and I have to write partial derivatives in a table. While doing so, there is a problem when I use \begin{equation}...\end{equation} in table. For simplicity, I write a part of table as follows:

\begin{tabular}{ccc}
\toprule
  Boundary &  Flow  \\
\midrule
  Inlet &   
  \[ \textit {u=U_0, v=0}\]\\
  Outlet & 
  \[  {\frac{\partial u}{\partial y}=\frac{\partial v}{\partial x}=0}\]\\

\bottomrule
\end{tabular}

enter image description here

I would be grateful if someone give me a help with this issue. I have to mention that when I use the same equation NOT in table, the code is applied well:

\begin{equation}
 {\frac{\partial u}{\partial y}=\frac{\partial v}{\partial x}=0}
\end{equation}

enter image description here

New contributor
Sam El is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
7
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
    – Community Bot
    Jun 23 at 16:10
  • Welcome to SE. Please never give fragmented bits of code and provide a Minimal Working Example instead. Thank you.
    – Miyase
    Jun 23 at 16:11
  • Not quite clear. Do you want equation numbers in the table?
    – Bernard
    Jun 23 at 16:18
  • I can't even get your code to compile, so I'm not sure how far down a rabbit hole I should go. But your fundamental problem is that you can't have \[...\] in a tabular (there are other problems as well). And don't ignore errors when compiling. And this has nothing to do with Overleaf.
    – Teepeemm
    Jun 23 at 16:20
  • 1
    If any of your cell is p{...}, then the content is put in a parbox (paragraph box), so if you want a displayed math there, you can have it. c,l, etc. are set in horizontal mode, that is, like a line of text (no paragraphs), so displayed math doesn't work.
    – Rmano
    Jun 23 at 17:10

1 Answer 1

2

Here is a solution, without equation numbers, with the esdiff package:

    \documentclass{article}
    \usepackage{amsmath}
    \usepackage{esdiff}
    \usepackage{array, booktabs}

    \begin{document}

    \begin{tabular}{c >{$}wc{3cm}<{$}}
    \toprule
      Boundary & \text{Flow} \\
    \midrule
      Inlet &
      u=U_0, v=0 \\[1ex]
      Outlet &
     \diffp{u}{y} =\diffp{v}{x} =0 \\
    \bottomrule
    \end{tabular}

    \end{document} 

enter image description here

2
  • Dear @Bernard thanks for your solution. I appreciate.
    – Sam El
    Jun 23 at 17:07
  • @SamEi: You're welcome. Always glad when I can help!
    – Bernard
    Jun 23 at 18:02

Your Answer

Sam El is a new contributor. Be nice, and check out our Code of Conduct.

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.