brucemiller / LaTeXML

LaTeXML: a TeX and LaTeX to XML/HTML/ePub/MathML translator.
http://dlmf.nist.gov/LaTeXML/
Other
926 stars 98 forks source link

About conversion of latex (beamer) to html #861

Closed sumanstats closed 7 years ago

sumanstats commented 7 years ago

Hi there,

To be honest, in my experience nothing beats latexml in latex to xml/html conversion. But I came across this error recently.

I have a latex file with beamer class loaded. This is the one which I want to convert into xml:

\documentclass[12pt]{beamer}
\usepackage[english]{babel}
%No need to include  graphicx, Beamer loads it itself.
\usetheme{default}
%No need to include  graphicx, Beamer loads it itself.
\usepackage{booktabs}
\usepackage{graphicx}

 % using non standard fonts for beamer

%\usepackage{minted}
%\usecolortheme{orchid}
\setbeamertemplate{caption}[numbered]
\setbeamercolor{block title}{bg=green!70,fg=black}
\setlength\heavyrulewidth{0.5ex}
\setlength\belowcaptionskip{0pt}

\title[Advances in Atopic Dermatitis]{RECENT ADVANCES IN ATOPIC DERMATITIS MANAGEMENT}
\author[Doc]{Dr Doc Nepal\\ MD Resident}
\date{\today}
\institute[IOM]{\normalsize Institute of Medicine, Tribhuvan University}

%begin document 

\begin{document}

%Title slide
\begin{frame}
\maketitle
\end{frame}

%section goes here. It appears in each slide in Warsaw and Berkeley theme. And they remain highlighted in the slides under those sections.

%Other slide

\begin{frame}{Biological Therapies:}

\begin{itemize}
    \item Monoclonal Antibodies

\begin{itemize}
    \item Chimeric antibodies: Infliximab, Rituximab, Basiliximab
\item Humanised antibodies: Omalizumab, Efalizumab
\item Fully Human antibodies: Adalimumab, Ustekinumab
\end{itemize}
\end{itemize}
\begin{itemize}
    \item Fusion antibody protein:
\begin{itemize}
    \item Etanercept, Abetacept
\end{itemize}

    \item Recombinant human cytokines and growth factors:
 \begin{itemize}
    \item Interferons, GM-CSF, PDGF
 \end{itemize}

\end{itemize}

\end{frame}

\begin{frame}{Role of anti-TNF-$\alpha$}

\begin{block}{}
    No evidence to support the efficacy of Anti-TNF alpha therapy in atopic eczema.
\end{block}

\end{frame}

\begin{frame}{Emerging treatments}
\begin{table}
    \centering
    \caption{Emerging treatments for atopic dermatitis}
    \begin{tabular}{llp{3.5cm}r}
        \toprule
        Name of agent & Route & Mechanism & Phase\\
        \midrule
        Dupilumab & SC & Anti-IL-4R$\alpha$ mAb (blocks both
        IL-4 and IL-13 activity) & III\\  
        Lebrikizumab & SC & Anti-AL-13 mAb & II\\  
        Tralokinumab & SC & Anti-IL-13 mAb & II\\ 
        Secukinumab(Cosentyx) & SC & Anti-I-17A mAb & II\\ 
        Omalizumab & SC & Anti-IgE mAb & II\\ 
        Ligelizumab (QGE031) & SC & Anti-IgE mAb & II\\ 

        \bottomrule
    \end{tabular}
\end{table}
\end{frame}

\begin{frame}{Omalizumab}
\begin{itemize}
    \item Recombinant humanised monoclonal antibody against IgE 
\item Binds IgE at the same site as its high-affinity receptor, Fc$\epsilon$R I causing reduced binding of IgE to Fc$\epsilon$R I. 
\item Effects:
\begin{itemize}
    \item Reduced free serum IgE
\item Lowered surface IgE and Fc$\epsilon$RI expression on different peripheral blood mononuclear cells, 
\item Reduced saturation of Fc$\epsilon$RI with IgE,
\item Increased number of free Fc$\epsilon$RI 
\end{itemize}
\end{itemize}

\end{frame}

\begin{frame}{Omalizumab: Contd.}
\begin{itemize}
    \item 20 atopic dermatitis patients 
\item Omalizumab/ placebo for 16 weeks 
\item Immunological and clinical disease parameters measured
\end{itemize}
Therapeutic benefit of omalizumab treatment,would be seen in patients with acute rather than chronic forms of the disease.
\footnote{Heil PM et al.  J der Dtsch Dermatologischen Gesellschaft. 2010 Dec;8(12):990-8.}
\end{frame}

\begin{frame}{Omalizumab: Contd.}
\begin{itemize}
    \item 28 week trial on 20 mild to moderate atopic dermatitis patients\footnote{Hotze M et al. Increased efficacy of omalizumab in atopic dermatitis patients with wild-type filaggrin status and higher serum levels of phosphatidylcholines. Allergy. 2014 Jan;69(1):132-5. 
    }
\item Patients with absence of fillagrin gene mutation can benefit from Anti- IgE treatment.
\item Altered lipid metabolite profiles with high levels of various glycerophospholipids.

\end{itemize}

\end{frame}

\begin{frame}{Rituximab}
\begin{itemize}
    \item 6 patients two infusions of 1000 mg 2 weeks apart
\end{itemize}

\end{frame}

\begin{frame}{Dupilumab}

\begin{itemize}
    \item Antibody to $\alpha$-subunit of the IL-4 receptors that blocks IL-4 and IL-13 signalling.
\item Showed clinical efficacy in persistent asthma with elevated eosinophil levels\footnote{Beck LA et al. Dupilumab Treatment in Adults with Moderate-to-Severe Atopic Dermatitis. N Engl J Med. 2014 Jul 10;371(2):130-9.} 
\item Patients treated with dupilumab had marked and rapid improvement in all the evaluated measures of atopic dermatitis disease activity.
\end{itemize}

\end{frame}

\begin{frame}{Lebrikizumab}

\begin{itemize}
    \item Monoclonal antibody to interleukin-13
\item Shown efficacy in atopic asthma\footnote{Corren J et al. Lebrikizumab Treatment in Adults with Asthma. N Engl J Med. 2011 Sep 22;365(12):1088-98. 
}
\item Under active development
\end{itemize}

\end{frame}

\begin{frame}{Emerging therapies}

\begin{table}\scriptsize
    \centering
    \caption{Emerging therapies for atopic dermatitis(PDE-4I)}
    \begin{tabular}{p{1.5cm}lp{4cm}r}
        \toprule
        Name of agent & Route & Mechanism & Phase\\
        \midrule
        Apremilast & PO & PDE-4 inhibitor(small molecule) 
        & II\\
        Roflumilast & Topical (cream)  & PDE-4 inhibitor(small molecule) & II\\
        Crisaborole (AN-2728) & Topical (ointment) & PDE-4 inhibitor(small molecule) & III\\
        E6005 & Topical (ointment) &PDE-4 inhibitor(small molecule) & II\\
        OPA-15406 & Topical (ointment) & PDE-4 inhibitor(small molecule) & II \\
        DRM-02 & Topical (Gel) & PDE-4 inhibitor & II\\
        LEO29102 & Topical (cream) & PDE-4 inhibitor & II\\

        \bottomrule
    \end{tabular}
\end{table}

\end{frame}

\begin{frame}{PDE-4 Inhibitors}

\begin{itemize}
    \item Apremilast : PO molecular inhibitor of PDE 4
    \item Sixteen adult patients with atopic dermatitis\footnote{Samrao A et al. A Pilot Study of an Oral Phosphodiesterase Inhibitor (Apremilast) for Atopic Dermatitis in Adults. Arch Dermatol. 2012 Aug 1;148(8):890-7. 
    }.\\
    ~~~~2 doses of apremilast
    \item Topical phosphodiesterase (PDE) inhibitors

\end{itemize} 

\end{frame}

\begin{frame}
\centering 
\Huge THANK YOU

\end{frame}
\end{document}

While trying to convert it I get this error:

(Digesting TeX document...
(Loading /usr/local/share/perl/5.26.0/LaTeXML/Package/TeX.pool.ltxml...
(Loading /usr/local/share/perl/5.26.0/LaTeXML/Package/eTeX.pool.ltxml... 0.00 sec)
(Loading /usr/local/share/perl/5.26.0/LaTeXML/Package/pdfTeX.pool.ltxml... 0.00 sec) 0.11 sec)
(Processing content /home/document.tex...
(Loading /usr/local/share/perl/5.26.0/LaTeXML/Package/LaTeX.pool.ltxml... 0.16 sec)
Warning:missing_file:beamer Can't find binding for class beamer (using OmniBus)
        at /home/document.tex; line 2 col 11
        Anticipate undefined macros or environments
        search paths are /home
        In Core::Definition::Constructor[\docume... from LaTeX.pool.ltxml line 57

(Loading /usr/local/share/perl/5.26.0/LaTeXML/Package/OmniBus.cls.ltxml...
(Loading /usr/local/share/perl/5.26.0/LaTeXML/Package/article.cls.ltxml... 0.02 sec)
(Loading /usr/local/share/perl/5.26.0/LaTeXML/Package/inst_support.sty.ltxml... 0.00 sec)
(Loading /usr/local/share/perl/5.26.0/LaTeXML/Package/epsf.sty.ltxml... 0.01 sec)
(Loading /usr/local/share/perl/5.26.0/LaTeXML/Package/graphicx.sty.ltxml...
(Loading /usr/local/share/perl/5.26.0/LaTeXML/Package/graphics.sty.ltxml... 0.00 sec) 0.02 sec) 0.07 sec)
(Loading /usr/local/share/perl/5.26.0/LaTeXML/Package/babel.sty.ltxml...
(Processing definitions /usr/local/texlive/2017/texmf-dist/tex/generic/babel/babel.sty...
(Processing definitions /usr/local/texlive/2017/texmf-dist/tex/generic/babel/switch.def... 0.04 sec)
(Processing definitions /usr/local/texlive/2017/texmf-dist/tex/generic/babel-english/english.ldf...
(Loading /usr/local/share/perl/5.26.0/LaTeXML/Package/babel.def.ltxml...
(Processing definitions /usr/local/texlive/2017/texmf-dist/tex/generic/babel/babel.def...
(Processing definitions /usr/local/texlive/2017/texmf-var/tex/generic/config/language.def... 0.05 sec) 0.65 sec) 0.73 sec) 1.02 sec) 1.98 sec) 2.07 sec)
Error:undefined:\usetheme The token T_CS[\usetheme] is not defined.
        at /home/document.tex; line 4 col 9
        Defining it now as <ltx:ERROR/>
        In Core::Stomach[@0x55d932c0a570] at /home/document.tex; line 4 col 9

(Loading /usr/local/share/perl/5.26.0/LaTeXML/Package/booktabs.sty.ltxml... 0.00 sec)
Error:undefined:\setbeamertemplate The token T_CS[\setbeamertemplate] is not defined.
        at /home/document.tex; line 17 col 18
        Defining it now as <ltx:ERROR/>
        In Core::Stomach[@0x55d932c0a570] at /home/document.tex; line 17 col 18

Error:undefined:\setbeamercolor The token T_CS[\setbeamercolor] is not defined.
        at /home/document.tex; line 18 col 15
        Defining it now as <ltx:ERROR/>
        In Core::Stomach[@0x55d932c0a570] at /home/document.tex; line 18 col 15

Warning:undefined:\heavyrulewidth '\heavyrulewidth' is not a length; defining it now
        at /home/document.tex; line 19 col 32
        In Core::Definition::Primitive[\@check@l... from LaTeX.pool.ltxml line 3303

Warning:undefined:\belowcaptionskip '\belowcaptionskip' is not a length; defining it now
        at /home/document.tex; line 24 col 32
        In Core::Definition::Primitive[\@check@l... from LaTeX.pool.ltxml line 3303

Error:undefined:{block} The environment {block} is not defined.
        at /home/document.tex; line 90 col 13
        Next token is T_BEGIN[{]
        In Core::Definition::Expandable[\begin {}] from LaTeX.pool.ltxml line 154
         <= Core::Gullet[@0x55d932de9110] <= Core::Stomach[@0x55d932c0a570] <= Core::Definition::Constructor[\begin{... <= ...
 3.09 sec) 3.23 sec)
(Building...
(Loading compiled schema /usr/local/share/perl/5.26.0/LaTeXML/resources/RelaxNG/LaTeXML.model... 0.01 sec)............... 0.26 sec)
(Rewriting... 0.00 sec)
(Math Parsing...8 formulae ...[1][2][3][4][5][6][7][8]
Math parsing succeeded:
   ltx:XMath: 8/8
 0.00 sec)
(Finalizing... 0.02 sec)
Conversion complete: 3 warnings; 4 errors; 4 undefined macros[{block}, \setbeamercolor, \usetheme, \setbeamertemplate]; 1 missing file[beamer.cls].
processing finished Fri Aug  4 15:45:05 2017

How can I resolve this issue?

Note I used this docker image which uses latexml sourcecode from github.

Many thanks. sumdoc

brucemiller commented 7 years ago

I like & use beamer, too, but it is an extremely complex class. There's minimal support for the concept of slides in LaTeXML, and it's probably possible to have it work on simple beamer slides, there are so many fancy features that (like overlays, etc) that I have no clear concept of how to represent.

dginev commented 7 years ago

There is a related beamer issue here: #231 . As Bruce has mentioned that may be a complex binding to do well, so it is definitely not something we will get to before 0.8.4. Let us know if we can answer any follow-up questions, will mark as resolved here for now.