곽로그

Mac에서 Jupyter notebook 폰트 바꾸기 본문

tool

Mac에서 Jupyter notebook 폰트 바꾸기

일도이동 2023. 4. 10. 23:20
반응형

D2Coding에 한번 빠지고 나서는 코딩관련 툴에서는 모두 D2Coding을 사용하고 있다. jupyter notebook에서도 폰트를 바꾸려고 하는데, 파일 >옵션 이런 곳에 있을 줄 알았더니 css파일을 수정해줘야 한다 

 

순서는 

1. juptyter 폴더 아래 config 폴더를 찾고

2. css  폴더를 생성 후, css 파일을 만들면 된다

하나씩 해보자. 

 

1. jupyter 설정 파일을 찾자

.jupyter는 /User/사용자이름 폴더 아래에 있다. 폴더 내부를 보면 jupyer_notebook_config.py라는 이름의 config파일을 찾을 수 있다. 

 

2. config파일이 있는 경로에 custom폴더를 만들자

터미널에서 만드는 거라면 mkdir custom

 

 

3. custom 폴더 안에 custom.css파일 만들기

jupyter notebook에서 원하는 css를 명시 후, custom 폴더 아래 custom.css 파일을 만든다

아래는 예시고 여기서 원하는 대로 커스텀 하면 될 것 같다. 

div.CodeMirror, div.output_area pre, div.output_wrapper pre {
	font-family: D2Coding;
	font-size: 16.5pt;
	line-height: 120%;

}
div#notebook, div.prompt {
	font-family: D2Coding;
	font-size: 16pt;
	line-height: 120%;
	min-width:1ex; /* 셀 왼쪽여백 최소로 줄임 */
}

div.prompt bdi{ /* in/out 제거 */
	display:none
}

.cm-s-ipython.CodeMirror {background: #ffffff;}

.rendered_html td {

 font-family: D2Coding;

 font-size: 16pt;

}

.rendered_html table {

 font-family: D2Coding;

 margin-left: 8px;

 font-size: 16px;

 margin-right: auto;

 border: none;

 border-collapse: collapse;

 border-spacing: 0;

/* color: #cccccc; */

 table-layout: fixed;

}

.rendered_html thead  {

 font-family: D2Coding;

 /*font-size: 10.3pt !important;*/

 font-size: 16pt;

/* background: #1e1e1e;

 color: #cccccc;*/

 border-bottom: 1px solid #1e1e1e;

 vertical-align: bottom;

}

.rendered_html th {

 border-style: none;

 font-family: D2Coding;

 font-size: 16pt;

}

 

 

4. jupyer notebook 재실행

재실행 하면

변경전
변경 후

반응형

'tool' 카테고리의 다른 글

[IntelliJ] 인텔리제이에서 웹프로젝트 만들기  (0) 2020.09.18
Comments