I am working on a project and the document has grown. So, I have divided the content into multiple files and one is a tex file, including my libraries, newcommands, etc. which is shared between my different reports so far.
How? I put this sharedlibrary file in a specified folder that I have called SharedRoot, then I include this file by using these two lines of command in the beginning of every report:
\newcommand{\myrootadd}{../../SharedRoot}
\input{\SharedRoot/sharedlibrary}
Using this file, there is no problem with my reports, and everything is working fine.
Now, I want to make a presentation with beamer, and even in the beginning steps,I receive some errors:
The content of my beamer file is:
\documentclass[notheorems]{beamer}
\newcounter{chapter}
\newcommand{\myrootadd}{../../SharedRoot}
\input{\myrootadd/LibsAndDefs}
\usepackage{default}
\begin{document}
\end{document}
And I get:
Command \theorem already defined. \newtheorem{theorem}
as well as lots of similar error messages. So, I thought maybe beamer is defining theorem too which conflicts with my own definition in this shared file.
So, I tried \documentclass[notheorems]{beamer}.
then I got this message:
No counter 'chapter' defined. }
So, I tried adding
\newcounter{chapter}
Then I do not receive this error but I have no output and receive "Either the file is corrupt or it is in the process of creation." All in all, there is no output.
So, I guess it has not been the best choice to use those two lines.
And this is the conflicting part for the content of my sharedDefinitionAndLibrary file:
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{amssymb,amsmath,amsthm, amsfonts}
\usepackage{tikz}
\usepackage{multirow}
\usepackage{bbm}
%\usepackage{graphicx}
\graphicspath{ {../../SharedRoot/images/} }
%\usepackage[ruled,vlined]{algorithmicx} % Algorithm
\usepackage[chapter]{algorithm}
\usepackage{algorithmic}
\newtheorem{theorem}{Theorem}
\newtheorem{example}{Example}
\theoremstyle{definition}
\newtheorem{definition}{Definition}[section]
%\theoremstyle{corollary}
\newtheorem{corollary}{Corollary}[section]
%\theoremstyle{lemma}
\newtheorem{lemma}[theorem]{Lemma}
\theoremstyle{remark}
\newtheorem{remark}{Remark}[section]
It would be a "super help" if someone has a clue how this issue could be resolved and I could make a beamer presentation using this sharedlibrary file in the end!