我使用 TexMaker 创建报告。但是当我查看创建的 PDF 文件时,没有粗体文本。如何解决此问题?
\bfseries{Lorem ipsum dolor} \textit{sit amet}, consectetuer adipiscing elit.
\documentclass[a4paper, 14pt]{extreport}
\usepackage{indentfirst}
\usepackage{fncychap}
\usepackage{fancyhdr}
\usepackage[warn]{mathtext}
\usepackage[T2A]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{tabularx}
\usepackage[english,russian]{babel}
\usepackage{amssymb,amsfonts,amsmath,mathtext,cite,enumerate,float, mathtext}
\usepackage{times}
\usepackage[demo]{graphicx} %pdftex
\graphicspath{{images/}}
\usepackage[format=hang, figurename=Малюнак, tablename=Табліца , labelfont=bf,tableposition=top, labelsep=space, singlelinecheck=false]{caption}
\usepackage{blindtext}
\usepackage{titlesec}
\usepackage{enumitem}
\usepackage{marginnote}
\usepackage{ltablex}
\makeatletter
\renewcommand{\@biblabel}[1]{#1.}
\makeatother
\usepackage{geometry}
\geometry{left=3cm}
\geometry{right=1.5cm}
\geometry{top=2cm}
\geometry{bottom=2cm}
\renewcommand{\theenumi}{\arabic{enumi}}%
\renewcommand{\labelenumi}{\arabic{enumi}}%
\renewcommand{\theenumii}{.\arabic{enumii}}%
\renewcommand{\labelenumii}{\arabic{enumi}.\arabic{enumii}.}%
\renewcommand{\theenumiii}{.\arabic{enumiii}}%
\renewcommand{\labelenumiii}{\arabic{enumi}.\arabic{enumii}.\arabic{enumiii}.}%
\addto\captionsrussian{
\renewcommand{\contentsname}%
{\centerline{ЗМЕСТ\vspace{14pt}}}%
\renewcommand{\bibname}
{\centerline{СПІС ВЫКАРЫСТАНЫХ КРЫНІЦ}}
}
\usepackage{setspace}
\onehalfspacing
\DeclareCaptionLabelSeparator{ddd}{ -- }
\captionsetup[table]{labelsep=ddd, justification=raggedright, font=normalsize, margin={-0.0cm, 0pt},
position=top}
\captionsetup[tabularx]{labelsep=ddd, justification=raggedright, font=normalsize, margin={-0.0cm, 0pt},
position=top}
\captionsetup[longtable]{labelsep=ddd, justification=raggedright, font=normalsize , margin={-0.0cm, 0cm},
position=top}
\captionsetup[figure]{justification=centering,labelsep=ddd, font=normalsize}
\makeatletter
\setlength\LTleft{0cm}
\pagestyle{fancy}
\fancyhead{}
\fancyfoot{}
\fancyhead[R]{\thepage}
\fancypagestyle{plain}{%
\fancyhf{}
\fancyhead[R]{\thepage}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
\fontencoding{T1}
\fontfamily{times-ttf}
\fontseries{m}
\fontshape{it}
\fontsize{14}{15}
\selectfont
\titleformat{\chapter}{}{\thechapter}{14pt}{}
\titleformat{\section}{}{\thesection}{14pt}{}
\titleformat{\subsection}{}{\thesubsection}{14pt}{}
\titlespacing{\chapter}{0pt}{0pt}{17pt}
\titlespacing*{\section}{0pt}{17pt}{17pt}
\titlespacing*{\subsection}{0pt}{17pt}{17pt}
\newlength{\normalparindent}
\AtBeginDocument{\setlength{\normalparindent}{\parindent}}
\renewcommand{\labelitemi}{$-$}
\setlength{\tabcolsep}{1pt}
\setlist{leftmargin=3.0em}
\makeatletter
\bibliographystyle{unsrt}
\renewcommand{\@biblabel}[1]{#1}
\makeatother
\fontfamily{times-ttf}
答案1
您的代码片段不太有用。我尝试了以下最小工作示例:
\documentclass{article}
\begin{document}
\bfseries{Lorem ipsum dolor} \textit{sit amet}, consectetuer adipiscing elit.
\end{document}
其结果是
请注意,该命令\bfseries
没有参数。\bfseries
将把整个文本设置为粗体,直到当前组关闭。另一方面,该命令\textbf
有一个强制参数。该命令\textbf
将以粗体打印强制参数。
我查看了你的日志文件。我认为你也应该这样做。有很多警告。其中之一是:
LaTeX Font Warning: Font shape `T2A/ptm/bx/it' undefined
(Font) using `T2A/ptm/bx/n' instead on input line 1.
T2A
这意味着字体系列ptm
(Times) 与系列bx
(bold extended) 和字体形状(itshape)的编码组合it
不可用。因此,您必须使用可以使用此类组合的字体。