Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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}
share|improve this question
    
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
add comment

2 Answers

up vote 2 down vote accepted

Works fine for me

\documentclass{article}
\def\dbar{{\mathchar'26\mkern-12mu d}}
\begin{document}
abc $\dbar$
\end{document}
share|improve this answer
    
Same error with your snippet: Missing number, treated as zero. –  auxsvr Jul 25 '11 at 10:45
3  
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
add comment

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}
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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