Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

This refers to my previous question

not able to write bold characters using textbf

I installed the cm-extra font package but still there is a problem with boldface due to \usepackage[english,russian]{babel}.

\documentclass[11pt,table,a4paper]{article}
\usepackage{bold-extra}
\usepackage[T1,T2A]{fontenc}
\usepackage{CJKutf8}
\usepackage[english,russian]{babel}
\usepackage{fancyvrb}
\usepackage{myboldtt}
\def\n{\textbackslash n}
\begin{document}
  Regular text. \textbf{Bold}.
\begin{Verbatim}[commandchars=\\\{\}]
%chunk = 1
<<echo=FALSE,results=tex>>=
cat("dataset","\n")
cat("\textbf{dataset}","\n")   # it should be bold 
@
\end{Verbatim}
\end{document}

Please help me out in fixing this problem as I'm in great need.

share|improve this question
add comment

1 Answer

The problem is that the cm-super-fonts don't provide a bold typewriter font. But the lmodern fonts do but only for T1-encoding. So you should temporarly switch the font encoding to T1 (or the language to english). On the other side the lmodern font don't provide a bold T2A-font (needed for the regular text). So you should switch only the typewriter font e.g. to lmodern or to the luximono fonts (which have a more distinctive bold version):

\documentclass[11pt,table,a4paper]{article}
\usepackage[T1,T2A]{fontenc}
\usepackage[english,russian]{babel}
\usepackage{fancyvrb}
%typewriter is lmodern:
\renewcommand\ttdefault{lmtt}
%Alternative:
%\usepackage[scaled]{luximono}

\def\n{\textbackslash n}
\begin{document}
Regular text. \textbf{Bold}.

\begingroup
\fontencoding{T1}\selectfont
\begin{Verbatim}[commandchars=\\\{\}]
%chunk = 1
<<echo=FALSE,results=tex>>=
cat("dataset","\n")
cat("\textbf{dataset}","\n")   # it should be bold
@
\end{Verbatim}
\endgroup
\end{document}
share|improve this answer
    
I used above code still same pblm. –  Manish Dec 7 '12 at 1:43
    
@Manish: Did you use exactly my code or some adaption? In the first case: Put the log-file and the pdf somewhere for inspection. –  Ulrike Fischer Dec 7 '12 at 9:10
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.