Text FormattingC# notation

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
krislodz
Posts: 42
Joined: Sun Nov 08, 2009 1:13 pm

C# notation

Post by krislodz »

Hello,

Is there any sign that is similar to the C# sign from for example here:
http://en.wikipedia.org/wiki/C_Sharp_(p ... _language)

I used both \# and $\sharp$ and they do not resemble the original.

Kris

Recommended reading 2024:

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

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

User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

C# notation

Post by frabjous »

What the \sharp sign looks like depends on the font. Try, e.g.:

\usepackage{arev}

as in:

Code: Select all

\documentclass{article}
\usepackage{arev}
\begin{document}
C$\sharp$
\end{document}
Is there a particular font you want?
krislodz
Posts: 42
Joined: Sun Nov 08, 2009 1:13 pm

Re: C# notation

Post by krislodz »

This solution does not make the document look good. Its strange that there is no similar sign in the list of symbols.

Kris
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

C# notation

Post by frabjous »

It wasn't meant to be a solution; just a demonstration that what the sign looks like depends on the font used. That’s why I followed it up with asking what font you wanted. If you wanted the sharp from arev with standard Computer/Latin modern fonts, you could do:

Code: Select all

\documentclass{article}
% define \mysharp using the arev package
\usepackage{arev}
\newsavebox{\sharpbox}
\sbox{\sharpbox}{$\sharp$}
\newcommand{\mysharp}{\usebox{\sharpbox}}

% switch back to Latin Modern
\usepackage{lmodern}

\begin{document}
C\mysharp
\end{document}
krislodz
Posts: 42
Joined: Sun Nov 08, 2009 1:13 pm

Re: C# notation

Post by krislodz »

I use sans serif font for this document. I got an error "Corrupted NFSS tables" when I use this example.

Kris
Post Reply