SlideShare a Scribd company logo
subcaption.sty mở rộng quản lý chú thích
hình và bảng
Nguyễn Hữu Điển
Khoa Toán - Cơ - Tin học
ĐHKHTN Hà Nội, ĐHQGHN
1 Giới thiệu
Gói lệnh subcaption.sty nằm trong gói lệnh caption.sty vẫn ở địa chỉ
http://tug.ctan.org/tex-archive/macros/latex/contrib/caption/
Khi ta chạy caption.ins thì gói lệnh subcaption.sty được sinh ra và khi đó ta
sẽ sử dụng được.
Khi dùng ta thực hiện ngay
usepackage[<Tùy chọn>]{caption}
usepackage[<Tùy chọn>]{subcaption}
Ta có thể sử dụng trực tiếp tùy chọn cho gói lệnh này như:
usepackage{subcaption}
captionsetup[sub]{<Tùy chọn>}
Mặc định đặt trong subcaption.sty là:
margin=0pt,font+=small,labelformat=parens,labelsep=space,
skip=6pt,list=false,hypcap=false
Tùy chọn chỉ ra trong usepackage[. . . ]{subcaption}
và captionsetup[sub]{. . .} sẽ được đè lên tùy chọn của
captionsetup{. . .} và captionsetup[figure]{. . .}, nhưng có thể ghi
đè lại bằng captionsetup[subfigure]{. . .} (tương tự cho ‘table’).
Một số quy tắc chỉ ra thứ tự đặt tùy chọn:
1. Đặt tùy chọn cho toàn cục (usepackage[. . . ]{caption} và
captionsetup{. . . })
2. Đặt môi trường (captionsetup[figure -hoặc- table]{. . . })
3. Đặt cho cục bộ (captionsetup{. . .} trong môi trường figure hoặc ta-
ble)
4. Mặc định đặt cho ‘sub’ (margin=0pt,font+=small,. . . , như ở trên)
1
http://nhdien.wordpress.com - Nguyễn Hữu Điển 2
5. Đặt lại cho ‘sub’ (usepackage[. . . ]{subcaption} và
captionsetup[sub]{. . .})
6. Đặt cho môi trường ‘sub’ (captionsetup[subfigure -hoặc- subtable]{. . . })
7. Đặt địa phương ‘sub’ (captionsetup{. . . } trong subfigure hoặc sub-
table)
Ví dụ
usepackage[labelsep=quad,indention=10pt]{caption}
usepackage[labelfont=bf,list=true]{subcaption}
captionsetup[table]{textfont=it,position=top}
captionsetup[subtable]{textfont=sf}
Vậy tùy chon trong môi trường subtable đã có
indention=10pt,position=top,margin=0pt,font=small,
labelformat=parens,labelsep=space,skip=6pt,hypcap=false,
labelfont=bf,list=true,textfont=sf
2 Sử dụng
1. Lệnh subcaption giống như caption và kết hợp với nhau như
begin{figure}[!htp]
begin{minipage}[b]{.5linewidth}
centeringlarge A
subcaption{A subfigure}label{fig:1a}
end{minipage}%
begin{minipage}[b]{.5linewidth}
centeringlarge B
subcaption{Another subfigure}label{fig:1b}
end{minipage}
caption{A figure}label{fig:1}
end{figure}
A
(a) A subfigure
B
(b) Another subfigure
Hình 1 – A figure
2. Môi trường subfigure và subtable
begin{figure}[!htp]
begin{subfigure}[b]{.5linewidth}
centering
includegraphics[height=2cm,width=3cm]{cat.eps}
http://nhdien.wordpress.com - Nguyễn Hữu Điển 3
caption{A subfigure}label{fig:1a}
end{subfigure}%
begin{subfigure}[b]{.5linewidth}
centering
includegraphics[height=2cm,width=3cm]{cat.eps}
caption{Another subfigure}label{fig:1b}
end{subfigure}
caption{A figure}label{fig:1}
end{figure}
(a) A subfigure (b) Another subfigure
Hình 2 – A figure
begin{table}[!htp]
begin{subtable}[b]{.5linewidth}
centering
begin{tabular}{| l | l |}
hline
A&B
hline
C&D
hline
end{tabular}
caption{A subfigure}label{fig:1a}
end{subtable}%
begin{subtable}[b]{.5linewidth}
centering
begin{tabular}{| l | l |}
hline
1&2
hline
3&4
hline
end{tabular}
caption{Another subfigure}label{fig:1b}
end{subtable}
caption{A figure}label{fig:1}
end{table}
http://nhdien.wordpress.com - Nguyễn Hữu Điển 4
A B
C D
1.1: A subtable
1 2
3 4
1.2: Another subtable
Bảng 1 – A figure
2. Dùng lệnh subcaptionbox để định dạng chú thích
Có thể đặt tùy chọn
subcaptionbox[<list entry>]{<heading>}[<width>][<inner-pos>]{<nội dung>}
subcaptionbox*{<heading>}[<width>][<inner-pos>]{<contents>}
begin{figure}[!htp]
centering
subcaptionbox{A catlabel{cat}}
{includegraphics[height=1.3cm,width=2cm]{cat}}
subcaptionbox{An elephantlabel{elephant}}
{includegraphics[height=5cm,width=5cm]{elephant}}
caption{Two animals}label{animals}
end{figure}
(a) A cat (b) An elephant
Hình 3 – Two animals
begin{figure}[!htp]
centering
subcaptionbox{A catlabel{cat}}[.4linewidth]
{includegraphics[height=1.3cm,width=2cm]{cat}}
subcaptionbox{An elephantlabel{elephant}}[.4linewidth]
{includegraphics[height=5cm,width=5cm]{elephant}}
caption{Hai con thú cách ra}label{animals}
end{figure}
http://nhdien.wordpress.com - Nguyễn Hữu Điển 5
(a) A cat (b) An elephant
Hình 4 – Hai con thú cách ra
3. Dùng lệnh subref trích dẫn chỉ số
Ta thấy (ref{cat}) là (4a) và (subref{cat}) là (a)
4. Dùng lệnh DeclareCaptionSubType
DeclareCaptionSubType*[arabic]{table}
captionsetup[subtable]{labelformat=simple,labelsep=colon}
noindentbegin{minipage}{linewidth}
captionsetup{type=table}
centering
caption{Two tables}
subcaptionbox{Table one}[3cm][c]{
begin{tabular}{cc}
A & B
C & D
end{tabular}}
subcaptionbox{Table two}[3cm][c]{
begin{tabular}{cc}
E & F
G & H
end{tabular}}
end{minipage}
Bảng 2 – Two tables
2.1: Table one
A B
C D
2.2: Table two
E F
G H

More Related Content

PDF
Web301 slide 3
PDF
Web301 slide 5
PDF
Bài 3 Một số kỹ thuật lập trình PHP nâng cao - Xây dựng ứng dụng web
PDF
Bài 5 Chức năng gửi email cho website - Xây dựng ứng dụng web
PPT
View sp trigger_udf
PDF
209 008 ky thuat truy xuat file ini
PDF
Các quy định& chuẩn trong lập trình NukeViet
PDF
Chemarrow help
Web301 slide 3
Web301 slide 5
Bài 3 Một số kỹ thuật lập trình PHP nâng cao - Xây dựng ứng dụng web
Bài 5 Chức năng gửi email cho website - Xây dựng ứng dụng web
View sp trigger_udf
209 008 ky thuat truy xuat file ini
Các quy định& chuẩn trong lập trình NukeViet
Chemarrow help

Viewers also liked (16)

PDF
Mhchem help
PDF
Lettrine help
PDF
Bang help 4
PDF
Alterqcm help
PDF
Numname help
PDF
Comment help
PPT
Trabajo gbi
PDF
Powerdot help
PDF
Bang help 3
PDF
Tabvar help
PDF
Txfonts help
PDF
Oubraces help
PPT
1.做ufo的結果不成功都不行 -ufo-haidong zhang
PDF
Bang help 1
PDF
Fantastec viral marketing kakushin webinar
PDF
Lam cot help
Mhchem help
Lettrine help
Bang help 4
Alterqcm help
Numname help
Comment help
Trabajo gbi
Powerdot help
Bang help 3
Tabvar help
Txfonts help
Oubraces help
1.做ufo的結果不成功都不行 -ufo-haidong zhang
Bang help 1
Fantastec viral marketing kakushin webinar
Lam cot help
Ad

More from Mai Mẫn Tiệp (20)

PPT
TAP HUAN GDNGLL 20106.ppt
PPT
HDGDNGLL - SEND MR MINH.ppt
PPTX
Chuyen de 4 - Doi moi GDTrH - Thanh.pptx
PPTX
Bao cao KQ hoat dong NCKH 2016.pptx
PDF
Yhmath help
PDF
Wasysym help
PDF
Vectors help
PDF
Variations help
PDF
Titlesec help
PDF
Tablists help
PDF
Refcheck help
PDF
Powerdot 1so mau help
PDF
Multienumerate help
PDF
Mnsymbol help
PDF
Mbboard help
PDF
Mathtools help
PDF
Marvosym help
PDF
Lam khung help 3
PDF
Lam khung help 2
PDF
Lam khung help 1
TAP HUAN GDNGLL 20106.ppt
HDGDNGLL - SEND MR MINH.ppt
Chuyen de 4 - Doi moi GDTrH - Thanh.pptx
Bao cao KQ hoat dong NCKH 2016.pptx
Yhmath help
Wasysym help
Vectors help
Variations help
Titlesec help
Tablists help
Refcheck help
Powerdot 1so mau help
Multienumerate help
Mnsymbol help
Mbboard help
Mathtools help
Marvosym help
Lam khung help 3
Lam khung help 2
Lam khung help 1
Ad

Recently uploaded (20)

PPTX
Triết học: Vận dụng nguyên tắc phát triển trong nhận thức và hoạt động thực...
DOC
Chương 1 Tính tương đổi của chuyển động.doc
PPTX
Giáo án Lý Luận Chung về Hành chính Nhà nước cập nhật mới....
PPTX
Chương 2 - Mô hình thực thể kết hợp.pptx
PPT
Bài giảng Cơ sở dữ liệu Table trong Access
PPTX
SLIDE BV CHÍNH THỨC LATSKH - note.pptx
DOCX
BÀI TIỂU LUẬN HẾT HỌC PHẦN TỔ CHỨC HOẠT ĐỘNG TRẢI NGHIỆM,HƯỚNG NGHIỆP Ở TRƯỜN...
PDF
BỘ TÀI LIỆU CHINH PHỤC ĐỈNH CAO TIẾNG ANH NĂM 2026 CHUYÊN ĐỀ ÔN HỌC SINH GIỎI...
PPTX
Direct Marketing- chieu thi truyen thong
PPT
Bài giảng Power Point 2003, hướng dẫn học tập
DOCX
6.CQ_KT_Ke toan tai chinh 2_Pham Thi Phuong Thao.docx
DOCX
Set menu 3 món rất hay và hiện đại dành cho người
PDF
Public economy và vai trò trong phân bổ nguồn lực, cung cấp hàng hóa công, đi...
PPTX
TIẾT 11. BÀI 32 DINH DƯỠNG VÀ TIÊU HÓA Ở NGƯỜI.pptx
PPTX
CHƯƠNG I excel,,,,,,,,,,,,,,,,,,,,,,,,,,
PPTX
14. thoát vị bẹn nghẹt bệnh học ngoại khoa.pptx
DOCX
Báo cáo thực tập công ty Ah-GlobalGroup vị trí Data Analyst
PDF
12894-44864-1-CE-1037-1038_Văn bản của bài báo.pdf
DOCX
Bài tập trăc nghiệm vận tốc. tốc độ trong chuyển động thẳng
PPTX
b44_nhiem_zf_tinhjjjjjjjjjjjjjjjjjj.pptx
Triết học: Vận dụng nguyên tắc phát triển trong nhận thức và hoạt động thực...
Chương 1 Tính tương đổi của chuyển động.doc
Giáo án Lý Luận Chung về Hành chính Nhà nước cập nhật mới....
Chương 2 - Mô hình thực thể kết hợp.pptx
Bài giảng Cơ sở dữ liệu Table trong Access
SLIDE BV CHÍNH THỨC LATSKH - note.pptx
BÀI TIỂU LUẬN HẾT HỌC PHẦN TỔ CHỨC HOẠT ĐỘNG TRẢI NGHIỆM,HƯỚNG NGHIỆP Ở TRƯỜN...
BỘ TÀI LIỆU CHINH PHỤC ĐỈNH CAO TIẾNG ANH NĂM 2026 CHUYÊN ĐỀ ÔN HỌC SINH GIỎI...
Direct Marketing- chieu thi truyen thong
Bài giảng Power Point 2003, hướng dẫn học tập
6.CQ_KT_Ke toan tai chinh 2_Pham Thi Phuong Thao.docx
Set menu 3 món rất hay và hiện đại dành cho người
Public economy và vai trò trong phân bổ nguồn lực, cung cấp hàng hóa công, đi...
TIẾT 11. BÀI 32 DINH DƯỠNG VÀ TIÊU HÓA Ở NGƯỜI.pptx
CHƯƠNG I excel,,,,,,,,,,,,,,,,,,,,,,,,,,
14. thoát vị bẹn nghẹt bệnh học ngoại khoa.pptx
Báo cáo thực tập công ty Ah-GlobalGroup vị trí Data Analyst
12894-44864-1-CE-1037-1038_Văn bản của bài báo.pdf
Bài tập trăc nghiệm vận tốc. tốc độ trong chuyển động thẳng
b44_nhiem_zf_tinhjjjjjjjjjjjjjjjjjj.pptx

Subcaption help

  • 1. subcaption.sty mở rộng quản lý chú thích hình và bảng Nguyễn Hữu Điển Khoa Toán - Cơ - Tin học ĐHKHTN Hà Nội, ĐHQGHN 1 Giới thiệu Gói lệnh subcaption.sty nằm trong gói lệnh caption.sty vẫn ở địa chỉ http://tug.ctan.org/tex-archive/macros/latex/contrib/caption/ Khi ta chạy caption.ins thì gói lệnh subcaption.sty được sinh ra và khi đó ta sẽ sử dụng được. Khi dùng ta thực hiện ngay usepackage[<Tùy chọn>]{caption} usepackage[<Tùy chọn>]{subcaption} Ta có thể sử dụng trực tiếp tùy chọn cho gói lệnh này như: usepackage{subcaption} captionsetup[sub]{<Tùy chọn>} Mặc định đặt trong subcaption.sty là: margin=0pt,font+=small,labelformat=parens,labelsep=space, skip=6pt,list=false,hypcap=false Tùy chọn chỉ ra trong usepackage[. . . ]{subcaption} và captionsetup[sub]{. . .} sẽ được đè lên tùy chọn của captionsetup{. . .} và captionsetup[figure]{. . .}, nhưng có thể ghi đè lại bằng captionsetup[subfigure]{. . .} (tương tự cho ‘table’). Một số quy tắc chỉ ra thứ tự đặt tùy chọn: 1. Đặt tùy chọn cho toàn cục (usepackage[. . . ]{caption} và captionsetup{. . . }) 2. Đặt môi trường (captionsetup[figure -hoặc- table]{. . . }) 3. Đặt cho cục bộ (captionsetup{. . .} trong môi trường figure hoặc ta- ble) 4. Mặc định đặt cho ‘sub’ (margin=0pt,font+=small,. . . , như ở trên) 1
  • 2. http://nhdien.wordpress.com - Nguyễn Hữu Điển 2 5. Đặt lại cho ‘sub’ (usepackage[. . . ]{subcaption} và captionsetup[sub]{. . .}) 6. Đặt cho môi trường ‘sub’ (captionsetup[subfigure -hoặc- subtable]{. . . }) 7. Đặt địa phương ‘sub’ (captionsetup{. . . } trong subfigure hoặc sub- table) Ví dụ usepackage[labelsep=quad,indention=10pt]{caption} usepackage[labelfont=bf,list=true]{subcaption} captionsetup[table]{textfont=it,position=top} captionsetup[subtable]{textfont=sf} Vậy tùy chon trong môi trường subtable đã có indention=10pt,position=top,margin=0pt,font=small, labelformat=parens,labelsep=space,skip=6pt,hypcap=false, labelfont=bf,list=true,textfont=sf 2 Sử dụng 1. Lệnh subcaption giống như caption và kết hợp với nhau như begin{figure}[!htp] begin{minipage}[b]{.5linewidth} centeringlarge A subcaption{A subfigure}label{fig:1a} end{minipage}% begin{minipage}[b]{.5linewidth} centeringlarge B subcaption{Another subfigure}label{fig:1b} end{minipage} caption{A figure}label{fig:1} end{figure} A (a) A subfigure B (b) Another subfigure Hình 1 – A figure 2. Môi trường subfigure và subtable begin{figure}[!htp] begin{subfigure}[b]{.5linewidth} centering includegraphics[height=2cm,width=3cm]{cat.eps}
  • 3. http://nhdien.wordpress.com - Nguyễn Hữu Điển 3 caption{A subfigure}label{fig:1a} end{subfigure}% begin{subfigure}[b]{.5linewidth} centering includegraphics[height=2cm,width=3cm]{cat.eps} caption{Another subfigure}label{fig:1b} end{subfigure} caption{A figure}label{fig:1} end{figure} (a) A subfigure (b) Another subfigure Hình 2 – A figure begin{table}[!htp] begin{subtable}[b]{.5linewidth} centering begin{tabular}{| l | l |} hline A&B hline C&D hline end{tabular} caption{A subfigure}label{fig:1a} end{subtable}% begin{subtable}[b]{.5linewidth} centering begin{tabular}{| l | l |} hline 1&2 hline 3&4 hline end{tabular} caption{Another subfigure}label{fig:1b} end{subtable} caption{A figure}label{fig:1} end{table}
  • 4. http://nhdien.wordpress.com - Nguyễn Hữu Điển 4 A B C D 1.1: A subtable 1 2 3 4 1.2: Another subtable Bảng 1 – A figure 2. Dùng lệnh subcaptionbox để định dạng chú thích Có thể đặt tùy chọn subcaptionbox[<list entry>]{<heading>}[<width>][<inner-pos>]{<nội dung>} subcaptionbox*{<heading>}[<width>][<inner-pos>]{<contents>} begin{figure}[!htp] centering subcaptionbox{A catlabel{cat}} {includegraphics[height=1.3cm,width=2cm]{cat}} subcaptionbox{An elephantlabel{elephant}} {includegraphics[height=5cm,width=5cm]{elephant}} caption{Two animals}label{animals} end{figure} (a) A cat (b) An elephant Hình 3 – Two animals begin{figure}[!htp] centering subcaptionbox{A catlabel{cat}}[.4linewidth] {includegraphics[height=1.3cm,width=2cm]{cat}} subcaptionbox{An elephantlabel{elephant}}[.4linewidth] {includegraphics[height=5cm,width=5cm]{elephant}} caption{Hai con thú cách ra}label{animals} end{figure}
  • 5. http://nhdien.wordpress.com - Nguyễn Hữu Điển 5 (a) A cat (b) An elephant Hình 4 – Hai con thú cách ra 3. Dùng lệnh subref trích dẫn chỉ số Ta thấy (ref{cat}) là (4a) và (subref{cat}) là (a) 4. Dùng lệnh DeclareCaptionSubType DeclareCaptionSubType*[arabic]{table} captionsetup[subtable]{labelformat=simple,labelsep=colon} noindentbegin{minipage}{linewidth} captionsetup{type=table} centering caption{Two tables} subcaptionbox{Table one}[3cm][c]{ begin{tabular}{cc} A & B C & D end{tabular}} subcaptionbox{Table two}[3cm][c]{ begin{tabular}{cc} E & F G & H end{tabular}} end{minipage} Bảng 2 – Two tables 2.1: Table one A B C D 2.2: Table two E F G H