# How to enter symbol for inexact differential in xelatex?

The LaTeX symbol list document recommends this:

\def\dbar{{\mathchar’26\mkern-12mu d}}


Compiling this gives an error about mathcar being undefined.

A minimal example follows:

\documentclass[a4paper,11pt]{scrbook}
\def\dbar{{\mathchar’26\mkern-12mu d}}

\author{asd}
\title{asd}
\begin{document}
\maketitle

$\dbar Q = d U + \dbar W$

\end{document}

-
The error message changes if I enter the \def in the preamble instead of a different file to "Missing number, treated as zero". –  auxsvr Jul 25 '11 at 10:33
\newcommand{\dbar} {\ensuremath{\,\mathchar'26\mkern-12mu d}} also preserves the space before dbar. –  auxsvr Jul 25 '11 at 12:48

Works fine for me

\documentclass{article}
\def\dbar{{\mathchar'26\mkern-12mu d}}
\begin{document}
abc $\dbar$
\end{document}

-
Same error with your snippet: Missing number, treated as zero. –  auxsvr Jul 25 '11 at 10:45
Make sure that you use the correct apostroph (use the one above the slash key on your keyboard). Or enter the number as decimal instead of octal (\mathchar22). –  Ulrike Fischer Jul 25 '11 at 10:50
Thanks, that did it. Copy-paste from the PDF document copied the wrong apostroph. –  auxsvr Jul 25 '11 at 10:59
Another problem now. Using fontspec, dbar turns into a d. Any ideas? –  auxsvr Jul 25 '11 at 11:10
Setting option no-math fixed this. –  auxsvr Jul 25 '11 at 12:36

Since you mention xelatex in your question I assume that you want a unicode-type solution to your problem.

This works for me:

\documentclass{article}
\usepackage{amsmath}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\begin{document}
đ $\text{đ}$
\end{document}

-