4

This question already has an answer here:

I am looking for the syntax of the $d$ with the apostrophe, as in the picture. enter image description here

I tried at wiki's help page but wouldn't find.

Any suggestions?

marked as duplicate by egreg, Zarko, user13907, David Carlisle, Martin Schröder Dec 8 '15 at 23:58

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Do you mean the "crossed d": đ? Also known as "d with stroke"? Generally you should try detexify or one of the alternative suggestions here. However, admittedly, they probably wouldn't have helped you this time, you need the answer below – Au101 Dec 8 '15 at 21:08
  • I'd use \delta as Wikipedia and every textbook I know of does. – Henri Menke Dec 8 '15 at 21:08
  • 2
    @HenriMenke: I remember to have seen this symbol in Thermodynamics being used in older textbooks, Landau , I think – user31729 Dec 8 '15 at 21:12
5

I don't know whether there is a symbol already like that, but I stole the definition of \hbar and changed it al little bit.

\documentclass{article}

\newcommand{\dbar}{{\mathchar '26\mkern -11.5mud}}

\begin{document}
$d U = \dbar Q + \dbar W$
\end{document}

enter image description here

  • There is in text mode, with T1 font encoding (\dj). TIPA also has the character. But Detexify couldn't find me a math mode version – Au101 Dec 8 '15 at 21:10
  • @Au101: Thanks, I did not know that. – user31729 Dec 8 '15 at 21:11
  • And where's the spacing left of the crossed d? – egreg Dec 8 '15 at 22:25
5

The definition proposed in the Comprehensive list is completely wrong, I'm afraid.

The proposed definition is

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

but this applies too wide a backspace, considering that 9mu is the width of the bar.

Here's a possibly better one that doesn't suffer from the backspacing problem.

\documentclass{article}

\newcommand{\dbar}{{d\mkern-7mu\mathchar'26\mkern-2mu}}

\begin{document}

$d\dbar d$

$h\hbar h$

\end{document}

enter image description here

For your particular application you need a couple of tricks more:

\documentclass{article}
\usepackage{amsmath}

\newcommand{\dbar}{{d\mkern-7mu\mathchar'26\mkern-2mu}}

\begin{document}

\[
dU = \underbrace{\dbar Q}_{\scriptscriptstyle\text{Heat}} +
     \underbrace{\dbar W\vphantom{Q}}_{\scriptscriptstyle\text{\hspace{-1.5em}Mech.\,Work\hspace{-1.5em}}}
\]

\end{document}

enter image description here

3

I found at page 210 of The Comprehensive LATEX Symbol List that barred d can be achieved as:

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

Indeed one way to sketch the equation above is:

\documentclass{article}
\usepackage{amsmath}

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

\begin{document}
\[
d U = \underbrace{\dbar Q}_{\text{Heat}} + \underbrace{\dbar W}_{\text{Mech. Work}}
\]
\end{document}
  • 1
    I know it's wrong in the question, but you should really use \text{Heat} (and the same for Work, obviously) - or, if italics is desired, \mathit{Heat}, in order to achieve the correct spacing. Generally words should be set as text and upright, but italics may be desired for whatever reason (\textit{} may be preferable for italics, actually). This will also give a proper space in Mech. Work, although if in text mode, you'll need Mech.\ Work otherwise you'll get a sentence-ending space – Au101 Dec 8 '15 at 21:31
  • 1
    I assume you're not loading amsmath? \text{} is only defined in amsmath, otherwise it's good old \mathrm{}, \textrm{} or - the old standby that was generally preferred - \mbox{}. Probably could've done with mentioning that in my comment, to be fair :) – Au101 Dec 9 '15 at 18:00
  • @Au101 Indeed I wasn't... Thank you again for the improvements! (I didn't want to cheat over an upvoted answer...despite the other answers are far more accurate and this thing in particular is a bit "off topic" as - I think - the question was more focused on the "dbar" fact) Anyway, great ;) – MattAllegro Dec 9 '15 at 18:11
2

It is described in The LaTeX Comprehensive Symbol List. Here is the full example:

\documentclass{article}
\usepackage[utf8]{inputenc}
 \usepackage{mathtools}
\def\dbar{{\mkern3mu\mathchar'26\mkern-12mu d}}

\begin{document}

 \[ dU = \underbrace{\dbar Q}_\text{Heat} \mskip6mu + \mskip6mu\underbrace{\dbar W\vphantom{Q}}_\text{\clap{Mech.\,Works}}\]%

\end{document} 

enter image description here

  • Can you see the wrong spacing? – egreg Dec 8 '15 at 22:40
  • @egreg: Not really. For the + sign? – Bernard Dec 8 '15 at 22:49
  • 1
    Look closely at the placement of “dQ” with respect to the underbrace. Every usage of \dbar contributes 3mu of negative space. – egreg Dec 8 '15 at 22:55
  • Oh! Yes. I didn't even think of checking that. Thank you the tip, I've corrected the code. How comes it's -3mu? Is it linked to the fact that for \hbar one uses mkern -9muinstead of -12mu? – Bernard Dec 8 '15 at 23:08
  • See tex.stackexchange.com/a/253108/4427 (same code provided some months ago). – egreg Dec 8 '15 at 23:10

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