我的第一个 lyx 文件只能像在逐字模式下一样编译。为什么?

My first lyx file only compiles like in verbatim mode. Why?

我在 Lyx 中键入以下文本,用 Apple+R 编译它,但得到的是逐字版本。我怎样才能像我们在pdflatex中一样编译这样的文档?

 \documentclass{article}

    \title{Cartesian closed categories and the price of eggs}

    \author{Jane Doe}

    \date{September 1994}

    \begin{document}

       \maketitle

       Hello world!

    \end{document}

LyX 有自己的格式。所以你必须将文件导入 LyX。为此,将您的代码粘贴到 hello.tex,然后打开 LyX 并转到文件 > 导入 > LaTeX(纯文本)。