Skip to content

Instantly share code, notes, and snippets.

@dohyunkim
Last active July 30, 2026 08:41
Show Gist options
  • Select an option

  • Save dohyunkim/b4bf1e785109ade47f7471de554298c1 to your computer and use it in GitHub Desktop.

Select an option

Save dohyunkim/b4bf1e785109ade47f7471de554298c1 to your computer and use it in GitHub Desktop.
hangul chapter, part format with new latex section templates
\DocumentMetadata{}
\documentclass{book}
\usepackage[hangul]{kotex}
\setmainhangulfont{Noto Serif CJK KR}[Script=Hangul, AutoFakeSlant]
\IfInstanceExistsT{heading}{chapter}
{\EditInstance{heading}{chapter}{prefix={\KSTHE}, number-format={\thechapter~\chaptername}}
\AddToHook{cmd/appendix/after}
{\EditInstance{heading}{chapter}{prefix={\appendixname}, number-format={\thechapter}}}}
\IfInstanceExistsT{heading}{part}
{\EditInstance{heading}{part}{prefix={\KSTHE}, number-format={\thepart~\partname}}}
\begin{document}
\part{테스트}
\chapter{테스트}
\section{테스트}
테스트
\subsection{테스트}
테스트
\appendix
\chapter{테스트}
\paragraph{테스트} 테스트.
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment