[texhax] highly condensed font in a figure

Neal H. Walfield neal at walfield.org
Mon Mar 14 17:58:32 CET 2016


On Mon, 14 Mar 2016 17:44:59 +0100,
Paul Gessler wrote:
> You just need to re-select \ttfamily inside the figure environment:

Thanks!  This worked for me!

:) Neal

> 
> \begin{figure}
> {\ttfamily\small\fontseries{lc}\selectfont
>   \lipsum[1]}
> \caption{Figure}
> \end{figure}
> 
> Without this, the font selected inside the figure reverts to the
> normal document font, Latin Modern Roman (lmr), which does not provide
> a light condensed (lc) series. Note the font substitution warning
> produced:
> 
> LaTeX Font Warning: Font shape `T1/lmr/lc/n' undefined
> (Font)              using `T1/lmr/m/n' instead on input line 14.
> 
> Hope this helps,
> 
> PG
> 
> On Mon, Mar 14, 2016 at 11:21 AM, Neal H. Walfield <neal at walfield.org> wrote:
> > Hi,
> >
> > I need to display a short code listing in a paper that I'm working on.
> > Since I don't have much space, I figured I'd try to use a highly
> > condensed font.  I found the following question on stack exchange,
> > which looked promising:
> >
> >   https://tex.stackexchange.com/questions/47489/looking-for-monospaced-condensed-font
> >
> > Unfortunately, it doesn't work for me in a figure (MWE follows).  I
> > have no idea why and my search engine foo has failed me.  Any ideas?
> >
> > Thanks in advance!
> >
> > :) Neal
> >
> > \documentclass{article}
> >
> > \usepackage[T1]{fontenc}
> > \usepackage{lmodern}
> > \usepackage{lipsum}
> >
> > \begin{document}
> > \ttfamily\lipsum[1]
> >
> > {\small\fontseries{lc}\selectfont
> > \lipsum[1]}
> >
> > \begin{figure}
> > {\small\fontseries{lc}\selectfont
> >   \lipsum[1]}
> > \caption{Figure}
> > \end{figure}
> >
> > \end{document}
> > _______________________________________________
> > TeX FAQ: http://www.tex.ac.uk/faq
> > Mailing list archives: http://tug.org/pipermail/texhax/
> > More links: http://tug.org/begin.html
> >
> > Automated subscription management: http://tug.org/mailman/listinfo/texhax
> > Human mailing list managers: postmaster at tug.org
> 


More information about the texhax mailing list