> For the complete documentation index, see [llms.txt](https://overleaf-pro.ayaka.space/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://overleaf-pro.ayaka.space/latex/ko/in-depth-articles/44-step-8-how-to-create-a-simple-latex-package-to-configure-your-variable-fonts.md).

# 8단계: 가변 글꼴을 구성하기 위한 간단한 LaTeX 패키지를 만드는 방법

&#x20;[소개](https://www.overleaf.com/learn/latex/Articles/How_to_use_OpenType_variable_fonts_with_LaTeX?preview=true)   [1단계](https://www.overleaf.com/learn/latex/Articles/Step_1:_Setting_up_an_Overleaf_project_to_use_variable_fonts?preview=true)   [2단계](https://www.overleaf.com/learn/latex/Articles/Step_2:_An_introduction_to_LaTeX_fonts?preview=true)   [3단계](https://www.overleaf.com/learn/latex/Articles/Step_3:_Replacing_LaTeX’s_default_fonts_with_variable_fonts?preview=true)   [4단계](https://www.overleaf.com/learn/latex/Articles/Step_4:_How_to_configure_an_italic_variable_font_using_fontspec?preview=true)   [5단계](https://www.overleaf.com/learn/latex/Articles/Step_5:_LaTeX_font_weights_and_named_instances_of_variable_fonts?preview=true)   [6단계](https://www.overleaf.com/learn/latex/Articles/Step_6:_Using_variable_fonts_to_add_bold_fonts_to_an_Overleaf_project?preview=true)   [7단계](https://www.overleaf.com/learn/latex/Articles/Step_7:_Using_Noto_Sans_and_Roboto_Mono_variable_fonts_with_LaTeX?preview=true)   [8단계](https://www.overleaf.com/learn/latex/Articles/Step_8:_How_to_create_a_simple_LaTeX_package_to_configure_your_variable_fonts?preview=true)   [예시와 프로젝트](https://www.overleaf.com/learn/latex/Articles/Overleaf_projects_showing_how_to_use_variable_fonts_with_LaTeX?preview=true)&#x20;

fontspec를 사용해 가변 글꼴을 구성하면 설정 코드가 많아져 문서의 머리말이 복잡해질 수 있습니다. 이 단계에서는 fontspec의 구성 코드를 담는 간단한 패키지를 만드는 방법을 보여줍니다. 이를 통해 문서 머리말을 더 단순하게 하고, 이후 글꼴을 더 쉽게 변경할 수 있습니다.

## 간단한 LaTeX 패키지를 만들고 사용하는 방법

이 자습서에서 만든 fontspec 구성 코드를 위한 간단한 LaTeX 패키지를 만들려면 다음 단계를 따르세요.

1. 다음을 선택하세요 **새 파일** 아이콘 (![Overleaf icon representing adding a file](/files/e35d4e11dd80cd7e8c5cac3574165a7f488363a1))을 사용해 새 프로젝트 파일을 만드세요. 파일 이름을 `myfontsettings.sty` 로 지정하고 **만들기**.

![Overleaf의 파일 추가 모달 창을 보여주는 이미지](/files/bf8c72cf145ef1d9d7017078ea7af1962f765e64)

3. fontspec 구성 코드를 파일에 붙여넣습니다 `myfontsettings.sty`. 여기에서는 가변 글꼴 자습서에서 추가한 Noto Serif, Noto Sans, Roboto Mono용 fontspec 구성 코드를 사용합니다. 다른 가변 글꼴을 사용하는 경우 fontspec 설정을 수정해야 합니다.

```latex
% myfontsettings.sty
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{myfontsettings}[2024/06/13 v1.0 내 사용자 지정 글꼴 설정]

% 이 간단한 패키지는 fontspec 구성 코드를 포함합니다
% 문서 머리말을 깔끔하고 정돈된 상태로 유지합니다

% fontspec 패키지 불러오기
\RequirePackage{fontspec}

% 문서의 본문 글꼴 설정
\setmainfont{NotoSerif-VariableFont-wdth-wght.ttf}[
Weight=400,
ItalicFont=NotoSerif-Italic-VariableFont-wdth-wght.ttf,
FontFace = {b}{n}{Font =NotoSerif-VariableFont-wdth-wght.ttf,Weight=600},
FontFace = {b}{it}{Font =NotoSerif-Italic-VariableFont-wdth-wght.ttf,Weight=600}
]

% 문서 패밀리 산세리프 글꼴
\setsansfont{NotoSans-VariableFont-wdth-wght.ttf}[
Weight=400,
ItalicFont=NotoSans-Italic-VariableFont-wdth-wght.ttf,
FontFace = {b}{n}{Font = NotoSans-VariableFont-wdth-wght.ttf,Weight=600},
FontFace = {b}{it}{Font = NotoSans-Italic-VariableFont-wdth-wght.ttf,Weight=600}
]

% 문서 패밀리 고정폭 글꼴
\setmonofont{RobotoMono-VariableFont-wght.ttf}[
NFSSFamily=RobotoMono,
Weight=300,
ItalicFont=RobotoMono-Italic-VariableFont-wght.ttf,
FontFace = {b}{n}{Font =RobotoMono-VariableFont-wght.ttf,Weight=550},
FontFace = {b}{it}{Font = RobotoMono-Italic-VariableFont-wght.ttf, Weight=550}
]

\endinput
```

5. 이 패키지를 사용하려면 다음 줄을 추가하세요 `\usepackage{myfontsetting}` 를 문서 머리말에.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://overleaf-pro.ayaka.space/latex/ko/in-depth-articles/44-step-8-how-to-create-a-simple-latex-package-to-configure-your-variable-fonts.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
