Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
171 views15 pages

HCMUT Report Template

HCMUT_Report_Template

Uploaded by

kokohelo113
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
171 views15 pages

HCMUT Report Template

HCMUT_Report_Template

Uploaded by

kokohelo113
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

VIETNAM NATIONAL UNIVERSITY HO CHI MINH CITY

HO CHI MINH CITY UNIVERSITY OF TECHNOLOGY


FACULTY OF COMPUTER SCIENCE AND ENGINEERING

Course name h

Report type h

Report title h

Advisor(s): Advisor h
Student(s): Student 1 ID 1
Student 2 ID 2
Student 3 ID 3

HO CHI MINH CITY, OCTOBER 2024


Ho Chi Minh City University of Technology
Faculty of Computer Science and Engineering

Contents
1 Normal section 4

2 Label prefixes 4

3 Better tables 5

4 Better enumerator 8

5 Codespace 9
5.1 Listings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
5.2 Minted . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

6 Figures with flexible width 12

List of Figures
6.1 Example image 1x1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
6.2 Example image A4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
6.3 Set figure width imperatively . . . . . . . . . . . . . . . . . . . . . . . . . 14

List of Tables
3.1 Tabularx table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
3.2 Long table caption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

Listings
5.1 External import . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
5.2 External import but with a line range . . . . . . . . . . . . . . . . . . . . . 9
5.3 Embedded . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

3
Ho Chi Minh City University of Technology
Faculty of Computer Science and Engineering

1 Normal section
This is how you normally work with LATEX, but you can also split a project into smaller
files for easier management. To import other files, you can use \input{} or \include{}.
There differences can be found at https://tex.stackexchange.com/a/250, but in short

\include{filename} = \clearpage \input{filename} \clearpage

2 Label prefixes
There are no definite rules for label prefixes, but you can use the following as a
guideline.

• chap: for chapters

• sec: for sections

• subsec: for subsections

• eq: for equations

• fig: for figures

• tab: for tables

• enum: for enumerators and items

• fn: for footnotes

• lst: for listings

• alg: for algorithms

• app: for appendices

The \caption macro increases the used counter and sets the current label text which
is used by \label. If you use \label before it the old label text is used instead, which
leads to a wrong number. Always use \label after \caption and not before or in it.
That said, conventions are just conventions, and you can use whatever you want as
long as you are consistent.

4
Ho Chi Minh City University of Technology
Faculty of Computer Science and Engineering

3 Better tables
The recommended way is by using the booktabs package and drop all vertical rules.
tabularx is simply tabular but with X environment, meaning that it will try to use
all of \linewidth.

Table 3.1: Tabularx table

OOP FP

Pros

Cons

More information can be found at https://latex-tutorial.com/tables-in-latex/.


In tabular, with the p, m or b column types, sometimes you will notice that the width
of the table is wider than the sum of the widths of the columns. This is due to the padding
added by the \tabcolsep and the line width of the vertical separators which are added
by default.

1 \tabcolsep + p{length} + \tabcolsep

By default, tabcolsep is set to 6pt, which equals to 2.12mm in digital printing. The
use of @{}..@{} voids this behavior.
Additionally, if you have to insert a very long table, which takes up two or more pages
in your document, use the longtable package.

5
Ho Chi Minh City University of Technology
Faculty of Computer Science and Engineering

Table 3.2: Long table caption

Begin of Table

Something something else

Lots of lines like this


Lots of lines like this
Lots of lines like this
Lots of lines like this
Lots of lines like this
Lots of lines like this
Lots of lines like this
Lots of lines like this
Lots of lines like this
Lots of lines like this
Lots of lines like this
Lots of lines like this
Lots of lines like this
Lots of lines like this
Lots of lines like this
Lots of lines like this
Lots of lines like this
Lots of lines like this
Lots of lines like this
Lots of lines like this
Lots of lines like this
Lots of lines like this
Lots of lines like this
Lots of lines like this
Lots of lines like this

6
Ho Chi Minh City University of Technology
Faculty of Computer Science and Engineering

Continuation of Table 3.2

Something something else

Lots of lines like this


Lots of lines like this
Lots of lines like this
Lots of lines like this
Lots of lines like this
Lots of lines like this
Lots of lines like this
Lots of lines like this
Lots of lines like this
Lots of lines like this
Lots of lines like this
Lots of lines like this
Lots of lines like this
Lots of lines like this
Lots of lines like this
Lots of lines like this
Lots of lines like this
Lots of lines like this
Lots of lines like this
Lots of lines like this
Lots of lines like this
Lots of lines like this
Lots of lines like this
Lots of lines like this
Lots of lines like this
Lots of lines like this

7
Ho Chi Minh City University of Technology
Faculty of Computer Science and Engineering

Continuation of Table 3.2

Something something else

Lots of lines like this


Lots of lines like this
Lots of lines like this
Lots of lines like this
Lots of lines like this
Lots of lines like this
Lots of lines like this
Lots of lines like this
Lots of lines like this
Lots of lines like this
Lots of lines like this
Lots of lines like this

End of Table

You may use the \label command so that you can cross reference longtables with
\ref. Note however, that the \label command should not be used in a heading that may
appear more than once. Place it either in the firsthead, or in the body of the table. It
should not be the first command in any entry.

4 Better enumerator
Normal enumerator gets the job done, but what if you want custom numbering? This
implementation allows custom labeling, either by pre-defined rules or in-place.

d.yeah First item

e.yeah Second item

custom Third item

8
Ho Chi Minh City University of Technology
Faculty of Computer Science and Engineering

5 Codespace
5.1 Listings
This is the recommended way to insert simple code.

Listing 5.1: External import



1 class iostream :
2 def __lshift__ ( self , other ) :
3 print ( other , end = ' ')
4 return self
5

6 def __repr__ ( self ) :


7 return ' '
8

10 if __name__ == " __main__ " :


11 cout = iostream ()
12 endl = '\ n '
13 cout << " Hello " << " , " << " World ! " << endl

Listing 5.2: External import but with a line range



1 if __name__ == " __main__ " :
2 cout = iostream ()
3 endl = '\ n '
4 cout << " Hello " << " , " << " World ! " << endl

Listing 5.3: Embedded



1 from typing import Iterator
2

3 # This is an example
4 class Math :
5 @staticmethod
6 def fib ( n : int ) -> Iterator [ int ]:
7 """ Fibonacci series up to n. """

9
Ho Chi Minh City University of Technology
Faculty of Computer Science and Engineering

8 a, b = 0, 1
9 while a < n :
10 yield a
11 a, b = b, a + b
12

13 result = sum ( Math . fib (42) )


14 print ( " The answer is {} " . format ( result ) )

• Inline
print('Hello, world!')

5.2 Minted
This provide better looking code, but requires external setup:
Minted requires python Pygments and the --shell-escape flag.

• External import

1 class iostream:
2 def __lshift__(self, other):
3 print(other, end='')
4 return self
5

6 def __repr__(self):
7 return ''
8

10 if __name__ == "__main__":
11 cout = iostream()
12 endl = '\n'
13 cout << "Hello" << ", " << "World!" << endl

• With a line range

10
Ho Chi Minh City University of Technology
Faculty of Computer Science and Engineering

1 if __name__ == "__main__":
2 cout = iostream()
3 endl = '\n'
4 cout << "Hello" << ", " << "World!" << endl

• Embedded

1 from typing import Iterator


2

3 # This is an example
4 class Math:
5 @staticmethod
6 def fib(n: int) -> Iterator[int]:
7 """Fibonacci series up to n."""
8 a, b = 0, 1
9 while a < n:
10 yield a
11 a, b = b, a + b
12

13 result = sum(Math.fib(42))
14 print("The answer is {}".format(result))

• Inline
print('Hello, world!')

11
Ho Chi Minh City University of Technology
Faculty of Computer Science and Engineering

6 Figures with flexible width

1×1
(Original size: 200×200 bp)

Figure 6.1: Example image 1x1

12
Ho Chi Minh City University of Technology
Faculty of Computer Science and Engineering

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut,
placerat ac, adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu libero, nonummy
eget, consectetuer id, vulputate a, magna. Donec vehicula augue eu neque. Pellentesque habitant
morbi tristique senectus et netus et malesuada fames ac turpis egestas. Mauris ut leo. Cras
viverra metus rhoncus sem. Nulla et lectus vestibulum urna fringilla ultrices. Phasellus eu tellus
sit amet tortor gravida placerat. Integer sapien est, iaculis in, pretium quis, viverra ac, nunc.
Praesent eget sem vel leo ultrices bibendum. Aenean faucibus. Morbi dolor nulla, malesuada eu,
pulvinar at, mollis ac, nulla. Curabitur auctor semper nulla. Donec varius orci eget risus. Duis
nibh mi, congue eu, accumsan eleifend, sagittis quis, diam. Duis eget orci sit amet orci dignissim
rutrum.
Nam dui ligula, fringilla a, euismod sodales, sollicitudin vel, wisi. Morbi auctor lorem non
justo. Nam lacus libero, pretium at, lobortis vitae, ultricies et, tellus. Donec aliquet, tortor sed
accumsan bibendum, erat ligula aliquet magna, vitae ornare odio metus a mi. Morbi ac orci et
nisl hendrerit mollis. Suspendisse ut massa. Cras nec ante. Pellentesque a nulla. Cum sociis
natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aliquam tincidunt
urna. Nulla ullamcorper vestibulum turpis. Pellentesque cursus luctus mauris.
Nulla malesuada porttitor diam. Donec felis erat, congue non, volutpat at, tincidunt tris-
tique, libero. Vivamus viverra fermentum felis. Donec nonummy pellentesque ante. Phasellus
adipiscing semper elit. Proin fermentum massa ac quam. Sed diam turpis, molestie vitae, plac-
erat a, molestie nec, leo. Maecenas lacinia. Nam ipsum ligula, eleifend at, accumsan nec, suscipit
a, ipsum. Morbi blandit ligula feugiat magna. Nunc eleifend consequat lorem. Sed lacinia nulla
vitae enim. Pellentesque tincidunt purus vel magna. Integer non enim. Praesent euismod nunc
eu purus. Donec bibendum quam in tellus. Nullam cursus pulvinar lectus. Donec et mi. Nam
vulputate metus eu enim. Vestibulum pellentesque felis eu massa.
Quisque ullamcorper placerat ipsum. Cras nibh. Morbi vel justo vitae lacus tincidunt ultrices.
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. In hac habitasse platea dictumst.
Integer tempus convallis augue. Etiam facilisis. Nunc elementum fermentum wisi. Aenean
placerat. Ut imperdiet, enim sed gravida sollicitudin, felis odio placerat quam, ac pulvinar elit
purus eget enim. Nunc vitae tortor. Proin tempus nibh sit amet nisl. Vivamus quis tortor vitae
risus porta vehicula.
Fusce mauris. Vestibulum luctus nibh at lectus. Sed bibendum, nulla a faucibus semper,
leo velit ultricies tellus, ac venenatis arcu wisi vel nisl. Vestibulum diam. Aliquam pellentesque,
augue quis sagittis posuere, turpis lacus congue quam, in hendrerit risus eros eget felis. Maecenas
eget erat in sapien mattis porttitor. Vestibulum porttitor. Nulla facilisi. Sed a turpis eu lacus
commodo facilisis. Morbi fringilla, wisi in dignissim interdum, justo lectus sagittis dui, et vehicula
libero dui cursus dui. Mauris tempor ligula sed lacus. Duis cursus enim ut augue. Cras ac magna.
Cras nulla. Nulla egestas. Curabitur a leo. Quisque egestas wisi eget nunc. Nam feugiat lacus
vel est. Curabitur consectetuer.
Suspendisse vel felis. Ut lorem lorem, interdum eu, tincidunt sit amet, laoreet vitae, arcu.
Aenean faucibus pede eu ante. Praesent enim elit, rutrum at, molestie non, nonummy vel, nisl.
Ut lectus eros, malesuada sit amet, fermentum eu, sodales cursus, magna. Donec eu purus.
Quisque vehicula, urna sed ultricies auctor, pede lorem egestas dui, et convallis elit erat sed
nulla. Donec luctus. Curabitur et nunc. Aliquam dolor odio, commodo pretium, ultricies non,
pharetra in, velit. Integer arcu est, nonummy in, fermentum faucibus, egestas vel, odio.

Figure 6.2: Example image A4

13
Ho Chi Minh City University of Technology
Faculty of Computer Science and Engineering

With \adjincludegraphics (or \adjustimage) you can also use the original width
as \width:

Image
Figure 6.3: Set figure width imperatively

14
Ho Chi Minh City University of Technology
Faculty of Computer Science and Engineering

References
[1] Donald E. Knuth. Literate programming. The Computer Journal, 27(2):97–111, 1984.

[2] Donald E. Knuth. The TEX Book. Addison-Wesley Professional, 1986.

[3] Leslie Lamport. LATEX: a Document Preparation System. Addison Wesley, Mas-
sachusetts, 2 edition, 1994.

[4] Michael Lesk and Brian Kernighan. Computer typesetting of technical journals on
UNIX. In Proceedings of American Federation of Information Processing Societies:
1977 National Computer Conference, pages 879–888, Dallas, Texas, 1977.

[5] Frank Mittelbach, Michel Gossens, Johannes Braams, David Carlisle, and Chris Row-
ley. The LATEX Companion. Addison-Wesley Professional, 2 edition, 2004.

15

You might also like