# Crossing a symbol like p, similar to one like hbar

I would like to cross a symbol like p, in math mode, similar to what we get for h by using \hbar, i.e. ꝑ (U+A751).

Picture in case of font problems: • How about $\not\! p$? – azetina May 12 '16 at 23:39
• What do you mean by "It should be clear where the cross should go on p"? \hbar has the [bar] running across the top due to the ascender in h. Should the [bar] run across the bottom in a p due to the descender? – Werner May 12 '16 at 23:41
• @Werner yes i think the OP must surely be picturing a p with a stroke through the vertical line, much as with ħ, or in other words, like ƀ reflected in the baseline. Here it is: ꝑ U+A751 – Au101 May 13 '16 at 0:02
• @Werner, yes, that is what I want. – passerby51 May 13 '16 at 1:21
• @azetina, this gives a diagonal cross over the whole symbol. I want a horizontal line across the bottom as in Au101 comment. – passerby51 May 13 '16 at 1:23

Something similar has been defined by @egreg in this post. But here is a customized command:

\newcommand{\pbar}{\lower1.5ex\hbox{$\mathchar'26$}\mkern-6mu p}


Here is mwe: \documentclass{article}
\newcommand{\pbar}{\lower1.5ex\hbox{$\mathchar'26$}\mkern-6mu p}
\begin{document}
$\pbar$ {\large$\pbar$} {\huge$\pbar$}
\end{document}


Here is another take at the symbol. The extra horizontal space can be addressed with a \!. The vertical space has been accounted for by keeping the original height and setting the depth to 0pt.

\newcommand{\pbar}{\raisebox{-1.5ex}[\height][0pt]{$\mathchar'26$}\mkern-6mu p}

• thanks. This seems good. A minor issue is that there is extra space before the symbol. Try for example \log \pbar. – passerby51 May 13 '16 at 16:36
• Also, extra space below it seems: Try \frac{\log \pbar}{n} – passerby51 May 13 '16 at 16:45
• @passerby51 See the updated code. Alternatively there exists the \smash command. – azetina May 13 '16 at 17:23

The symbol has a Unicode code point:

U+A751 LATIN SMALL LETTER P WITH STROKE THROUGH DESCENDER


There are some (at least) text fonts, which do provide the symbol. Example for LuaTeX/XeTeX:

\documentclass{article}
\usepackage{booktabs}
\usepackage{fontspec}
\newfontfamily\DejaVuSans{DejaVu Sans}
\newcommand*{\Rows}{}
\makeatletter
\newcommand*{\TestFamily}{%
\expandafter\newfontfamily\csname FONT@#1\endcsname{#1}%
}
\newcommand*{\TestSingle}{%
\expandafter\newfontfamily\csname FONT@#1\endcsname{#1}%
}
\newcommand*{\RowFamily}{%
#1 & \csname FONT@#1\endcsname\symbol{"A751}
& \csname FONT@#1\endcsname\bfseries\symbol{"A751}
& \csname FONT@#1\endcsname\itshape\symbol{"A751}
& \csname FONT@#1\endcsname\bfseries\itshape\symbol{"A751}
\tabularnewline
}
\newcommand*{\RowSingle}{%
#1 & \csname FONT@#1\endcsname\symbol{"A751}
\tabularnewline
}
\TestFamily{DejaVu Sans}
\TestSingle{Quivira}
\TestFamily{Segoe UI}
\TestFamily{FreeSerif}
\makeatother
\begin{document}
\begin{tabular}{lllll}
\toprule
Name & Regular & Bold & Italic & Bold Italic\\
\midrule
\Rows
\bottomrule
\end{tabular}
\end{document} The symbol could then be used inside math via \text{\symbol{"A751}} (package amstext or amsmath).

• à propos DejaVu Sans: with current TL2016, LuaTeX 0.95 + luaotfload end up using the Condensed font. Not the case with TL2015 or xelatex. – user4686 May 13 '16 at 18:17

The width of the bar is 9mu, so we need such amount of back up.

Here's a version that works also in sub/superscripts and has no spacing issues.

\documentclass{article}
\usepackage{amsmath}

\makeatletter
\DeclareRobustCommand{\pbar}{\mathord{%
\text{$\m@th\mkern-2mu\raisebox{-1.5ex}[0pt][0pt]{$\mathchar'26$}\mkern-7mu p$}%
}}
\makeatother

\begin{document}
$a\pbar_{\pbar_{\pbar}}\hbar$

$ap$

\end{document} • I was working on the horizontal spacing when I saw your post. Great job at addressing the extra spaces. – azetina May 13 '16 at 17:47
• Can you add this link just as reference to what \m@th does and what it is? tex.stackexchange.com/a/153398/10898 – azetina May 14 '16 at 16:06
{"ft_lang_label":"__label__en","ft_lang_prob":0.6535174,"math_prob":0.74811184,"size":3397,"snap":"2020-24-2020-29","text_gpt3_token_len":1188,"char_repetition_ratio":0.109932214,"word_repetition_ratio":0.13921113,"special_character_ratio":0.30674124,"punctuation_ratio":0.09917355,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.96051097,"pos_list":[0,1,2,3,4,5,6,7,8],"im_url_duplicate_count":[null,2,null,2,null,2,null,2,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-05-30T08:31:41Z\",\"WARC-Record-ID\":\"<urn:uuid:29cade0a-470b-4b50-90a0-2351b04c0c51>\",\"Content-Length\":\"166814\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:d1ad1395-bf30-4880-8a08-a75a39a19972>\",\"WARC-Concurrent-To\":\"<urn:uuid:2f3265f1-47ed-45f1-9f2c-f0f8c32ec3af>\",\"WARC-IP-Address\":\"151.101.1.69\",\"WARC-Target-URI\":\"https://tex.stackexchange.com/questions/309349/crossing-a-symbol-like-p-similar-to-one-like-hbar\",\"WARC-Payload-Digest\":\"sha1:RXA7XOHVQQZZNEBOMJ7BIDJOV5PQNRMJ\",\"WARC-Block-Digest\":\"sha1:2MALFRQREZMVQJ65H2JIFLQM7RFUW7GS\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-24/CC-MAIN-2020-24_segments_1590347407667.28_warc_CC-MAIN-20200530071741-20200530101741-00262.warc.gz\"}"}