<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">%% \section{Examples}
\section{\texorpdfstring{VÃ­ dá»¥}{Vi du}}

\label{sec:examples}

%% The setting is as follows. 
CÃ¡c thiáº¿t láº­p Ä‘Æ°á»£c dÃ¹ng nhÆ° sau Ä‘Ã¢y.
ChÃº Ã½ ráº±ng, cÃ¡c thiáº¿t láº­p tuÃ¢n theo nguyÃªn táº¯c thá»«a káº¿. VÃ­ dá»¥,
thiáº¿t láº­p |font| khÃ´ng Ä‘Æ°á»£c khá»Ÿi táº¡o vá» tráº¡ng thÃ¡i bÃ¬nh thÆ°á»ng khi ta
khai bÃ¡o mÃ´i trÆ°á»ng |Lemma|, vÃ¬ tháº¿ |Lemma| sáº½ thá»«a káº¿ cÃ¡c thiáº¿t láº­p
cá»§a mÃ´i trÆ°á»ng |Theorem|.

\medskip
Má»™t sá»‘ vÃ­ dá»¥ cÃ³ dÃ¹ng lá»‡nh |\color| Ä‘Æ°á»£c cung cáº¥p bá»Ÿi gÃ³i |xcolor.sty|.

\medskip 
%% \begin{itemize}
%%  \item For Theorems:
%% \item 
Äá»‹nh lÃ½:
\begin{command}
  \theoremstyle{marginbreak}
  \theoremheaderfont{\normalfont\bfseries}\theorembodyfont{\slshape}
  \theoremsymbol{\ensuremath{\diamondsuit}}
  \theoremseparator{:}
  \newtheorem{Theorem}{Theorem}\end{command}
%%  \item For Lemmas:
%% \item 
Bá»• Ä‘á»:
\begin{command}
  \theoremstyle{changebreak}
  \theoremsymbol{\ensuremath{\heartsuit}}
  \theoremindent0.5cm
  \theoremnumbering{greek}
  \newtheorem{Lemma}{Lemma}\end{command}
%%  \item For Corollaries:
%% \item
 Há»‡ quáº£:
\begin{command}
  \theoremindent0cm
  \theoremsymbol{\ensuremath{\spadesuit}}
  \theoremnumbering{arabic}
  \newtheorem{Corollary}[Theorem]{Corollary}
\end{command}
%%  \item For Examples:
%% \item 
VÃ­ dá»¥:
\begin{command}
  \theoremstyle{change}
  \theorembodyfont{\upshape}
  \theoremsymbol{\ensuremath{\ast}}
  \theoremseparator{}
  \newtheorem{Example}{Example}\end{command}
%%  \item For Definitions:
%% \item
 Äá»‹nh nghÄ©a
\begin{command}
  \theoremstyle{plain}
  \theoremsymbol{\ensuremath{\clubsuit}}
  \theoremseparator{.}
  \newtheorem{Definition}{Definition}\end{command}
%%  \item For Proofs:
Chá»©ng minh:
\begin{command}
  \theoremheaderfont{\sc}\theorembodyfont{\upshape}
  \theoremstyle{nonumberplain}
  \theoremseparator{}
  \theoremsymbol{\rule{1ex}{1ex}}
  \newtheorem{Proof}{Proof}
\end{command}
%% \end{itemize}
%% Note, that parts of the setting are inherited. For instance, the
%% fonts are not reset before defining ``Lemma'', so the font setting 
%% of ``Theorem'' is used.

%% \begin{thmbox}
{\color{-red!75!green!50}
\begin{Example}[VÃ­ dá»¥ Ä‘Æ¡n giáº£n]
%%  The first example is just a text. 
Má»™t chiá»u Ä‘i trÃªn con Ä‘Æ°á»ng nÃ&nbsp;y, Hoa Ä‘iá»‡p vÃ&nbsp;ng tráº£i dÆ°á»›i chÃ¢n tÃ´i,\ldots 

%%  In the next examples, it is shown how an endmark is put at a
%%  displaymath, a single equation and both types of eqnarrays.
	CÃ¡c vÃ­ dá»¥ tiáº¿p theo minh há»a cho viá»‡c Ä‘áº·t cÃ¡c dáº¥u káº¿t thÃºc
	á»Ÿ cÃ¡c biá»ƒu thá»©c toÃ¡n, phÆ°Æ¡ng trÃ¬nh Ä‘Æ¡n láº» vÃ&nbsp; cÃ¡c dÃ£y phÆ°Æ¡ng trÃ¬nh.
\end{Example}
%% \end{thmbox}
}

%% \begin{thmbox}
{%\color{red!60}
\begin{Theorem}[Äá»‹nh lÃ½ dÃ&nbsp;i]
\label{thm:verylong}
%% The examples are put into this theorem environment. 
VÃ­ dá»¥ vá» mÃ´i trÆ°á»ng |Theorem|, lá»“ng bÃªn trong nÃ³ lÃ&nbsp;
cÃ¡c mÃ´i trÆ°á»ng khÃ¡c nhÆ° |Example|, |Lemma|,\ldots Khi Ä‘ang
á»Ÿ ngay trong mÃ´i trÆ°á»ng |Theorem|, chá»¯ cÃ³ mÃ&nbsp;u Ä‘en; khi á»Ÿ trong
cÃ¡c mÃ´i trÆ°á»ng sÃ¢u hÆ¡n, mÃ&nbsp;u cá»§a mÃ´i trÆ°á»ng sáº½ Ä‘á»•i khÃ¡c Ä‘á»ƒ dá»… phÃ¢n biá»‡t.

\medskip
%% The next example will not appear in the list of examples since
%% it is written as
VÃ­ dá»¥ tiáº¿p theo sáº½ khÃ´ng xuáº¥t hiá»‡n trong danh sÃ¡ch |Example|,
vÃ¬ nÃ³ Ä‘Æ°á»£c dÃ¹ng vá»›i dáº¡ng sao:
\begin{command}
  \begin{Example*}
    ...
  \end{Example*}
\end{command}
{\color{red!60}
\begin{Example*}%[Ending with a displayed formula]
[káº¿t thÃºc vá»›i biá»ƒu thá»©c toÃ¡n]
%% Look, the endmark is really at the bottom of the line:
HÃ£y Ä‘á»ƒ Ã½ vá»‹ trÃ­ dáº¥u káº¿t thÃºc á»Ÿ dÆ°á»›i dÃ²ng biá»ƒu diá»…n cÃ´ng thá»©c
\[ f^{(n)}(z) =
   \frac{n!}{2\pi i} \int \limits _{\partial D}
            \frac{f(\zeta)}{(\zeta-z)^{n+1}} d\zeta \]
\end{Example*}}
%% At this point, we add an additional entry without number 
%% in the Example list:
BÃ¢y giá», ta sáº½ ghi vÃ&nbsp;i thÃ´ng tin bá»• sung vÃ&nbsp;o danh sÃ¡ch |THM| (|Example|);
thÃ´ng tin Ä‘Æ°á»£c ghi sáº½ khÃ´ng gá»“m chá»‰ sá»‘ |THM|:
\begin{command}
  \addtheoremline*{Example}{Extra Entry}
\end{command}
\addtheoremline*{Example}{Extra Entry}
{\color{red!75!green}
\begin{Lemma}%[Display with array]
[Biá»ƒu thá»©c trong máº£ng (dÃ£y) phÆ°Æ¡ng trÃ¬nh]
%% Lemmata are indented and numbered with greek symbols.
%% Also for displayed arrays of this form, it looks good:
Bá»• Ä‘á»ƒ (|Lemma|) Ä‘Æ°á»£c thá»¥t Ä‘áº§u dÃ²ng vÃ&nbsp; Ä‘Ã¡nh chá»‰ sá»‘ vá»›i chá»¯ sá»‘ Hy Láº¡p.

\medskip
%% NgoÃ&nbsp;i ra, cÃ¡c biá»ƒu thá»©c nhÆ° sau Ä‘Ã¢y trÃ´ng cÃ³ váº» nhÆ° Ã½:
XÃ©t vÃ­ dá»¥ sau Ä‘Ã¢y, trÃ´ng cÃ³ váº» tá»‘t:
\begin{command}
 \[\begin{array}{l}
      a = \begin{array}[t]{l}
            first\ line \\
            second\ line
         \end{array}%
     \mbox{\color{green}{try to put this text in the lowest line}}
   \end{array}
  \]
\end{command}
%% Just try to get this with the presented array structure ... without
%% using dirty tricks, you can position the outer array either [t], [c],
%% or [b], and you will not get the desired effect.
NhÆ°ng biá»ƒu diá»…n nhÆ° trÃªn mÃ&nbsp; khÃ´ng sá»­ dá»¥ng cÃ¡c máº¹o Ä‘áº·c biá»‡t nÃ&nbsp;o
(thá»­ Ä‘á»ƒ lá»±a chá»n cÃ¡c vá»‹ trÃ­ |[t]|, |[c]|, |[b]|),
káº¿t quáº£ cÃ³ thá»ƒ khÃ´ng nhÆ° Ã½:
\[\begin{array}{l}
   a = \begin{array}[t]{l}
         first\ line \\
         second\ line
       \end{array}%
   \mbox{\color{green}{try to put this text in the lowest line}}
  \end{array}\]
\end{Lemma}}
{\color{green!75!red}
\begin{Lemma}[PhÆ°Æ¡ng trÃ¬nh]
%% For |equation|s, we decided to put the endmark after the equation
%% number, which is vertically centered.
%% Currently, we do not know, how to get the equation number centered and
%% the endmark at the bottom (one has to know the internal height of the
%% math material) ... If anyone knows, please inform us.
Vá»›i cÃ¡c phÆ°Æ¡ng trÃ¬nh cÃ³ Ä‘Ã¡nh sá»‘, dáº¥u káº¿t thÃºc sáº½ Ä‘Æ°á»£c Ä‘áº·t sau chá»‰ sá»‘
phÆ°Æ¡ng trÃ¬nh, vÃ&nbsp; Ä‘Æ°á»£c canh giá»¯a theo chiá»u Ä‘á»©ng. Hiá»‡n táº¡i, chÆ°a cÃ³ thuáº­t
toÃ¡n Ä‘á»ƒ bá»‘ trÃ­ chá»‰ sá»‘ phÆ°Æ¡ng trÃ¬nh canh giá»¯a (theo chiá»u Ä‘á»©ng),
cÃ²n dáº¥u káº¿t thÃºc láº¡i Ä‘Æ°á»£c Ä‘áº·t vÃ&nbsp;o cuá»‘i phÆ°Æ¡ng trÃ¬nh --- viá»‡c nÃ&nbsp;y Ä‘á»i hÃ²i
pháº£i biáº¿t chiá»u cao cá»§a ná»™i dung phÆ°Æ¡ng trÃ¬nh. Náº¿u ai Ä‘Ã³ biáº¿t,
vui lÃ²ng bÃ¡o cho tÃ¡c giáº£ cá»§a |ntheorem|.
\begin{equation}
 \int_{\gamma} f(z)\, dz := \int_a^b f(\gamma (t)) \gamma'(t) \, dt
\end{equation}
\end{Lemma}}

%% With the |break|-theoremstyles, if the environment is labeled and 
%% written as
Vá»›i kiá»ƒu |break|, náº¿u sá»­ dá»¥ng viá»‡c Ä‘Ã¡nh nhÃ£n nhÆ° sau
\begin{command}
  \begin{Lemma}[Breakstyle]\label{breakstyle}
\end{command}
{\color{red!75!green!50!blue}
\begin{Lemma}[Breakstyle]\label{breakstyle}
%% you see, there is a leading space \dots \\
%% If a percent (comment) (or an explicit |\ignorespaces|) is put directly 
%% after the label, e.g.
thÃ¬ nhÆ° báº¡n tháº¥y, xuáº¥t hiá»‡n cÃ¡c khoáº£ng tráº¯ng thá»«a \ldots \\
Náº¿u dáº¥u pháº§n trÄƒm (chÃº thÃ­ch) Ä‘Æ°á»£c Ä‘áº·t ngay sau lá»‡nh táº¡o nhÃ£n
(hoáº·c dÃ¹ng lá»‡nh |\ignorespaces|), vÃ­ dá»¥
\begin{command}
  \begin{Lemma}[Breakstyle]\label{breakstyle}% 
\end{command}
%% the space disappears.
thÃ¬ khoáº£ng tráº¯ng thá»«a sáº½ máº¥t.

%% From the predefined styles, this is exactly the case for the break-styles.
%% That's no bug, it's \LaTeX-immanent.
\medskip
Vá»›i cÃ¡c kiá»ƒu Ä‘Ã£ Ä‘Æ°á»£c Ä‘á»‹nh nghÄ©a bá»Ÿi |ntheorem|, Ä‘iá»u nÃ&nbsp;y chá»‰ xáº£y ra
chá»‰ vá»›i kiá»ƒu |break|. ÄÃ¢y khÃ´ng pháº£i lÃ&nbsp; lá»—i, mÃ&nbsp; chÃ­nh lÃ&nbsp; cÃ¡ch xá»­ lÃ½ cá»§a \LaTeX{}.

\medskip
%% The example goes on with an |eqnarray|:
VÃ­ dá»¥ vá»›i |eqnarray|:
\begin{eqnarray}
f(z) &amp;=&amp;
   \frac{1}{2\pi i}
   \int \limits_{\partial D} \frac{f(\zeta)}{\zeta-z} d\zeta \\
&amp;= &amp;
   \frac{1}{2\pi}
   \int \limits_0^{2\pi}
      f(z_0 + re^{it}) dt
\end{eqnarray}
\end{Lemma}}

{\color{green}
\begin{Proof}[of nothing]
\begin{eqnarray*}
f(z) &amp;=&amp;
   \frac{1}{2\pi i}
   \int \limits_{\partial D} \frac{f(\zeta)}{\zeta-z} d\zeta \\
&amp;= &amp;
   \frac{1}{2\pi}
   \int \limits_0^{2\pi}
      f(z_0 + re^{it}) dt
\end{eqnarray*}
\end{Proof}}
%% That's it (the end of the Theorem).
Äáº¿n Ä‘Ã¢y lÃ&nbsp; káº¿t thÃºc Äá»‹nh lÃ½~\ref{thm:verylong}.
\end{Theorem}
%% \end{thmbox}
}

%% If there are some environments in the same thm-environment,
%% the last gets the endmark:
Náº¿u cÃ³ nhiá»u mÃ´i trÆ°á»ng cÃ¹ng bÃªn trong má»™t mÃ´i trÆ°á»ng |THM|,
mÃ´i trÆ°á»ng cuá»‘i cÃ¹ng má»›i cÃ³ dáº¥u káº¿t thÃºc
\begin{Definition}[vá»›i danh sÃ¡ch]
\begin{equation}
 \int_{\gamma} f(z)\, dz := \int_a^b f(\gamma (t)) \gamma'(t) \, dt
\end{equation}
\begin{itemize}
%% \item you've seen, how it works for text and
%% \item math environments,
%% \item and it works for lists.
\item nhÆ° váº­y, báº¡n Ä‘Ã£ tháº¥y dáº¥u káº¿t thÃºc lÃ&nbsp;m viá»‡c tháº¿ nÃ&nbsp;o vá»›i vÄƒn báº£n
\item vá»›i biá»ƒu thá»©c toÃ¡n
\item vÃ&nbsp; vá»›i danh sÃ¡ch.
\end{itemize}
\end{Definition}

\begin{Corollary}[Q.E.D.]
%% And here is a trivial corollary, which is ended by
ÄÃ¢y lÃ&nbsp; há»‡ quáº£ táº§m thÆ°á»ng, káº¿t thÃºc bá»Ÿi
|\qedsymbol{\textrm{q.e.d}}|  vÃ&nbsp; |\qed|.
\qedsymbol{q.e.d}\qed
\end{Corollary}

\begin{Example}
\[ f^{(n)}(z) =
   \frac{n!}{2\pi i} \int \limits _{\partial D}
            \frac{f(\zeta)}{(\zeta-z)^{n+1}} d\zeta \]
%% If there is some text after an environment, the endmark is put
%% after the text.
Náº¿u cÃ³ vÄƒn báº£n theo sau mÃ´i trÆ°á»ng, dáº¥u káº¿t thÃºc sáº½ Ä‘áº·t sau vÄƒn báº£n Ä‘Ã³.
\end{Example}

%% The next one is done by the following sequence. Note, that 
%% |~\hfill~| is inserted to prevent \LaTeX\ from using its nested list 
%% management (a verbatim is also a trivlist),
%% i.e.\ this causes \LaTeX\ to start the |verbatim|-Part in a new line.
\medskip
VÃ­ dá»¥ tiáº¿p theo Ä‘Æ°á»£c cho bá»Ÿi mÃ£ nguá»“n sau Ä‘Ã¢y. ChÃº Ã½ ráº±ng,
lá»‡nh |~\hfill~| Ä‘Æ°á»£c chÃ¨n vÃ&nbsp;o Ä‘á»ƒ ngÄƒn cáº£n \LaTeX{} quáº£n lÃ½ danh sÃ¡ch lá»“ng nhau
theo cÃ¡ch cá»§a chÃ­nh \LaTeX{} (mÃ´i trÆ°á»ng |verbatim| lÃ&nbsp; danh sÃ¡ch |\trivlist|).
CÃ³ nghÄ©a lÃ&nbsp;, viá»‡c nÃ&nbsp;y sáº½ khiáº¿n \LaTeX{} báº¯t Ä‘áº§u mÃ´i trÆ°á»ng |verbatim|
vá»›i má»™t dÃ²ng má»›i.
\begin{command}
  \begin{Example}
  ~\hfill~
  \begin{verbatim}
  And, it also works for verbatim
  ... when the \end{verbatim} is in the
  same line as the text ends. \end{verbatim}
                                ^ this space is important !!
  \end{Example}
\end{command}

\begin{Example}[dÃ¹ng `verbatim']
~\hfill~
\begin{verbatim}
And, it also works for verbatim
... when the end{verbatim} is in the
same line as the text ends. \end{verbatim}
\end{Example}

%% There must be no empty line in the input before the |\end{theorem}|
%% (since then, the end mark is ignored) \\
KhÃ´ng Ä‘Æ°á»£c chá»«a dÃ²ng tráº¯ng trÆ°á»›c |\end{theorem}|, bá»Ÿi lÃ&nbsp;m tháº¿
sáº½ bá» qua dáº¥u káº¿t thÃºc.
\begin{command}
  \begin{Theorem}
   some text ... but no end mark
   
  \end{Theorem}
\end{command}

\begin{Theorem}\label{ex-empty-line}
some text ... but no end mark

\end{Theorem}


%% Now, there is a corollary which should appear with a different
%% name in the list of corollaries:
BÃ¢y giá» lÃ&nbsp; há»‡ quáº£ sáº½ xuáº¥t hiá»‡n vá»›i tÃªn riÃªng hÆ¡i khÃ¡c
trong danh sÃ¡ch |Corollary|:
\begin{command}
  \begin{Corollary*}[title in text]\label{otherlabel}
  ...
  \end{Corollary*}
  \addtheoremline{Corollary}{title in list}
\end{command}
\begin{Corollary*}[title in text]%
\label{otherlabel}\ignorespaces
\begin{center}
   Thá»ƒ hiá»‡n trong \\
   mÃ´i trÆ°á»ng \\
   canh giá»¯a.  
\end{center}
\end{Corollary*}
\addtheoremline{Corollary}{title in list}

\begin{Theorem}[trÃ­ch dáº«n]
\begin{quote}
%% In quote environments, the text is normally indented from left 
%% and right by the same space. The endmark is not indented from the 
%% right margin, i.e., it is typeset to the right margin of the
%% surrounding text.
Trong mÃ´i trÆ°á»ng trÃ­ch dáº«n |quote|, ná»™i dung thÆ°á»ng Ä‘Æ°á»£c thá»¥t vÃ&nbsp;o á»Ÿ táº¥t
cáº£ cÃ¡c dÃ²ng á»Ÿ cáº£ bÃªn trÃ¡i vÃ&nbsp; bÃªn pháº£i. Tuy nhiÃªn, dáº¥u káº¿t thÃºc sáº½ khÃ´ng
váº«n Ä‘Æ°á»£c Ä‘áº·t Ä‘Ãºng vÃ&nbsp;o lá» bÃªn pháº£i.
\end{quote}
\end{Theorem}

%% Here is an example for turning off the endmark automatics and
%% manual handling:
DÆ°á»›i Ä‘Ã¢y lÃ&nbsp; vÃ­ dá»¥ vá» viá»‡c táº¯t/báº­t viá»‡c Ä‘áº·t dáº¥u káº¿t thÃºc tá»± Ä‘á»™ng.

\begin{command}
  \begin{Theorem}[Manual End Mark]\label{somelabel}
  a line of text with a manually set endmark \hfill\TheoremSymbol\\
  some more text, but no automatic endmark set. \NoEndMark
  \end{Theorem}
\end{command}

\begin{Theorem}[Manual End Mark]\label{somelabel}
a line of text with a manually set endmark \hfill\TheoremSymbol \\
some more text, but no automatic endmark set. \NoEndMark
\end{Theorem}

%% Also, one should note, that |\hfill| is inserted to set
%% the endmark at the right margin.
Äá»ƒ Ã½ ráº±ng, lá»‡nh |\hfill| Ä‘Æ°á»£c chÃ¨n vÃ&nbsp;o trÆ°á»›c dáº¥u káº¿t thÃºc
Ä‘á»ƒ Ä‘áº·t dáº¥u Ä‘Ã³ vÃ&nbsp;o lá» bÃªn pháº£i.

\begin{Example}[nhanh hÆ¡n]
%%  It also works for short one's. 
Dáº¥u káº¿t thÃºc Ä‘Æ°á»£c tá»± Ä‘á»™ng Ä‘áº·t trá»Ÿ láº¡i...
\end{Example}

%% If you are tired of the greek numbers and the indentation for lemmata ... 
%% you can redefine it:
Náº¿u báº¡n khÃ´ng thÃ­ch dÃ¹ng chá»‰ sá»‘ lÃ&nbsp; chá»¯ sá»‘ Hy Láº¡p vÃ&nbsp; cÃ¡ch thá»¥t Ä‘áº§u dÃ²ng cho
|Lemma|, báº¡n cÃ³ thá»ƒ Ä‘á»‹nh nghÄ©a láº¡i:
\theoremstyle{changebreak}
\theoremheaderfont{\normalfont\bfseries}\theorembodyfont{\slshape}
\theoremsymbol{\ensuremath{\heartsuit}}
\theoremsymbol{\ensuremath{\diamondsuit}}
\theoremseparator{:}
\theoremindent0cm
\theoremnumbering{arabic}
\renewtheorem{Lemma}{Lemma}
\begin{command}
  \theoremstyle{changebreak}
  \theoremheaderfont{\normalfont\bfseries}\theorembodyfont{\slshape}
  \theoremsymbol{\ensuremath{\heartsuit}}
  \theoremsymbol{\ensuremath{\diamondsuit}}
  \theoremseparator{:}
  \theoremindent0.5cm
  \theoremnumbering{arabic}
  \renewtheorem{Lemma}{Lemma}
\end{command}
\begin{Lemma}
%%   another lemma, with arabic numbering ... note that the numbering
%%   continues.
	BÃ¢y giá» lÃ&nbsp; bá»• Ä‘á» khÃ¡c, vá»›i cÃ¡ch Ä‘Ã¡nh sá»‘ dÃ¹ng chá»¯ sá»‘ áº¢ Ráº­p. ChÃº Ã½ ráº±ng
	chá»‰ sá»‘ váº«n tiáº¿p tá»¥c tÄƒng.
\end{Lemma}

%% the optional argument (i.e.\ the `theorem'-name) can be accessed by
%% |\|\meta{env}|name|. 
Tham sá»‘ bá»• sung xÃ¡c Ä‘á»‹nh tÃªn riÃªng cá»§a |THM| cÃ³ thá»ƒ láº¥y Ä‘Æ°á»£c nhá» 
cháº³ng háº¡n |\Theoremname| hoáº·c |Examplename|,\ldots --- Ä‘iá»u nÃ&nbsp;y chá»‰
cÃ³ thá»ƒ lÃ&nbsp;m bÃªn trong mÃ´i trÆ°á»ng |THM| hiá»‡n táº¡i mÃ&nbsp; thÃ´i.

\begin{command}
  \begin{Theorem}[\color{red}{some name}\normalcolor]
  Obviously, we are in Theorem~\Theoremname.
  \end{Theorem}
\end{command}
\begin{Theorem}[\color{red}{some name}\normalcolor]
Obviously, we are in Theorem~\Theoremname.
\end{Theorem}

%% This feature can e.g.\ be used for automatically generating
%% executable code and a commented solution sheet:
TÃ­nh nÄƒng cÃ³ thá»ƒ dÃ¹ng, cháº³ng háº¡n Ä‘á»ƒ sinh ra tá»± Ä‘á»™ng cÃ¡c mÃ£
cho mÃ´i trÆ°á»ng chÃº thÃ­ch, |verbatim|,\ldots:
\begin{command}
  \begin{exercise}[quicksort]
   `\meta{the exercise text}'
  \begin{verbatimwrite}{solutions/\exercisename.c}
   `\meta{C-code}'
  \end{verbatimwrite}
  \verbatiminput{solutions/\exercisename.c}
  \end{exercise}
\end{command}
%% This will write the C-code to a file |solutions/quicksort.c| and 
%% type it also on the solution sheet.
Äoáº¡n mÃ£ trÃªn sáº½ viáº¿t mÃ£ \meta{C-code} vÃ&nbsp;o táº­p tin |solutions/quicksort.c|,
vÃ&nbsp; sau Ä‘Ã³ náº¡p vÃ&nbsp;o nhá» lá»‡nh |\verbatiminput|.

%% Now, we define an environment |KappaTheorem| which uses the same 
%% style parameters as Theorems and is numbered together with
%% Corollaries (Theorems are also numbered with Corollaries).
%% Note that we define a complex header text and a complex end mark.
\medskip
BÃ¢y giá», ta Ä‘á»‹nh nghÄ©a mÃ´i trÆ°á»ng |KappaTheorem| sá»­ dá»¥ng cÃ¹ng kiá»ƒu
nhÆ° mÃ´i trÆ°á»ng |Theorem|, Ä‘Æ°á»£c Ä‘Ã¡nh sá»‘ tiáº¿p theo cÃ¡c Há»‡ quáº£ (|Corollary|)
(cÃ¡c |Theorem| cÅ©ng Ä‘Æ°á»£c Ä‘Ã¡nh sá»‘ theo |Corollary|). Äá»ƒ Ã½ ráº±ng,
ta sáº½ Ä‘Æ°a ra pháº§n |header| vÃ&nbsp; pháº§n dáº¥u káº¿t thÃºc khÃ¡ phá»©c táº¡p.

\begin{command}
  \theoremclass{Theorem}
  \theoremsymbol{\ensuremath{a\atop b}}
  \newtheorem{KappaTheorem}[Theorem]{\(\kappa\)-Theorem}
\end{command}

\theoremclass{Theorem}
\theoremsymbol{\ensuremath{a\atop b}}
\newtheorem{KappaTheorem}[Theorem]{\(\kappa\)-Theorem}

\begin{KappaTheorem}[1st \(\kappa\)-Theorem]\label{kappatheorem1}
ÄÃ¢y lÃ&nbsp; Ä‘á»‹nh lÃ½ |kappa| Ä‘áº§u tiÃªn. 
\end{KappaTheorem}

% =====================================================================

%% \subsection{Extended Referencing Features}
\subsection{\texorpdfstring{Tham kháº£o má»Ÿ rá»™ng}{Tham khao mo rong}}%
\label{sec-ExtRef}[Má»¥c]

%% The standard |\label| command is extended by an optional argument
%% which is intended to contain the ``name'' of the structure which
%% is labeled, allowing more comfortable referencing; e.g., this
%% section has been started with
Lá»‡nh |\label| chuáº©n Ä‘Æ°á»£c má»Ÿ rá»™ng: bÃ¢y giá» nÃ³ cÃ³ thá»ƒ nháº­n thÃªm tham sá»‘
bá»• sung dÃ¹ng Ä‘á»ƒ xÃ¡c Ä‘á»‹nh tÃªn cáº¥u trÃºc dÃ¹ng Ä‘á»ƒ Ä‘Ã¡nh nhÃ£n -- nhá» Ä‘Ã³
viá»‡c tham kháº£o chÃ©o Ä‘Æ°á»£c linh hoáº¡t hÆ¡n.
VÃ­ dá»¥, má»¥c nÃ&nbsp;y Ä‘Æ°á»£c Ä‘Ã¡nh nhÃ£n nhÆ° sau:
\begin{command}
  \subsection*{....}%
  \label{sec-ExtRef}[Mu.c]
\end{command}

%% As already stated, for theorem-like environments the optional 
%% argument is filled in automatically, i.e., 
NhÆ° Ä‘Ã£ nÃ³i, vá»›i mÃ´i trÆ°á»ng |THM|, pháº§n tham sá»‘ bá»• sung cá»§a |\label|
sáº½ Ä‘Æ°á»£c tá»± Ä‘á»™ng thÃªm vÃ&nbsp;o. Do Ä‘Ã³, 
\begin{command}
|\begin{Theorem}[Manual End Mark]\label{somelabel}|
\end{command}
%% (cf.\ page~\pageref{somelabel}) is equivalent to
tÆ°Æ¡ng Ä‘Æ°Æ¡ng vá»›i (xem \vpageref{somelabel})
\begin{command}
|\begin{Theorem}[Manual End Mark]\label{somelabel}[Theorem]|
\end{command}

%% |\thref{|\meta{label}|}| additionally outputs the contents
%% of the optional argument which has been associated with \meta{label}:
Lá»‡nh |\thref{|\meta{label}|}| sáº½ sinh ra thÃ´ng tin bá»• sung, cho biáº¿t
tÃªn |THM| tÆ°Æ¡ng á»©ng vá»›i tham sá»‘ bá»• sung cá»§a |\label|. VÃ­ dá»¥:

\begin{command}
  This is \thref{sec-ExtRef}
  ... \thref{somelabel}
  ... \thref{otherlabel}
  ... \thref{kappatheorem1}
\end{command}
sáº½ cho ta
%% generates
\begin{quote}
This is \thref{sec-ExtRef}.
  ... \thref{somelabel}
  ... \thref{otherlabel}
  ... \thref{kappatheorem1}
\end{quote}

%% Here one must be careful that the handling of the optional 
%% argument is automated
%% only for environments defined by |\newtheorem|, i.e., \emph{not} 
%% for sectioning, equations, or enumerations. 
Pháº£i cáº©n tháº­n: viá»‡c xá»­ lÃ½ tham sá»‘ bá»• sung
Ä‘Æ°á»£c tiáº¿n hÃ&nbsp;nh tá»± Ä‘á»™ng chá»‰ cho cÃ¡c mÃ´i trÆ°á»ng Ä‘Æ°á»£c Ä‘á»‹nh nghÄ©a nhá» |\newtheorem|,
nghÄ©a lÃ&nbsp; sáº½ khÃ´ng cÃ³ sá»± quáº£n lÃ½ cho cÃ¡c Má»¥c (|\section|),
phÆ°Æ¡ng trÃ¬nh (|equation|) hay danh sÃ¡ch (|enumerate|).

%% Calling |\thref{|\meta{label}|}| for a label which has been
%% set without an optional argument can result in different unintended
%% results: If \meta{label} is not inside a theorem-like environment, an
%% error message is obtained, otherwise the type of the surrounding
%% theorem-like environment is output, e.g., calling |\thref{label}| 
%% then results in ``Theorem~\meta{number}''!
Viá»‡c gá»i |\thref{|\meta{label}|}| cho cÃ¡c nhÃ£n chÆ°a Ä‘Æ°á»£c thiáº¿t láº­p vá»›i
pháº§n tham sá»‘ bá»• sung sáº½ sinh ra cÃ¡c káº¿t quáº£ khÃ³ tÆ°á»Ÿng tÆ°á»£ng: náº¿u \meta{label}
khÃ´ng á»Ÿ bÃªn trong mÃ´i trÆ°á»ng |THM|, lá»—i sáº½ sinh ra; ngÆ°á»£c láº¡i, tÃªn |THM|
hiá»‡n táº¡i sáº½ Ä‘Æ°á»£c dÃ¹ng, vÃ­ dá»¥ viá»‡c gá»i |\thref{xxxlabel}|
sáº½ sinh ra cháº³ng háº¡n ``Äá»‹nh lÃ½~\meta{number}''!

\medskip
ChÃº Ã½ ráº±ng khÃ´ng cÃ³ há»— trá»£ cho cÃ¡c tham kháº£o chÃ©o phá»©c, nhÆ° ``xem Äá»‹nh lÃ½~5 vÃ&nbsp;~7''.%
\footnote{This would require plural-forms
for different languages and handling of \texttt{\bslash ref}-lists, probably
splitting into different sublists for different environments. If 
someone is interested in programming this, please contact us;
\color{red}{it seems to be algorithmically easy, but tedious.}}

%% Additionally, currently there is no support for multiple references 
%% such as ``see Theorems~5 and~7'' (this would require plural-forms
%% for different languages and handling of |\ref|-lists, probably
%% splitting into different sublists for different environments)\footnote{If 
%% someone is interested in programming this, please contact us; it 
%% seems to be algorithmically easy, but tedious.}.

%% \subsection{List of Theorems and Friends}
\subsection{\texorpdfstring{Danh sÃ¡ch THM}{Danh sach THM}}

%% Note, that we put the following lists into the |quote|-environment
%% to emphazise them from the surrounding text. So the lists
%% are indented slightly at the margin.
%% ChÃº Ã½ ráº±ng, á»Ÿ Ä‘Ã¢y cÃ¡c danh sÃ¡ch Ä‘Æ°á»£c bá»‘ trÃ­ trong cÃ¡c mÃ´i trÆ°á»ng Ä‘áº·c biá»‡t
%% Ä‘á»ƒ nháº¥n máº¡nh káº¿t quáº£, cÃ²n thá»±c táº¿, chÃºng sáº½ Ä‘Æ°á»£c thá»ƒ hiá»‡n vá»›i lá» trÃ¡i
%% khÃ¡c á»Ÿ Ä‘Ã¢y má»™t chÃºt!.

%% With 
\medskip
Vá»›i
\begin{command}
  \addtotheoremfile{Added into all theorem lists}
\end{command}
%% in every list, an additional line of text would be inserted.
%% But it isn't actually done in this documentation since we want
%% to use different list formats.
thÃ¬ á»Ÿ má»i danh sÃ¡ch, dÃ²ng ``|Added into all theorem lists|''
sáº½ Ä‘Æ°á»£c chÃ¨n vÃ&nbsp;o. Tuy nhiÃªn, trong tÃ&nbsp;i liá»‡u nÃ&nbsp;y, ta khÃ´ng lÃ&nbsp;m nhÆ° tháº¿,
vÃ¬ ta dÃ¹ng Ä‘á»‹nh dáº¡ng khÃ¡c cá»§a danh dÃ¡ch |THM|.

%% Only for the list of Examples, this one is added: 
\medskip Äá»ƒ chÃ¨n chá»‰ danh sÃ¡ch cÃ¡c vÃ­ dá»¥ (|Example|), cÃ³ thá»ƒ lÃ&nbsp;m cháº³ng háº¡n
\begin{command}
  \addtotheoremfile[Example]{%
    \color{blue}{Only concerning Example lists}}
\end{command}
\addtotheoremfile[Example]{\color{blue}{Only concerning Example lists}}

%% With
\medskip
Vá»›i
\begin{command}
  \theoremlisttype{all}
  \listtheorems{Lemma} 
\end{command}
%% all lemmas are listed:
má»i bá»• Ä‘á» sáº½ Ä‘Æ°á»£c liá»‡t kÃª

\bigskip
{\color{red!75!green!50!blue}
 \theoremlisttype{all}
 \listtheorems{Lemma}}
\bigskip

%% From the examples, only those are listed which have an optional name: 
NhÆ° ta tháº¥y trong káº¿t quáº£ trÃªn, xuáº¥t hiá»‡n dÃ²ng chá»‰ toÃ&nbsp;n dáº¥u cháº¥m.
Ta sá»­ dá»¥ng kiá»ƒu danh sÃ¡ch |opt| Ä‘á»ƒ liá»‡t kÃª chá»‰ cÃ¡c bá»• Ä‘á» cÃ³ tÃªn riÃªng:
\begin{command}
  \theoremlisttype{opt}
 \listtheorems{Example}
\end{command}
%% leads to
cho ta káº¿t quáº£

\bigskip
{\color{red!75!green!50!blue}
 \theoremlisttype{opt}
 \listtheorems{Example}
}

\bigskip
%% One should note the line \emph{Only concerning example lists}, which
%% was added by the |\addtotheoremfile|-statement above.
NhÆ° ta tháº¥y, dÃ²ng chá»¯ ``\color{blue}{Only concerning Example lists}\normalcolor''
xuáº¥t hiá»‡n á»Ÿ cuá»‘i danh sÃ¡ch --- ta Ä‘Ã£ thÃªm dÃ²ng nÃ&nbsp;y nhá» |\addtotheoremfile|
á»Ÿ vÃ­ dá»¥ trÃªn.

\medskip
%% For the next list, another layout, using the |tabular|-environment, 
%% is defined:
BÃ¢y giá» ta Ä‘á»‹nh nghÄ©a kiá»ƒu danh sÃ¡ch má»›i, sá»­ dá»¥ng mÃ´i trÆ°á»ng |tabular|:
\begin{command}
  \newtheoremlisttype{tab}%
   {\begin{tabular*}{\linewidth}%
    {@{}lrl@{\extracolsep{\fill}}r@{}}}%
    {##1&amp;##2&amp;##3&amp;##4\\}%
   {\end{tabular*}}
\end{command}
%% Thus, by saying
Sá»­ dá»¥ng kiá»ƒu má»›i |tab| nhÆ° sau:
\begin{command}
  \theoremlisttype{tab}
  \listtheorems{Theorem,Lemma}
\end{command}
%% theorems and lemmata are listed:
CÃ¡c Ä‘á»‹nh lÃ½ vÃ&nbsp; bá»• Ä‘á» sáº½ Ä‘Æ°á»£c liá»‡t kÃª theo kiá»ƒu má»›i:

\bigskip
{\color{red!75!green!50!blue}
%% \begin{quote}
  \DeleteShortVerb{\|}
    \newtheoremlisttype{tab}%
    {\begin{tabular*}{\linewidth}{@{}lrl@{\extracolsep{\fill}}r@{}}}%
    {##1&amp;##2&amp;##3&amp;##4\\}%
    {\end{tabular*}}
   \theoremlisttype{tab}
   \listtheorems{Theorem,Lemma}
  \MakeShortVerb{\|}%
%% \end{quote}%
}

\vskip-12pt

%% \LaTeX-lists can also be used to format the theoremlist.
%% The input
CÅ©ng cÃ³ thá»ƒ sá»­ dá»¥ng mÃ´i trÆ°á»ng táº¡o danh sÃ¡ch cá»§a \LaTeX{}
Ä‘á»ƒ táº¡o kiá»ƒu má»›i nhÆ° sau Ä‘Ã¢y:
\begin{command}
  \newtheoremlisttype{list}%
    {\begin{trivlist}\item}
    {\item[##2 ##1:]\ ##3\dotfill ##4}%
    {\end{trivlist}}
  \theoremlisttype{list}
  \listtheorems{Corollary}
\end{command}
%% leads to%
Káº¿t quáº£ vá»›i kiá»ƒu má»›i bÃ¢y giá» lÃ&nbsp;

{\color{red!75!green!50!blue}
%% \begin{quote}%
\DeleteShortVerb{\|}%
  \newtheoremlisttype{list}%
    {\begin{trivlist}\item}%
    {\item[##2 ##1:]\ ##3\dotfill ##4}%
    {\end{trivlist}}%
  \theoremlisttype{list}
  \listtheorems{Lemma}%
  \MakeShortVerb{\|}%
%% \end{quote}%
}

%% In this example, after the item, \verb*!\ ! is used instead of 
%% \verb*! !, because in the latter case, |\dotfill| will produce an 
%% error if the optional argument (|##3|) 
%% is missing.
Trong vÃ­ dá»¥ nÃ&nbsp;y, sau má»—i pháº§n tá»­ |\item| cá»§a danh sÃ¡ch,
lá»‡nh \verb*#\ # Ä‘Æ°á»£c dÃ¹ng thay cho \verb*# #, vÃ¬ trong trÆ°á»ng há»£p sau,
lá»‡nh |\dotfill| sáº½ bÃ¡o lá»—i náº¿u pháº§n tham sá»‘ bá»• sung |##3| khÃ´ng cÃ³.	

\endinput
</pre></body></html>