File tree Expand file tree Collapse file tree 3 files changed +34
-24
lines changed Expand file tree Collapse file tree 3 files changed +34
-24
lines changed Original file line number Diff line number Diff line change @@ -366,27 +366,32 @@ \section{A Listing Example}
366
366
367
367
\section {An Algorithm Example }
368
368
369
- \begin {algorithm }
370
- \caption {An algorithm with caption}\label {alg:cap }
371
- \begin {algorithmic }
372
- \Require $ n \geq 0 $
373
- \Ensure $ y = x^n$
374
- \State $ y \gets 1 $
375
- \State $ X \gets x$
376
- \State $ N \gets n$
377
- \While {$ N \neq 0 $ }
378
- \If {$ N$ is even}
379
- \State $ X \gets X \times X$
380
- \State $ N \gets \frac {N}{2}$ \Comment {This is a comment}
381
- \ElsIf {$ N$ is odd}
382
- \State $ y \gets y \times X$
383
- \State $ N \gets N - 1 $
384
- \EndIf
385
- \EndWhile
386
- \end {algorithmic }
369
+
370
+ % % This is needed if you want to add comments in
371
+ % % your algorithm with \Comment
372
+ \SetKwComment {Comment}{/* }{ */}
373
+
374
+ \begin {algorithm }[hbt!]
375
+ \caption {An algorithm with caption}\label {alg:example }
376
+ \KwData {$ n \geq 0 $ }
377
+ \KwResult {$ y = x^n$ }
378
+ $ y \gets 1 $ \;
379
+ $ X \gets x$ \;
380
+ $ N \gets n$ \;
381
+ \While {$ N \neq 0 $ }{
382
+ \eIf {$ N$ is even}{
383
+ $ X \gets X \times X$ \;
384
+ $ N \gets \frac {N}{2} $ \Comment *[r]{This is a comment}
385
+ }{\If {$ N$ is odd}{
386
+ $ y \gets y \times X$ \;
387
+ $ N \gets N - 1 $ \;
388
+ }
389
+ }
390
+ }
387
391
\end {algorithm }
388
392
389
- \blindtext
393
+ An algorithm example is shown in Algorithm~\ref {alg:example }. \blindtext
394
+
390
395
391
396
\section {Some Technique One }
392
397
\index {Some Technique One|(}
@@ -426,15 +431,19 @@ \section{Related Work}
426
431
427
432
\section {An Example of Suppressing Page Numbers on A Float Page }
428
433
429
- Kindly refer to Figure~\ref {fig:largegoku }.
434
+ Kindly refer to Figure~\ref {fig:largegoku }.
435
+
436
+ \blindtext
430
437
431
438
\begin {figure }[!ht]
432
439
\thisfloatpagestyle {empty} % % This is the key line to suppress page decorations (including nos.) on float pages.
433
440
\centering
434
441
\includegraphics [width=0.9\textwidth ]{goku-large}
435
- \caption [Short Random Caption]{\blindtext }
442
+ \caption [Short Random Caption]{Page numbers are suppressed on this page.}
436
443
\label {fig:largegoku }
437
444
\end {figure }
438
445
439
- \section {Summary }
440
446
\blindtext
447
+
448
+ \section {Summary }
449
+ \blindtext [3]
Original file line number Diff line number Diff line change 43
43
\RequirePackage {listings} % For code listings
44
44
\usepackage [width=.95\textwidth ]{caption } % set the width of the captions
45
45
46
- \RequirePackage {algorithm}
47
- \RequirePackage {algpseudocode}
46
+ \RequirePackage [ruled]{algorithm2e} % use algorithm2e instead of algorithm only, as the former is more customizable
47
+ % %\RequirePackage{algpseudocode} % do not include this, as algorithm2e will include this as well
48
+
48
49
\RequirePackage {courier}
49
50
50
51
\usepackage [defaultsans ]{lato } % Sans font to use
You can’t perform that action at this time.
0 commit comments