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.

Possible Duplicate:
How can I draw a dot under a symbol in math mode?

I'm looking for the equivalent of the \textvbaraccent command for the math mode.

share|improve this question

marked as duplicate by Werner, Marco Daniel, Seamus, Stefan Kottwitz Jan 15 '12 at 23:00

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.

add comment

1 Answer

up vote 6 down vote accepted

With the same approach as in http://tex.stackexchange.com/a/38907/4427

\usepackage[T3,T1]{fontenc}
\DeclareSymbolFont{tipa}{T3}{cmr}{m}{n}
\DeclareMathAccent{\vbar}{\mathalpha}{tipa}{156}

\begin{document}
$\vbar{x}$
\end{document}

One has to consult the tipa package font tables to find out the right code. A useful package is fonttable:

\documentclass{article}
\usepackage{fonttable}
\begin{document}
\xfonttable{T3}{cmr}{m}{n}
\end{document}

However, the file t3enc.def has the entry

\DeclareTextCommand\textvbaraccent{T3}[1]%
  {\tipaupperaccent{156}{#1}}                    % Vertical Bar Accent

that tells the number to use.

In general, this approach is superior to the use of \text{\textvbaraccent{$x$}} that doesn't place the accent taking care correctly of the slant as can be seen in the following picture (left my definition, right the result of \text)

enter image description here

share|improve this answer
add comment

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