3

A MWE:

\documentclass[12pt]{book}
\usepackage{imakeidx}
\usepackage{xcolor}
\usepackage{setspace}
\usepackage{lipsum}
\usepackage[margin=.5in]{geometry}
\usepackage{parskip}
\usepackage{bookmark}
\usepackage{graphicx}
\usepackage{wrapfig}
\usepackage{float}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{mathtools}
\usepackage{amsmath}
\usepackage{accents}
\usepackage{bm}
\usepackage{amsfonts}
\usepackage{enumitem}
\usepackage{fancyvrb}
\usepackage[bottom]{footmisc}
\makeindex
\usepackage{hyperref}

\begin{document}

    We know that the \textbf{dual} of $\mathbf{a_1}$ is ${\mathbf{a_1}^\perp}$

    We know that the \textbf{dual} of $\mathbf{a_1}$ is {${\mathbf{a_1}}^\perp$}

\end{document}

Having just learnt to use math mode I have the following problem:

We know that the \textbf{dual} of $\mathbf{a_1}$ is ${\mathbf{a_1}^\perp}$

Results in an error "Mathbf only allowed in math mode". I have tried some variations that give me the error "insert } missing" as follows:

We know that the \textbf{dual} of $\mathbf{a_1}$ is {${\mathbf{a_1}}^\perp$}

I definitely do not understand the placement of the $ signs around math symbols. Any pointers?

AboAmmar
  • 46,352
  • 4
  • 58
  • 127
Tom
  • 55
  • Neither of these generates an error (though some of the braces are unnecessary). The key pointer: post a small example code that reproduces the problem! – Ian Thompson Apr 21 '16 at 20:46
  • You need to post a MWE. I have put both of your examples in a minimal document \documentclass{article} \begin{document} 'both lines of your code as it' \end{document} – R. Schumacher Apr 21 '16 at 20:47
  • 2
    The posted example is neither minimal nor working ;-) And if mathtools is loaded, amsmath is not needed .. and other things to frown –  Apr 21 '16 at 20:52
  • Does the code you posted a minute ago still produce the error? – GuM Apr 21 '16 at 20:55
  • The code between the \begin{document} and \end{document} still produces the error listed earlier but from the comments it looks like I have some larger problems. – Tom Apr 21 '16 at 20:57
  • You seem, in my humble opinion, to have a rather bloated preamble. Would I be right in my assumption that you did not produce this yourself? Beware point 5, the over-inflated preamble of mysterious mysteries – Au101 Apr 21 '16 at 21:01
  • 1
    No, the code you posted 5 minutes ago does not reproduce the error. – GuM Apr 21 '16 at 21:01
  • 1
    @Tom - If you copy-paste the MWE above, do you still have the same errors? It works with me without any erros! – AboAmmar Apr 21 '16 at 21:02
  • The code above just needs mathtools, nothing more and it works –  Apr 21 '16 at 21:02
  • @ChristianHupfer - mathtools is already there. – AboAmmar Apr 21 '16 at 21:04
  • @AboAmmar: I know -- it was a comment that all other packages are completely redundant –  Apr 21 '16 at 21:05
  • Thanks for all of the comments ... for the record I did produce the preamble over time but that only shows up my lack of knowledge ... still learning. I have the MWE as is shown in the posting except I have commented out amsmath. – Tom Apr 21 '16 at 21:07
  • 1
    regarding placement of $ signs around math: the first $ enters math mode. provided that any braced groups within the math are closed (i.e., every open brace is matched by a closing brace) the next $ will terminate the math. no additional braces are needed, either inside or outside the $ signs to delineate the math. – barbara beeton Apr 21 '16 at 21:08
  • @barbarabeeton ... thanks for the pointers on the $ signs ... most helpful. – Tom Apr 21 '16 at 21:34

1 Answers1

2

(too long for a comment, hence posted as an answer)

Some comments and observations:

  • Not even one of the packages loaded in your preamble is needed to compile the body of the document. Do take some time to figure which packages are really needed to compile your full document.

  • The body of the document you've posted actually compiles without errors.

  • You may want to give special thought as to whether the subscript term should also appear in bold. The following screenshot displays the results of both types of input for the subscript term.

enter image description here

\documentclass[12pt]{book}
\begin{document}
We know that the \emph{dual} of $\mathbf{a}_1^{}$ is $\mathbf{a}_1^\perp$.

\medskip
We know that the \emph{dual} of $\mathbf{a_1^{}}$ is $\mathbf{a}_{\mathbf{1}}^\perp$.
\end{document}
Mico
  • 506,678
  • Thanks ... I have tons of figures and all in color and then I have the need for vector symbols and double arrows etc so I think some of the preamble addressed those needs. As you and others point out I will have to eventually figure out which of those packages I really need etc. – Tom Apr 21 '16 at 21:17
  • How about making a macro for the \mathbf{a}_1^\perp? –  Apr 21 '16 at 21:25
  • @Tom You may indeed need most of those packages - but when posting a question here with a particular problem here please try to make a MWE really minimal by deleting stuff until only the problem remains. Sometimes you can even solve the problem yourself that way. – Ethan Bolker Apr 21 '16 at 21:26
  • @Ethan ... thanks, I panicked but I do take direction well :). I will have to look into how to make a macro ... it would definitely be time saving I think ... thanks for the suggestion. – Tom Apr 21 '16 at 21:31
  • @ChristianHupfer - Thanks. Mostly, I was trying to get the OP to think whether the subscript 1 should be in bold or not. :-) – Mico Apr 21 '16 at 21:38
  • @Mico: That's a marginality ;-) (+1) –  Apr 21 '16 at 21:39