Fonts & Character SetsCourier font looks weird in Latex

Information and discussion about fonts and character sets (e.g. how to use language specific characters)
Post Reply
MetaBrain
Posts: 2
Joined: Fri May 21, 2010 12:39 pm

Courier font looks weird in Latex

Post by MetaBrain »

Hi, I'm trying to make a macro to post OCL Invariants (http://www.pst.informatik.uni-muenchen. ... l:2001.pdf @ page 2), but my Courier fonts looks rather different (more squashed in my .tex) from the paper. Any clue to why is that?

Code: Select all

\usepackage{courier} % tt
\newcommand{\subscript}[1]{\ensuremath{_{\textrm{#1}}}}

\newcommand{\helvetica}[1]{\fontfamily{phv}\selectfont{\small{{#1}}}}

\newcommand{\OCL}[2]{
\texttt{\normalsize{
\begin{tabbing}
context {#1}\\
	\hspace{14pt} inv {\bf{\textit{Inv'}}}\subscript{\helvetica{{#1}}}{\bf{:}}\\     
		\hspace{28pt} {#2}\\
\end{tabbing}
}}
}
(Also as a side note, my subscript looks rather "artificial". Dunno how to fix it.)

Thanks in advance :)
Cheers,
Daniel

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
Montag
Posts: 340
Joined: Wed Jul 15, 2009 9:25 am

Courier font looks weird in Latex

Post by Montag »

Seriously, and this is only meant as a friendly advice, please read the section 2.2 Building an example. :)
OS: Win 7 64-bit LaTeX: MikTeX 2.9 64-bit Editor: TXC 1 RC1
User avatar
localghost
Site Moderator
Posts: 9201
Joined: Fri Feb 02, 2007 12:06 pm

Courier font looks weird in Latex

Post by localghost »

Just another remark beside the note of enrico. The linked document uses system fonts because the Courier font is not embedded. Therefore the appearance can differ from that of the courier font package. In my eyes this font simply looks ugly. So I'd prefer inconsolata or luximono.


Best regards and welcome to the board
Thorsten
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes[/size]

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
MetaBrain
Posts: 2
Joined: Fri May 21, 2010 12:39 pm

Re: Courier font looks weird in Latex

Post by MetaBrain »

I'm using inconsolata now and it looks pretty :)

Thanks for the help, I'll try make cleaner posts from now on :oops:
Post Reply