나만의 LaTeX 템플릿을 만드는 방법은 무엇입니까?

나만의 LaTeX 템플릿을 만드는 방법은 무엇입니까?

제 질문이 꽤 현지적인 것이라는 건 알지만, 오랫동안 그 질문에 답을 찾지 못해 여기에 게시하기로 결정했습니다.

구조와 내용을 변경하지 않고 LaTeX로 (Word를 사용하여 작성된) 책을 다시 작성해야 합니다.

이 책은 2부로 구성되어 있습니다. 1부는 2개의 챕터로 구성되어 있고, 2부는 3개의 챕터로 구성되어 있습니다. 장은 Chapter A, ,... 와 같이 알파벳 문자로 번호가 매겨져 있으며 Chapter B각 장의 정리는 Theorem A1, Theorem 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{...}

관련 정보