4

In below minimum working example, I was able to configure the bodyfont in \setuptyping to 9.5pt. However, ConTeXt \setuptype documentation is not as detailed to explain me how I can achieve the same fine-grained control over the font size of the \type{} command.

For the moment I have helped myself with \setuptype[style=small]. I would rather like to specify the teletype (verbatim) font size in pt units or, even better, relatively to the main body font size. How can this be done?

Here is the current output of below MWE code: How to achieve fine-grained verbatim font size control?

\startmode[*mkii]
  \enableregime[utf-8]  
  \setupcolors[state=start]
\stopmode
\mainlanguage[en]

\setuptolerance[horizontal, tolerant, stretch]

% Enable hyperlinks
\setupinteraction[
  state=start,
  style=normal,
  color=darkred,
  contrastcolor=darkred
  ]

\setuppapersize [A4][A4]
\setuplayout    [width=middle,  backspace=1.5in, cutspace=1.5in,
                 height=middle, topspace=0.75in, bottomspace=0.75in]

\setuppagenumbering[location={footer,center}]

\usetypescript[pagella]
\setupbodyfont[pagella,12pt]
\setupbodyfontenvironment[12pt][
  d=28pt, % For title
  a=12pt, % For author & date
  ]
\setuptype[style=small]
\setuptyping[typing][bodyfont=9.5pt]

% Inter-paragraph spacing
\setupwhitespace[medium]

% Break at hyphens
\setbreakpoints[compound]

\setuphead[chapter]      [style=\bfd]
\setuphead[section]      [style=\bfc]
\setuphead[subsection]   [style=\bfb]
\setuphead[subsubsection][style=\bf]

\setupitemize[autointro]    % prevent orphan list intro
\setupitemize[indentnext=no]

\starttext
\section[adding-unstable-repositories]{Adding Unstable repositories}

Once \type{/etc/apt/preferences} is properly configured, it is safe to add the 
Debian Unstable repositories. This can either be done by directly
editing the file \type{/etc/apt/sources.list} or, more conveniently, by
adding the repositories via
\type{Settings > Repositories > Other Software} in the Synaptic Package
Manager.

\quotation{Repositories} is written in plural, simply because {\em the
source repository also needs to be included.} This is because a small 
minority of Debian packages are not pre-compiled and
require their source code in order to compile on your system.

{\em To optimise download speed, choose a nearby Unstable repository}
with the help of \useURL[url9][http://debgen.simplylinux.ch/][][the
Debian Sources List Generator]\from[url9]. In my case, being located in
Belgium, I added:

\starttyping
deb http://ftp.be.debian.org/debian unstable main contrib non-free
deb-src http://ftp.be.debian.org/debian unstable main contrib non-free
\stoptyping
\stoptext
  • 3
    \setuptype[style={\switchtobodyfont[6pt,tt]}] should work – Aditya Nov 26 '13 at 18:27
  • 1
    That works and the curly braces are indeed really necessary! Feel free to post it as an answer which I will happily approve. – Serge Stroobandt Nov 26 '13 at 21:24
4

Use:

\setuptype[style={\switchtobodyfont[6pt,tt]}]

Also see the excellent article on the ConTeXt wiki on style alternatives

  • 1
    A relative font size specification in em is even better as it will scale nicely in environments with altered bodyfont sizes. So, for example: \setuptype[style={\switchtobodyfont[tt,0.917em]}] – Serge Stroobandt Dec 17 '13 at 10:44

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.