4

I am looking for a solution to create "poor man's condensed" with pdflatex. Here I found an answer that works with XeTeX, however it uses package fontspec, but I need something for pdflatex. And as in the referenced question, wrapping the condensed stuff with, say, \scalebox{0.9}[1] is not an option as I need the condensed text to allow linebreaking ...

In case it helps: I am using the mycrotypepackage anyway and from reading its documentation I understand that it uses ad hoc condensing and widening per line behind the scenes, so I guess something should be possible somehow.

\documentclass{article}
\def\textcondensed#1{\scalebox[0.9]{1}{#1}} % This is almost fine, except line breaking

\begin{document}
This is just some normal text, but the latin phrase
\textcondensed{lorem ipsum dolor sit amet}
that it contains is typeset in condesed.
\end{document}
  • What's "condensed"? – jub0bs Nov 25 '13 at 18:12
  • 1
    @Jubobs Letters should keep their heights but become slightly smaller horizontally (e.g. if big O is a circle it should become more elliptical). A proper (not poor man's) condensed font would make considerations for stroke witdths etc., but for not so strong condensing something "mechanical" should suffice. – Hagen von Eitzen Nov 25 '13 at 18:19
  • 1
    seems like an accident news headline – percusse Nov 25 '13 at 18:28
  • If you're installing fonts yourself, otftotfm offers an option --extend which you can set to a value below 1. – Stephan Lehmke Nov 25 '13 at 19:00
  • @percusse I see your point, poor man indeed :) – Hagen von Eitzen Nov 25 '13 at 19:04
  • @StephanLehmke Would you care to elaborate? I must admit I'm always getting lost between all those files making up a font (.pfb, .vf, .afm, .tfm, .map, .fd) and their interdependencies ... – Hagen von Eitzen Nov 25 '13 at 21:16
  • See this answer on installing fonts, which works for ttf and otf fonts. As the tool otftotfm used for this does almost all of the work and allows to "make" a condensed font by just adding an option, this wouldn't be a lot of work. – Stephan Lehmke Nov 25 '13 at 21:38
  • Why not just use a font which has a condensed variant and is already configured for use with pdflatex? I think I'm missing something here... (Maybe you must use a particular font? Or...?) – cfr Dec 12 '13 at 02:53

1 Answers1

1

Here is a poor solution via microtype (the last line of a paragraph is problematic):

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage[T1]{fontenc}
\usepackage[selected=true]{microtype}
\usepackage{lipsum}

\SetExpansion
   [ context = poorcondensed,
     stretch = -100,
     shrink = 100,
     step    = 1 ]
   { encoding = {OT1,T1,TS1} }
   { }

\begin{document}
\lipsum[1-2]

{\microtypecontext{expansion=poorcondensed}%
 \lipsum[1-2]}

\end{document}
Paul Gaborit
  • 70,770
  • 10
  • 176
  • 283