0

I am using \boldsymbol{} and \textit{}, but they are not recognized. The document preamble is the following:

\documentclass{book}
\usepackage[spanish]{babel}
\selectlanguage{spanish}
\usepackage[utf8]{inputenc}
\setcounter{tocdepth}{4}
\setcounter{secnumdepth}{4}
\usepackage{parskip}
\usepackage{graphicx}
\usepackage{multirow}
\usepackage{amsmath, calc}
\usepackage[margin=1.5in]{geometryit is}
\usepackage{hyperref}
\usepackage{textcomp}
\usepackage{listings}
\usepackage[svgnames]{xcolor}
\usepackage{fontspec}
\usepackage{mathptmx}
\usepackage[nottoc,notlot,notlof]{tocbibind}
\usepackage[numbers]{natbib}
\begin{document}

For example, I'm using $\boldsymbol{x}_t$ and 
\textit{vector de estados} within a paragraph.

\end{document}

Which lines concern the font or the commands that are not working? What should I change?

  • 1
    You have an issue with \usepackage[margin=1.5in]{geometryit is}... that's completely irrelevant to your question, but it remains a problem. – Werner Dec 13 '17 at 22:53
  • It should be \usepackage[margin=1.5in]{geometry} since there's no package called geometryit is. – Werner Dec 13 '17 at 22:57
  • 2
    In answer to your question, \textit is available by default and \boldsymbol is supplied by amsmath (even though \bm from bm is a suggested improvement/alternative). – Werner Dec 13 '17 at 22:58
  • But if I'm using \usepackage{amsmath, calc}, why is \boldsymbol{} not working? And if \textit{} is default, why is it not working either? – Alfie González Dec 13 '17 at 22:59
  • There's nothing that points to \textit being disable/unavailable based on your code snippet. So the problem must be somewhere else... – Werner Dec 13 '17 at 23:16
1

enter image description here

\documentclass{book}
\usepackage[spanish]{babel}
\selectlanguage{spanish}
\usepackage[utf8]{inputenc}
\setcounter{tocdepth}{4}
\setcounter{secnumdepth}{4}
\usepackage{parskip}
\usepackage{graphicx}
\usepackage{multirow}
\usepackage{amsmath, calc}
\usepackage[margin=1.5in]{geometry}
\usepackage{hyperref}
\usepackage{textcomp}
\usepackage{listings}
\usepackage[svgnames]{xcolor}
%\usepackage{fontspec}
\usepackage{mathptmx}
\usepackage[nottoc,notlot,notlof]{tocbibind}
\usepackage[numbers]{natbib}

\begin{document}

For example, I'm using $\boldsymbol{x}_t$ and \textit{vector de estados} within a paragraph.
\end{document}

mathptmx is very old and has no bold fonts, a better times clone is newtxmath

enter image description here

\documentclass{book}
\usepackage[spanish]{babel}
\selectlanguage{spanish}
\usepackage[utf8]{inputenc}
\setcounter{tocdepth}{4}
\setcounter{secnumdepth}{4}
\usepackage{parskip}
\usepackage{graphicx}
\usepackage{multirow}
\usepackage{amsmath, calc}
\usepackage[margin=1.5in]{geometry}
\usepackage{hyperref}
%\usepackage{textcomp}
\usepackage{listings}
\usepackage[svgnames]{xcolor}
%\usepackage{fontspec}
%\usepackage{mathptmx}
\usepackage{newtxtext,newtxmath}
\usepackage[nottoc,notlot,notlof]{tocbibind}
\usepackage[numbers]{natbib}

\begin{document}

For example, I'm using $\boldsymbol{x}_t$ and \textit{vector de estados} within a paragraph.
\end{document}
2

Please use the package bm in the preamble:

\usepackage{bm}

And in document use

\bm{}

For examples, bold symbols with italic shape are

$\bm{\alpha}=\bm{t}$

compared with them, the normal symbols are

$\alpha=t$

The compiled PDF for them would be

enter image description here

By the way,

  • in fact \bm{} won't change any shape of symbols but only increase
    the thickness of symbols.
  • bm package can be used under every mathematical fonts, including mathptmx you used.
  • bm can really only make acceptable output if there is a bold font available (it can use poor man's bold, overprinting three copies of the symbol with slight offsets, but that's not recommended) – David Carlisle Dec 14 '17 at 7:47
  • Another reason to stick to boldsymbol is that the command is avaiblable by default in Mathjax, which comes in handy e.g. when writing documentation with Doxygen. – Rastapopoulos Feb 14 '18 at 17:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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