KTUG 한국 텍 사용자 그룹

Menu

KTUG :: Q&A 마당 › section과 title에서 한글 산세리프체를 볼드체로 쓰기

고양이 | 2023.01.16 13:48:51 | 메뉴 건너뛰기 쓰기
% Command to store the current chapter image to use for all future chapters, can be changed any time in the document and can be empty
\newcommand{\thechapterimage}{}
\newcommand{\chapterimage}[1]{\renewcommand{\thechapterimage}{#1}}

% Command to store the current whitespace above the chapter title box for all future chapters, can be changed at any time in the document
\newcommand{\thechapterspaceabove}{}
\newcommand{\chapterspaceabove}[1]{\renewcommand{\thechapterspaceabove}{#1}}

% Command to store the current whitespace below the chapter title box for all future chapters, can be changed at any time in the document
\newcommand{\thechapterspacebelow}{}
\newcommand{\chapterspacebelow}[1]{\renewcommand{\thechapterspacebelow}{#1}}

% Command to output the chapter title with optional background image
\newcommand{\outputchaptertitle}[2]{
\begin{tikzpicture}[remember picture,overlay]
% If a chapter image has been specified
\expandafter\ifstrequal\expandafter{\thechapterimage}{}{}{
% Output the chapter image
\node[
anchor=north west, % Anchor point on the image
inner sep=0pt, % Inner padding
] at (current pageorth west) {\includegraphics[width=\paperwidth]{\thechapterimage}};
}
% Box with the chapter title
\draw[anchor=west] (current pagerth west) node [
anchor=north west, % Anchor point of the chapter box
xshift=\Gm@lmargin, % Horizontal distance from the left side of the page
yshift=-\thechapterspaceabove, % Vertical distance from the top of the page
line width=2pt, % Border line thickness
rounded corners=10pt, % Rounded corners amount
draw=ocre, % Border line color
fill=black!5, % Box background color
fill opacity=0.6, % Background transparency
text opacity=1, % Text transparency
inner ysep=12.5pt, % Inner vertical padding
inner xsep=20pt, % Inner horizontal padding
align=flush left, % Text alignment inside box
text width=1.2\linewidth, % Box width (wider than page to go off the right side)
font=\huge\sffamily\bfseries, % Font styling for chapter title
] {\parbox{0.85\linewidth}{\strut\raggedright\expandafter\ifstrequal\expandafter{#1}{}{}{#1. }#2\vspace{-3pt}}}; % Chapter title in a fixed width box for wrapping
\end{tikzpicture}
}

% Numbered chapters
\titleformat
{\chapter} % Section type being modified
[block] % Shape type, can be: hang, block, display, runin, leftmargin, rightmargin, drop, wrap, frame
{\outputchaptertitle{\thechapter}{#1}} % Format of the whole section
{} % Format of the section label
{0cm} % Space between the title and label
{} % Code before the label
[] % Code after the label

% Unnumbered chapters
\titleformat
{name=\chapter, numberless} % Section type being modified
[block] % Shape type, can be: hang, block, display, runin, leftmargin, rightmargin, drop, wrap, frame
{\outputchaptertitle{}{#1}} % Format of the whole section
{} % Format of the section label
{0cm} % Space between the title and label
{} % Code before the label
[] % Code after the label
\titlespacing*{\chapter}{0pt}{0pt}{\thechapterspacebelow} % Spacing around section titles, the order is: left, before and after

%-------------------------------------------

\titleformat
{\section} % Section type being modified
[block] % Shape type, can be: hang, block, display, runin, leftmargin, rightmargin, drop, wrap, frame
{\bfseries\sffamily\Large} % Format of the whole section
{\llap{\textcolor{ocre}{\thesection}\hspace{1em}}#1} % Format of the section label
{0cm} % Space between the title and label
{} % Code before the label
[] % Code after the label

\titleformat
{name=\section, numberless} % Section type being modified
[block] % Shape type, can be: hang, block, display, runin, leftmargin, rightmargin, drop, wrap, frame
{\bfseries\textsf\Large} % Format of the whole section
{#1} % Format of the section label
{0cm} % Space between the title and label
{} % Code before the label
[] % Code after the label

\titlespacing*{\section}{0pt}{12pt}{6pt} % Spacing around section titles, th

현재 위 코드를 이용하여 책을 쓰려고 하고 있습니다.

하지만, 한글을 넣을 때는 볼드체로 되지 않더라고요. (챕터, 섹션 이름을 넣을 때)

\bfseries\sffamily 부분이 글자체와 볼드를 결정해주는 것 같아서 이것저것 해보지만 잘 안됐습니다.

1. \textbf는 되지 않습니다.
2. \sffamily를 지우면 명조체가 되고 볼드가 됩니다. 하지만, 저는 산세리프체로 한글이 쓰이길 원합니다.

legrand-orangebook

이 템플릿을 사용해서 쓰고 있습니다. (림크 청부가 안되네요..)

도와주시면 감사하겠습니다 ㅠ

*현재 한글을 kotex롤 넣어 쓰고 있습니다.

댓글 [2]

댓글 쓰기

목록 삭제

KTUG 한국 텍 사용자 그룹