独自の LaTeX テンプレートを作成するにはどうすればいいですか?

独自の LaTeX テンプレートを作成するにはどうすればいいですか?

私の質問がかなりローカルなものであることは承知していますが、長い間悩んでいて答えが見つからなかったため、ここに投稿することにしました。

構造と内容を変更せずに、Word を使用して書かれた本を LaTeX で書き直す必要があります。

この本は 2 つのパートに分かれています。パート 1 には 2 つの章があり、パート 2 には 3 つの章があります。章はChapter A、、、 ... のようにアルファベットで番号が付けられ、各章の定理は、、、...Chapter Bのようにその章に応じて番号が付けられています。Theorem A1Theorem B7

インターネットで本のテンプレートを検索しましたが、このスタイルの本に完全に適合するものは見つかりませんでした。試すたびに、番号付けの定理、索引、コンテンツで問題が発生しました... :|

適切な LaTeX コードの記述を手伝っていただけますか? 著者は本をそのまま残したいと思っており、私は単なる編集者なので、本の動作方法を変更する必要があるとは言わないでください。

私の質問を読んでいただきありがとうございます!

アップデート: 私が作った絵はこれです: ここに画像の説明を入力してください

定理については、次のコードのように手動で番号を付けます。

   \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'}$. }  

答え1

book以下は、 -class と-commandsを使用した非常に基本的な方法ですamsmath

\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}

スクリーンショット

編集

mytheoremスクリーンショットに基づいて、次の操作を試してください。前の例の古い定義を削除してから、以下を追加する必要があります。

\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}.}
}{}

次に、次のように記述します。

\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}

これにより、次のものが生成されます。

ここに画像の説明を入力してください

編集2

インターフェースが改善されても同じ結果になりました:

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

次のように使用します:

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

を使用すると、毎回\emを書く必要がなくなります。\emph{...}

関連情報