0

I want to embed html code like latex in beamer, like follows:

  \begin{frame}{HTML Code}[fragile]
   \begin{lstlisting}[language=html]
    <html>
    <head>
    </head>
    <body>
    </body>
    </html>
  \end{lstlisting}
   \end{frame}

But it is not working , Latex file is giving compilation errors. It is really urgent. Please help.

  • Please add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – Henri Menke Jun 18 '13 at 11:45
2

Remarks

The order of your parameters for the frame is wrong. The options in [] need to appear before the title in {}.

Implementation

\documentclass{beamer}
\usepackage{listings}
\begin{document}
\begin{frame}[fragile]{HTML Code}
\begin{lstlisting}[language=html]
<html>
<head>
</head>
<body>
</body>
</html>
\end{lstlisting}
\end{frame}
\end{document}

Output

frame

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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