When I emphasize a word, the document is not complied correctly. The error is

! Missing $ inserted. <inserted text> $

Trying to debug this, it seems to relate to my macro functions I have at the beginning of my document. Since I have to many macros, it is tedious to remove one by one and find the cause. Does anyone know what kind of macro can cause the emphasize to fail?

  • it is a very usual error and possibly you have a _ or something like this that needs to be inside math mode to work or need a backslash before of the symbol. It could be anything related to "math environment request" of the compiler. – koleygr Oct 19 '17 at 9:07
  • 1
    In the 10 minutes since you asked this question you could have likely found out which macro caused the problem, and then you could have posted the definition of it, as part of a minimal complete document, and someone would have been able to point out the problem. Pure guesswork isn't always fun. (Make a copy of your doc with all the defs and an emphasized word, so that the error is triggered. Remove half of the defs, and see if the error went away. Keep removing half of whatever defs you have left till you're left with one.) – Torbjørn T. Oct 19 '17 at 9:11
  • @TorbjørnT. you're right. I imagined it to be to long, but it wasn't that bad. Thanks! posted my answer. – bobsacameno Oct 19 '17 at 9:20

Found a macro named \em which screwed up the emphasis. Removed it and everything is solved.

  • 1
    No surprise that caused a problem, seeing as \emph, which is what LyX uses when you ask it to emphasize text, is defined using the font switch \em. (This highlights a problem of the way math macros are implemented in LyX, they use \def so existing macros are silently overwritten.) – Torbjørn T. Oct 19 '17 at 9:28

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