I am writing a tex file in Type-writing font, in following manner.






The problems I am facing is the following.

(1) While writing title "definition" with Bold-face letters and writing statements in definition with italic letters, the font was coming as perhaps roman font. So the whole statement was not coming as \tt font. What should be done then?

(2) The statements were non-uniformly printed in output pdf file, as below:

enter image description here

I want to remove space after word are in second line, ot after not in the third line. How can we overcome this?

Thanks in advance!

  • 5
    I think these "spaces" are the result of the \raggedright command which seems to do exactly what it is supposed to do.
    – Christian
    Dec 29, 2016 at 12:56
  • 1
    Concerning the fonts, I think the following answer might be of interest: tex.stackexchange.com/a/215483
    – Christian
    Dec 29, 2016 at 12:57

1 Answer 1


Typewriter fonts usually have spaces of fixed width, so the text will be ragged-right with and without using \raggedright. To change this, you have to modify the stretchability of interword spaces, using e.g. the package everysel.

Moreover, the standard typewriter font has no boldface. So, when doing


the default font will be tt, but boldface will look the same as normal text. To fix this you have to choose another typewriter font like beramono.

Here is a sample document.

enter image description here

  {\fontdimen2\font=0.4em% interword space
   \fontdimen3\font=0.2em% interword stretch
   \fontdimen4\font=0.1em% interword shrink
   \fontdimen7\font=0.1em% extra space
   \hyphenchar\font=`\-% to allow hyphenation


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .