Fonts & Character SetsSmall horizontal Bar through Character

Information and discussion about fonts and character sets (e.g. how to use language specific characters)
Post Reply
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

Small horizontal Bar through Character

Post by Cham »

How can I print a small horizontal bar on the middle of a letter (symbol) in math mode?

I searched the net but didn't found any yet. Do I need a special package just for this?

Actually, I just need to put a bar through a capital "i".

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Re: Small horizontal Bar through Character

Post by localghost »

What you are searching for is the "Latin capital letter I with stroke". It exists as the Unicode character "Ɨ" (U+0197). But this probably needs XeLaTeX.


Thorsten
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

Re: Small horizontal Bar through Character

Post by Cham »

Well, the capital "i" is oblique in math mode. It should be the same (style and font), but with a bar through it. So your suggestion doesn't do it.
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Small horizontal Bar through Character

Post by cgnieder »

How's this:

Code: Select all

\documentclass{article}
\makeatletter
\newcommand\stroke[1]{\mathpalette\stroke@aux{#1}}
\def\stroke@aux#1#2{%
  \ooalign{%
    \hfil$#1-$\hfil\cr
    \hfil$#1#2$\hfil\cr
  }%
}
\makeatother
\newcommand\Istroke{\stroke{I}}
\begin{document}

$\Istroke$

\end{document}
Regards
site moderator & package author
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

Small horizontal Bar through Character

Post by Cham »

It's working.

However, I'm not sure anymore that's what I want for my symbol. I need to look out in the litterature what symbol should I use for the radial inertia moment, defined as half the trace of the inertia tensor. Any idea on this ?
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Small horizontal Bar through Character

Post by localghost »

Cham wrote:[…] I need to look out in the litterature what symbol should I use for the radial inertia moment, defined as half the trace of the inertia tensor. […]
A common symbol for this is a simple capital "I". But I have also seen a "J" and the Greek capital "Θ" (Theta). At least in Germany we use this notation.
Post Reply