[Tex/LaTex] How to make the own LaTeX template

code

Ok I know that my question is quite local, however, I have struggled with it for a long time and I could not find the answer, so I decided to post it here.

I have to rewrite a book (which was written using Word) by LaTeX, without changing the structure and the content.

This book is divided into 2 parts; part 1 has 2 chapters and part 2 has 3 chapters. Chapters are numbered by alphabet letter like Chapter A, Chapter B,… and theorems in each chapter are numbered depending in its chapter like Theorem A1, Theorem B7,…

I have searched on the Internet for book templates, but I found nothing that fully appropriate with this style of book. Every time I tried I got troubles with numbering theorem, with index and content…. 😐

Could you please help me to write the appropriate LaTeX code? Please do not tell me that I should change the way the book behaves, since the author want to keep it, and I am just an editor only.

Thank for reading my question!

update : Here is the picture that I made :
enter image description here

For the theorem, I number it by hand, as the following code :

   \indent \textbf{Định lý A1.}
    (Thales thuận dạng hình học)\emph{Nếu ba đường thẳng đôi một song song $a, b, c$ cùng bị hai đường thẳng $\Delta, \Delta'$ tương ứng cắt tại $A, B, C; A’, B’, C’$ thì $\dfrac{AB}{BC}=\dfrac{A'B'}{B'C'}$. }  

Best Answer

Here is a very basic way, using the book-class and the amsmath-commands:

\documentclass{book}

\usepackage{mathtools} % loads the ams-packages and provides some fixes
\usepackage{lipsum} % for dummy text only

\renewcommand{\thechapter}{\Alph{chapter}} % change chapter numbering to A, B, C, ...
\newtheorem{mytheorem}{Theorem} % define new theorem style

\begin{document}
\tableofcontents

\chapter{Lorem Ipsum}
\lipsum[1]

\begin{mytheorem} %first theorem - this will be "A.1"
\begin{align}
    a^2+b^2=c^2
\end{align}
\end{mytheorem}

\lipsum[2-5]

\chapter{Lorem Ipsum}
\lipsum[6-8]

\begin{mytheorem} %second theorem - this will be B.1
\begin{align}
    1+1=3
\end{align}
\end{mytheorem}

\lipsum[9]

\end{document}

Screenshot

Edit

Based on your screenshot, try the following – you have to remove the old definition of mytheorem from the previous example, then add:

\usepackage{chngcntr} %allows you to reset counters within others

\newcounter{mytheoremcounter} %create a counter for your theorems
\setcounter{mytheoremcounter}{0}%set them to zero. At the begin of every theorem
    %, this gets increased by one, so the first theorem will be '1'
\counterwithin{mytheoremcounter}{chapter} % reset the counter in every chapter

\newenvironment{mytheorem}{%
    \addtocounter{mytheoremcounter}{1}%
    \indent\textbf{Theorem \thechapter\arabic{mytheoremcounter}.}
}{}

Then write the following:

\begin{mytheorem}
(Lorem Ipsum Dolor Sit Amet) \emph{Lorem ipsum dolor sit amet, consectetuer adipiscing elit. 
Ut purus elit, vestibu- lum ut, placerat ac, adipiscing vitae, felis. $\Delta$, $\Delta'$ 
Curabitur dictum gravida mauris. $A, B, C; A’, B’, C’$ mollis ac, nulla
$\dfrac{AB}{BC}=\dfrac{A'B'}{B'C'}$. }  
\end{mytheorem}

This produces:

enter image description here

Edit 2

The same result with an improved interface:

\newenvironment{mytheorem}[1]{
    \addtocounter{mytheoremcounter}{1}
    \indent\textbf{Theorem \thechapter\arabic{mytheoremcounter}.} (#1) \em
}{}

Use it like this:

\begin{mytheorem}{The title}
    The theorem
\end{mytheorem}

With the \em you do not need to write the \emph{...} every time.