Number found where operator expected at test.lyx line 2, near "lyxformat 474" (Do you need to predeclare lyxformat?) Backslash found where operator expected at test.lyx line 3, near "\" (Missing semicolon on previous line?) Backslash found where operator expected at test.lyx line 4, near "begin_document \" (Missing semicolon on previous line?) Backslash found where operator expected at test.lyx line 5, near "begin_header \" (Missing semicolon on previous line?) Operator or semicolon missing before %ignore at test.lyx line 7. Ambiguous use of % resolved as operator % at test.lyx line 7. syntax error at test.lyx line 2, near "lyxformat 474" BEGIN not safe after errors--compilation aborted at test.lyx line 7.