1

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

\documentclass[a4paper,11pt]{amsart}

\begin{document}

\ttfamily\raggedright

 ...........


\end{document}

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 '16 at 12:56
  • 1
    Concerning the fonts, I think the following answer might be of interest: tex.stackexchange.com/a/215483 – Christian Dec 29 '16 at 12:57
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

\renewcommand{\familydefault}{\ttdefault}

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

\documentclass{amsart}
\usepackage[T1]{fontenc}
\usepackage[scaled=0.85]{beramono}
\usepackage{everysel}
\EverySelectfont
  {\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
  }
\renewcommand{\familydefault}{\ttdefault}
\AtBeginDocument{\selectfont}
\newtheorem{definition}{Definition}
\usepackage{blindtext}
\begin{document}
\blindtext
\begin{definition}
  \blindtext
\end{definition}
\end{document}

References:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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