Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

textbf in Verbatim (with fancyvrb)

2,427 views
Skip to first unread message

Inge.v...@gmail.com

unread,
Jul 5, 2006, 10:45:49 AM7/5/06
to
hi.

I am trying to get in boldface part of a text set in a verbatim
environment.
Somehow it does not want to do boldface. However, if I try it with
italics, it does work!

Here's what I do:

\DefineVerbatimEnvironment%
{example}{Verbatim}
{fontsize=\footnotesize}

\begin{example}[commandchars=+\[\]]
A +textbf[C T C A]
T G A G T
\end{example}

Also, if I change the text `+textbf' to `+textsf[+textbf[' the outcome
is indeed boldface, but in sf font, which I do not want.
What am I overlooking? Is there no bold for typewriter font?

Inge

Martin Heller

unread,
Jul 5, 2006, 10:52:40 AM7/5/06
to
Inge.v...@gmail.com skrev:

Not in CM. Try using courier as typewriter font.

\documentclass{article}
\usepackage{fancyvrb,courier}

\begin{document}


\DefineVerbatimEnvironment%
{example}{Verbatim}
{fontsize=\footnotesize}

\begin{example}[commandchars=+\[\]]
A +textbf[C T C A]
T G A G T
\end{example}

\end{document}

Ralf Stubner

unread,
Jul 5, 2006, 10:56:18 AM7/5/06
to
Martin Heller <mr_h...@yahoo.dk> writes:
> Inge.v...@gmail.com skrev:

>
>> What am I overlooking? Is there no bold for typewriter font?
>
> Not in CM. Try using courier as typewriter font.

And if you want a nice looking typewriter font try BeraMono or LuxiMono.
Both on CTAN, both comming with the usual four shapes.

cheerio
ralf

Lars Madsen

unread,
Jul 5, 2006, 12:22:14 PM7/5/06
to

txttt might also be an alternative, since at least luximono might be a bit dark
for CM

simply use

\renewcommand\ttdefault{txtt}

--

/daleif (remove RTFSIGNATURE from email address)

LaTeX FAQ: http://www.tex.ac.uk/faq
LaTeX book: http://www.imf.au.dk/system/latex/bog/ (in Danish)
Remember to post minimal examples, see URL below
http://www.tex.ac.uk/cgi-bin/texfaq2html?label=minxampl

Will Robertson

unread,
Jul 5, 2006, 1:20:38 PM7/5/06
to
Lars Madsen wrote:
> Ralf Stubner wrote:
> > Martin Heller <mr_h...@yahoo.dk> writes:
> >>Inge.v...@gmail.com skrev:
> >>
> >>>What am I overlooking? Is there no bold for typewriter font?
> >>
> >>Not in CM. Try using courier as typewriter font.
> >
> > And if you want a nice looking typewriter font try BeraMono or LuxiMono.
> > Both on CTAN, both comming with the usual four shapes.
> >
>
> txttt might also be an alternative, since at least luximono might be a bit dark
> for CM

The recent versions of the Latin Modern fonts have bold typewriter
fonts.
\usepackage{lmodern}
will do the trick, and as a bonus won't change the look (well,
negligibly if much) of your document while having a bold tt that
matches well your other text.

Will

Dan Luecking

unread,
Jul 5, 2006, 1:26:46 PM7/5/06
to
On Wed, 05 Jul 2006 18:22:14 +0200, Lars Madsen
<dal...@RTFSIGNATUREimf.au.dk> wrote:

>Ralf Stubner wrote:
>> Martin Heller <mr_h...@yahoo.dk> writes:
>>
>>>Inge.v...@gmail.com skrev:
>>>
>>>
>>>>What am I overlooking? Is there no bold for typewriter font?
>>>
>>>Not in CM. Try using courier as typewriter font.
>>
>>
>> And if you want a nice looking typewriter font try BeraMono or LuxiMono.
>> Both on CTAN, both comming with the usual four shapes.
>>
>> cheerio
>> ralf
>
>txttt might also be an alternative, since at least luximono might be a bit dark
>for CM
>
>simply use
>
>\renewcommand\ttdefault{txtt}


LuxiMono needs to be scaled to match the height of cmr. If one does
\usepackage[scaled=.87]{luximono}
there is not much difference between luximono and txtt in darkness.
Perhaps LuxiMono is even a bit lighter (and better quality, it seems).
Personally, I don't like either of the two with cmr (both are too
dark), but I think both work OK with Times as the body font. In
that case, I use luximono with the option scaled=.85.

BeraMono is also better with similar scaling (though I think it is
still too dark for cm). Even cmtt is too dark for cmr, while courier
seems too light.

Dan
To reply by email, change LookInSig to luecking

--
Posted via a free Usenet account from http://www.teranews.com

Will Robertson

unread,
Jul 5, 2006, 1:52:34 PM7/5/06
to
Dan Luecking wrote:
> Even cmtt is too dark for cmr, while courier
> seems too light.

Have you tried the light typewriter font in the Latin Modern
collection?
Given the above, it might be more to your taste. (I wrote about these
fonts earlier this year if you'd like a sample:
<http://www.tug.org/pracjourn/2006-1/robertson/>)

Will

Dan Luecking

unread,
Jul 5, 2006, 5:06:15 PM7/5/06
to
On 5 Jul 2006 10:52:34 -0700, "Will Robertson" <wsp...@gmail.com>
wrote:

>Dan Luecking wrote:
>> Even cmtt is too dark for cmr, while courier
>> seems too light.
>
>Have you tried the light typewriter font in the Latin Modern
>collection?

I have now. Not bad, but I'd prefer something between the
light and the medium.

Will Robertson

unread,
Jul 5, 2006, 8:37:28 PM7/5/06
to
Dan Luecking wrote:
> On 5 Jul 2006 10:52:34 -0700, "Will Robertson" <wsp...@gmail.com>
> wrote:
>
> I have now. Not bad, but I'd prefer something between the
> light and the medium.

I agree :)

Will

0 new messages