4

I have a simple problem with partial derivative symbol, it doesn't work if I try any of these commands: \partial \pdiff \pder

I use sharelatex, and in other projects I could use the \partial symbol. I have no idea what's the problem, could someone help me? Thank you!

The code (edited in from a comment):

\documentclass[a4paper,11pt]{article}
\linespread{1}
\usepackage{geometry}
\usepackage{multirow}
\usepackage{anysize}
\usepackage[utf8]{inputenc}
\usepackage[magyar]{babel}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage[LGRgreek]{mathastext}
\usepackage{amssymb}
\usepackage{array}
\usepackage{subcaption}
\begin{document}
\begin{equation}
\partial{a}
\end{equation}
\end{document}

The error message: undefined control sequence

  • 1
    Welcome to TeX.SX! Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – egreg Mar 13 '15 at 17:37
  • Try putting \show\partial in the document and then compiling it. You should get a message showing the current definition of the command. What is this message? – Ian Thompson Mar 13 '15 at 17:37
  • 1
    We will need to see an MWE of what you are trying. $\partial$ should work. The other two are custom commands, I fear. Maybe something like \newcommand{\pder}[2][]{\frac{\partial#1}{\partial#2}} for your preamble. – LaRiFaRi Mar 13 '15 at 17:38
  • 1
    @Hajnalka -- i transferred your code from a comment to the main text. (i added \begin{document}, which i believe had been omitted unintentionally.) even as a new user of tex.sx, though, you can always edit your own question, and that is the preferred way of responding to requests in comments. – barbara beeton Mar 13 '15 at 18:00
  • 1
    The problem is with the mathastext package. – erik Mar 13 '15 at 18:03
3

The problem arises because you're loading the mathastext package with the option LGRgreek. If you omit this option, the code compiles. If you really need the option LGRgreek, the manual suggests issuing the instruction MTstandardgreek ahead of equations that feature symbols such as \partial.

enter image description here

\documentclass[a4paper,11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[magyar]{babel}
\usepackage[LGRgreek]{mathastext}

\begin{document}
\begingroup % keep the effect of next instruction local
\MTstandardgreek
\begin{equation}
\partial{a}
\end{equation}
\endgroup
\end{document}
3

When using the LGRgreek option, mathastext package redefines \partial. You can either remove the option or reset \partial to its original definition by adding the following to your preamble.

\makeatletter
\let\partial\mst@origpartial
\makeatother

A simple MWE follows:

\documentclass[a4paper,11pt]{article}
\usepackage[LGRgreek]{mathastext}
\makeatletter
\let\partial\mst@origpartial
\makeatother
\begin{document}
\begin{equation}
\partial{a}
\end{equation}
\end{document}

Your Answer

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.