What is wrong in this Latex code?

  • LaTeX
  • Thread starter EngWiPy
  • Start date
  • Tags
    Code Latex
In summary, the user is experiencing errors when changing the class of their LaTeX code from report to beamer in order to make slides. They have provided a snippet of their code and have commented out the beamer class and associated commands. They are seeking help to resolve the errors.
  • #1
EngWiPy
1,368
61
Hi,

I have the following Latex code, which is perfectly working under the class report, but when I change the class report to beamer to make slides, I get errors. Why?

Code:
\documentclass{report}
%\documentclass{beamer}
%\setbeamertemplate{navigation symbols}{}
%\setbeamercovered{transparent}
\usepackage[autostyle]{csquotes}
%\usepackage{beamerthemeshadow}
\usepackage{pst-sigsys}
\usepackage{setspace}
\usepackage{dsfont}
%\usepackage[top=2.3cm, bottom=2.5cm, left=2.5cm, right=2.5cm]{geometry}
\usepackage{enumerate}
\usepackage{amsmath}
%\usepackage{mathtools}
\usepackage{graphicx}
\usepackage[hang,scriptsize,bf]{caption}
\usepackage{lettrine}
\usepackage{amsfonts}
\usepackage[printonlyused]{acronym}
\usepackage{amssymb}
\usepackage{multirow}
\usepackage{pifont}
\usepackage{tikz}
\usepackage{epstopdf}
\usepackage{psfrag}
\usepackage{epsfig}
\usepackage[english]{babel}
\usepackage{longtable}
\usepackage{setspace}
\usepackage[autostyle]{csquotes}
\usepackage{fancybox}
%\usecolortheme{crane}
\usetikzlibrary{positioning}
\usetikzlibrary{shapes,arrows,fadings, shadows}
\usetikzlibrary{matrix}

\begin{document}

\tikzset{ 
    table/.style={
        matrix of nodes,
        row sep=-\pgflinewidth,
        column sep=-\pgflinewidth,
        nodes={
            rectangle,
            draw=black,
            align=center
        },
        minimum height=1.5em,
        text depth=0.5ex,
        text height=2ex,
        nodes in empty cells,
%%
        %every even row/.style={
            %nodes={fill=gray!20}
        %},
        column 1/.style={
            nodes={text width=2em,fill=gray!20,font=\bfseries,align=center}
        },
				column 2/.style={
            nodes={text=red}
        },
				column 3/.style={
            nodes={text=blue}
        },
				column 5/.style={
            nodes={text=violet}
        },
        %row 6/.style={
            %nodes={
                %fill=gray!20,
                %%text=black,
                %font=\bfseries
            %}
        %},
				row 5/.style={
            nodes={
                fill=black,
                text=white,
								align=left,
                font=\bfseries
            }
        },
    }
}


%\begin{frame}
%\frametitle{Combining Scheme}
\begin{figure}
\begin{center}
\begin{tikzpicture}

\matrix (first) [table,text width=6em]
{
$\mathbf{x}^{(1)}$   & $x_0^{(1)}$            & $x_1^{(1)}$ & $\cdots$ & $x_{N-1}^{(1)}$ \\
$\mathbf{x}^{(2)}$   & $x_0^{(2)}$            & $x_1^{(2)}$ & $\cdots$ & $x_{N-1}^{(2)}$ \\
$\vdots$             & $\vdots$               & $\vdots$    & $\ddots$ & $\vdots$ \\
$\mathbf{x}^{(M)}$   & |[name=a1]|$x_0^{(M)}$ & |[name=a2]|$x_1^{(M)}$ & $\cdots$ & |[name=a3]|$x_{N-1}^{(M)}$ \\[10mm]
                     & |[name=b1]| & |[name=b2]|&  & |[name=b3]| \\[10mm]
$\mathbf{x}^{(R)}$   & |[name=c1]|$x_0^{(R)}$ & |[name=c2]|$x_1^{(R)}$ & $\cdots$ & |[name=c3]|$x_{N-1}^{(R)}$ \\
};
\draw[->,thick] (a1) edge (b1);
\draw[->,thick] (b1) edge (c1);
\draw[->,thick] (a2) edge (b2);
\draw[->,thick] (b2) edge (c2);
\draw[->,thick] (a3) edge (b3);
\draw[->,thick] (b3) edge (c3);

\end{tikzpicture}
\end{center}
\end{figure}
%\end{frame}

\end {document}

I comment the beamer class and the commands associated with it.

Thanks in advance for your help
 
Physics news on Phys.org
  • #2
Your code works for me. I got no error messages with MikTeX 2.9 using TeXStudio.
 

FAQ: What is wrong in this Latex code?

What is wrong in this Latex code?

1. Why is the document not compiling or producing any output?

There could be several reasons for this. Some common ones include missing packages or errors in the syntax of the code. Check for any error messages in the compiler or try compiling with a different editor.

2. Why is the formatting of the document incorrect?

This could be due to missing or incorrect formatting commands, such as \textbf{} for bold text or \newline for line breaks. Make sure to use the correct commands and check for any typos.

3. Why are my equations not displaying properly?

This could be due to missing packages or errors in the syntax of the equations. Make sure to use the correct math mode syntax, such as enclosing equations in $ $ or \[ \] for display mode.

4. Why are my figures or tables not showing up in the document?

Make sure to use the correct commands for including figures and tables, such as \includegraphics{} for images or \begin{table} and \end{table} for tables. Also, check for any errors in the file path or the code for the figure/table.

5. Why is the font or font size not what I expected?

This could be due to the default font and font size being set differently in your compiler or editor. You can change these settings in the document class or use specific font and font size commands, such as \documentclass[12pt]{article} for 12pt font size.

Similar threads

Replies
4
Views
2K
Replies
2
Views
3K
Replies
1
Views
5K
Replies
2
Views
4K
Replies
4
Views
4K
Back
Top