# LyX document compiled in OSX?

LyX is a wysiwyg LaTeX editor that I find useful to write exercises fast instead of TextMate that I use for long-term projects. So the below shows an exercise that I would like to print as PDF: however I am getting the following errors Undefined control sequence that are very vague. I cannot see any \begin{document} or other LaTeX commands in LyX in the view which makes debugging harder than in text-based editors. So

How can I compile a document in LyX?

• the fact that \mathbb is what's unidentified means that amsfonts (or if you need more symbols, amssymb, which loads amsfonts) isn't loaded. so try adding that to your job. (but i don't know how, not being a lyx user.) – barbara beeton Mar 4 '16 at 17:51
• @barbarabeeton thank you for the observation: I realized from that to search for packages and I found a solution, provided below for new LyX users, nice software :) – hhh Mar 4 '16 at 18:06
• What options do you have set in Document > Settings > Math Options? – scottkosty Mar 4 '16 at 18:35
• @scottkosty thank you for the observation, added the alternative method here. – hhh Mar 5 '16 at 16:20
• @hhh looks good. I would add that there is an advantage of doing it the LyX way because that way LyX knows about the packages that are being used. This way LyX can load them in the best order (sometimes this makes a difference in LaTeX, although in this case I doubt it). – scottkosty Mar 5 '16 at 16:57