4

I have two questions:

1.If I change the font to \ttfamily the text do not stop at margin, without \ttfamily it works fine 2.If I exclude the package "graphicx" I get with pdflatex a4 page with my text, but I just want my page with width=14.5cm and height=10.5. I do not understand, why this package change my papersize?

I hope, someone can help me :)

\documentclass[12pt,
          paper=14.5cm:10.5cm,
          ]{scrartcl}
\areaset{13cm}{9cm}

\usepackage{courier}
\usepackage{graphicx}

%---- Kein Zeileneinzug
\parindent0mm

\newcommand{\highlight}[1]{{\color{red}\textbf{#1}}}

\begin{document}

\ttfamily

Sei $M \subseteq G$ eine beliebige Teilmenge einer Gruppe $G$. Mit $\langle M \rangle$         bezeichnen wir die kleinste Untergruppe von $G$ welche $M$ enthlt. $\langle M \rangle $     heit die erzeugte Untergruppe von $M$ in $G$. Falls $\langle M \rangle = G$ gilt, dann sagen wir: $G$ wird von $M$ erzeugt. 

\end{document}
6
  • 1
    The wrong page size seems a bug in Koma-Script; it's solved either by loading graphicx or \usepackage[pass]{geometry}. Typewriter type fonts usually inhibit hyphenation and the font loaded with \usepackage{courier} is one of those that do.
    – egreg
    Commented Jul 17, 2014 at 13:01
  • 1
    @egreg: It is not a bug. You must use the option pagesize if you want that KOMA sets the pdf pagesize. Commented Jul 17, 2014 at 13:03
  • @UlrikeFischer: if I use the option pagesize=14.5cm:10.5cm the shown page is still a4 ...
    – DerJFK
    Commented Jul 17, 2014 at 13:07
  • @UlrikeFischer It's a bug nonetheless, in my opinion: the classes should do pagesize=auto unless an explicit pagesize option is issued. ;-)
    – egreg
    Commented Jul 17, 2014 at 13:16
  • 2
    @egreg: I don't think that a documented decision regarding the default behaviour should be called a bug ;-). Commented Jul 17, 2014 at 13:24

1 Answer 1

5

Monospaced fonts usually set up two features:

  1. no hyphenation, and
  2. no stretching or shrinking of the interword spaces.

Courier, selected by \usepackage{courier} is no exception. The reason is that enabling hyphenation or flexible interword space would have undesired effects on listings, which are the main use for monospaced fonts.

Moreover, long texts in a monospaced font are hard to read (and, of course, math fonts will clash with the text font).

However, if you want to experiment, here's a workaround:

\documentclass[
  12pt,
  paper=14.5cm:10.5cm,
  pagesize=auto,
]{scrartcl}
\areaset{13cm}{9cm}
\usepackage[ngerman]{babel}

\renewcommand{\ttdefault}{pcr} % this is what \usepackage{courier} does

% a copy of ot1pcr.fd with changes for the interword spacing
\DeclareFontFamily{OT1}{pcr}{%
  \fontdimen3\font1.67\fontdimen6\font
  \fontdimen4\font1.11\fontdimen6\font
}
\DeclareFontShape{OT1}{pcr}{m}{n}{<-> pcrr7t}{}
\DeclareFontShape{OT1}{pcr}{m}{sc}{<-> pcrrc7t}{}
\DeclareFontShape{OT1}{pcr}{m}{sl}{<-> pcrro7t}{}
\DeclareFontShape{OT1}{pcr}{b}{n}{<-> pcrb7t}{}
\DeclareFontShape{OT1}{pcr}{b}{sc}{<-> pcrbc7t}{}
\DeclareFontShape{OT1}{pcr}{b}{sl}{<-> pcrbo7t}{}
\DeclareFontShape{OT1}{pcr}{m}{it}{<->ssub * pcr/m/sl}{}
\DeclareFontShape{OT1}{pcr}{bx}{n}{<->ssub * pcr/b/n}{}
\DeclareFontShape{OT1}{pcr}{bx}{sc}{<->ssub * pcr/b/sc}{}
\DeclareFontShape{OT1}{pcr}{bx}{sl}{<->ssub * pcr/b/sl}{}
\DeclareFontShape{OT1}{pcr}{b}{it}{<->ssub * pcr/b/sl}{}
\DeclareFontShape{OT1}{pcr}{bx}{it}{<->ssub * pcr/b/it}{}
\DeclareFontShape{OT1}{pcr}{m}{ui}{<->ssub * pcr/m/it}{}
\DeclareFontShape{OT1}{pcr}{b}{ui}{<->ssub * pcr/b/it}{}
\DeclareFontShape{OT1}{pcr}{bx}{ui}{<->ssub * pcr/b/it}{}
%%% end of font declarations

%---- Kein Zeileneinzug
\parindent0mm

\newcommand{\highlight}[1]{{\color{red}\textbf{#1}}}

\begin{document}

\ttfamily

Sei $M \subseteq G$ eine beliebige Teilmenge einer Gruppe $G$. Mit $\langle M \rangle$ bezeichnen wir 
die kleinste Untergruppe von $G$ welche $M$ enthlt. $\langle M \rangle $ heit die erzeugte Untergruppe 
von $M$ in $G$. Falls $\langle M \rangle = G$ gilt, dann sagen wir: $G$ wird von $M$ erzeugt.

\end{document}

The page size problem is solved by giving the pagesize=auto option.

enter image description here

Here's the version for T1 encoded fonts, which is recommended for German.

\documentclass[
  12pt,
  paper=14.5cm:10.5cm,
  pagesize=auto,
]{scrartcl}
\areaset{13cm}{9cm}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}

\renewcommand{\ttdefault}{pcr}

\DeclareFontFamily{T1}{pcr}{%
  \fontdimen3\font1.67\fontdimen6\font
  \fontdimen4\font1.11\fontdimen6\font
}
\DeclareFontShape{T1}{pcr}{m}{n}{<-> pcrr8t}{}
\DeclareFontShape{T1}{pcr}{m}{sc}{<-> pcrrc8t}{}
\DeclareFontShape{T1}{pcr}{m}{sl}{<-> pcrro8t}{}
\DeclareFontShape{T1}{pcr}{b}{n}{<-> pcrb8t}{}
\DeclareFontShape{T1}{pcr}{b}{sc}{<-> pcrbc8t}{}
\DeclareFontShape{T1}{pcr}{b}{sl}{<-> pcrbo8t}{}
\DeclareFontShape{T1}{pcr}{m}{it}{<->ssub * pcr/m/sl}{}
\DeclareFontShape{T1}{pcr}{bx}{n}{<->ssub * pcr/b/n}{}
\DeclareFontShape{T1}{pcr}{bx}{sc}{<->ssub * pcr/b/sc}{}
\DeclareFontShape{T1}{pcr}{bx}{sl}{<->ssub * pcr/b/sl}{}
\DeclareFontShape{T1}{pcr}{b}{it}{<->ssub * pcr/b/sl}{}
\DeclareFontShape{T1}{pcr}{bx}{it}{<->ssub * pcr/b/it}{}

%---- Kein Zeileneinzug
\parindent0mm

\newcommand{\highlight}[1]{{\color{red}\textbf{#1}}}

\begin{document}

\ttfamily

Sei $M \subseteq G$ eine beliebige Teilmenge einer Gruppe $G$. Mit $\langle M \rangle$ bezeichnen wir 
die kleinste Untergruppe von $G$ welche $M$ enthält. $\langle M \rangle $ heit die erzeugte Untergruppe 
von $M$ in $G$. Falls $\langle M \rangle = G$ gilt, dann sagen wir: $G$ wird von $M$ erzeugt.

\end{document}

enter image description here

0

You must log in to answer this question.

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