logo

라텍스 색상

xcolor 패키지는 텍스트에 색상 추가를 지원합니다. 이를 사용하여 배경, 글꼴 색상 및 페이지 배경을 설정할 수 있습니다. 미리 정의된 색상 중에서 색상을 선택하거나 RGB를 사용하여 색상을 만들 수 있습니다. 수학 공식도 색칠할 수 있습니다.

코드나 프로그램으로 가져온 패키지는 다음과 같이 작성됩니다.

 usepackage{xcolor} 

다양한 색상 수에 액세스하는 데 사용되는 명령은 다음과 같습니다.

    이름:16가지 기본 색상에 액세스할 수 있습니다.dvips이름:이를 통해 64가지 이상의 색상에 액세스할 수 있습니다.svname:약 150가지 색상에 액세스할 수 있습니다.x11이름:300가지 이상의 색상을 제공합니다.

위에서 언급한 명령은 코드에서 다음과 같이 선언됩니다.

 documentclass[dvipsnames, usenames]{beamer} 

입력 명령은 컬러 텍스트 아래에 나열되어 있습니다:

컬러 텍스트를 입력하는 방법에는 두 가지가 있습니다. 하나는 extcolor 명령을 사용하고 또 다른 방법은 색상 명령.

그만큼 텍스트 색상 명령은 다음과 같이 선언됩니다. extcolor{ 언급된 색상 }{ 텍스트 } .

암리타 라오 배우

색상 명령은 {color{언급된 색상}일부 텍스트}로 선언됩니다.

textcolor 명령은 한 문단 전체에 사용되는 반면, color 명령은 텍스트가 다른 tex 환경과 여러 줄에 걸쳐 실행되는 데 사용됩니다.

배경색을 변경하려면 다음 명령을 사용할 수 있습니다. pagecolor {언급된 색상}. 이 명령은 전체 페이지의 배경색을 지정합니다.

텍스트의 배경색을 지정하려면 colorbox {언급된 색상}{text} 명령.

배경색과 텍스트 색상을 모두 변경하려면 아래와 같은 방법으로 명령을 사용할 수 있습니다.

 colorbox{mentioned-color}{text}{color{mentioned-color}text} 

모든 색의 근원이 되거나 모든 곳에 사용되는 원색은빨간색,노란색, 그리고파란색 (물고기) . 3차 2차색은 주황색, 보라색, 녹색으로 두 가지 원색을 혼합하여 형성됩니다. 6차색은 1차색과 2차색이 혼합되어 만들어진다.

모든 시스템에서 사용할 수 있는 사전 정의된 색상은 다음과 같습니다.

라텍스 색상

사전 정의된 다른 색상은 다음과 같습니다.

라텍스 색상

텍스트에 색상을 지정하는 간단한 예를 살펴보겠습니다. 코드는 아래와 같습니다:

 documentclass[12pt]{article} usepackage[dvipsnames]{xcolor} % declaring the package is necessary to implement colors egin{document} The text is written here.\ 	extcolor{red}{the purpose of learning LaTeX is great.}\ %this LaTeX pattern is used to print the default layout of the work Latex. This is also the text end{document} 

산출:

라텍스 색상

다른 선을 색칠하는 코드는 다음과 같습니다.

 documentclass[12pt]{article} usepackage[dvipsnames]{xcolor} egin{document} 	extcolor{red}{This the text} \ 	extcolor{magenta}{the purpose of learning LaTeX is great.} \ 	extcolor{yellow}{the lines of different colors}\ 	extcolor{pink}{the text is written above} \ 	extcolor{green}{The software used is Texmaker.} \ 	extcolor{orange}{the text is a combination of words and sentences.} end{document} 

산출:

라텍스 색상

새로운 색상

색상도 몇 가지 있습니다. 이러한 색상이 적절하지 않은 경우 색상을 만들 수 있습니다.

정의하려면 새로운 색상 패키지에 다음을 포함해야 합니다. xcolor 패키지. 새로운 색상을 생성하는 데 사용되는 명령은 다음과 같습니다.

 definecolor{color name}{prototype}{specifications} 

여기, 명세서 색상에 대한 설명을 의미하며 프로토타입이 모델입니다. 다섯 가지 기본 모델 또는 프로토타입이 있습니다. 회색, rgb, RGB, HTML, cmyk . 다양한 모델의 색상 범위와 프로토타입 및 사양에 대한 설명은 다음과 같습니다.

나. 회색: 회색 음영 범위는 다음과 같습니다. 0(검은색) 그리고 1(흰색) . 예를 들어 0.89는 매우 밝은 회색이고 0.20은 어두운 회색입니다. 밝은 회색에 대해 정의된 명령은 다음과 같습니다.

 definecolor{light-gray}{gray}{0.92} definecolor{dark-gray}{gray}{0.20} 

ii. RGB: 이는 빨간색, 녹색, 파란색의 세 가지 색상을 정의합니다. 범위는 0과 1 사이에서 동일합니다. 명령은 다음과 같이 작성됩니다.

 definecolor{orange}{rgb}{1, 0.5, 0} 

iii. RGB: 이 프로토타입에서 수량은 각 색상의 0에서 255 사이의 숫자로 표시됩니다. 명령은 다음과 같이 작성됩니다.

 definecolor{orange}{RGB}{255, 127, 0} 

iv. HTML: RRGGBB 형식으로 작성된 6개의 16진수입니다. 형식은 HTML에서 사용되는 형식과 유사합니다. html에 대한 명령은 다음과 같이 작성됩니다.

 definecolor{orange}{HTML}{FF7F00} 

안에. cmyk: 청록색(Cyan), 마젠타색(Magenta), 노란색(Yellow), 검정색(Black)을 뜻합니다. 색상의 양은 0에서 1 사이로 표시됩니다. 명령은 다음과 같이 작성됩니다.

 definecolor{orange}{cmyk}{0, 1, 0.5,0}. 

색상 혼합 명령에 대한 코드는 다음과 같습니다.

 documentclass[12pt]{article} usepackage[dvipsnames]{xcolor} egin{document} {color{red!50!yellow}colored text}\ % it is a mixture of 50 percent red and 50 percent yellow {color{pink!80!yellow}LaTeX text}\ {color{white!60!red}Some text}\ {color{blue!25!orange}this is text}\ % it is a mixture of 25 percent blue and 75 percent orange {color{blue!55!orange}Nice text}\ {color{green!70!yellow}Any text}\ {color{blue!20!white!30!green}Beautiful text}\ % it is a mixture of (20*0.3) percent blue, ((100-20)*0.3) percent white and (100-30) percent green {color{pink!40!red!50!yellow}colored text} 	extcolor{blue}{This the text} \ end{document} 

산출:

새로운 색상과 색상에 대한 백분율 분포 간의 차이를 확인할 수 있습니다.

라텍스 색상

프로토타입 명령의 코드는 다음과 같습니다.

 documentclass[14pt]{article} usepackage[dvipsnames]{xcolor} egin{document} {color[rgb]{0,0,1} The text will look blue-colored} \ 	extcolor[rgb]{0,1,0}{The text will look green-colored} \ {color[rgb]{1,1,0} The text will look red-green color mixture} \ 	extcolor[rgb]{1,0,1}{The text will look red-blue color mixture} \ end{document} 

산출:

라텍스 색상

한 줄에 두 개 이상의 색상을 삽입할 수도 있습니다. 해당 유형에 대한 코드는 다음과 같습니다.

 documentclass[14pt]{article} usepackage[dvipsnames]{xcolor} egin{document} This is the {color{red!80!yellow}LaTeX text}\ {color{blue!70!yellow}This topic contains} {color{white!60!red}Some text}\ end{document} 

산출:

라텍스 색상

텍스트 강조

텍스트를 강조 표시하는 데 사용되는 명령이 있습니다. 요구 사항에 따라 원하는 색상을 선택하여 텍스트를 강조할 수 있습니다. 당신은 영혼 패키지 xcolor 강조 표시된 텍스트를 구현하는 패키지입니다.

그만큼 영혼 패키지는 다음과 같이 작성됩니다. 사용패키지{소울}

텍스트를 강조 표시하는 명령은 다음과 같이 작성됩니다. hl{ 임의의 텍스트} . 여기 ' ' 명령은 하이라이트 캡션으로 사용됩니다.

텍스트를 강조 표시하는 간단한 코드는 다음과 같습니다.

 documentclass[12pt]{article} usepackage[dvipsnames]{xcolor} usepackage{soul} egin{document} egin{center} 	extbf{color{red}The highlighted text below :} end{center} The text given here is the hl{highlighted text.} end{document} 

위의 예에서 볼 수 있듯이 굵은 명령, 색상 및 강조 명령을 사용했습니다.

출력은 아래 이미지에 표시됩니다.

라텍스 색상

색상 강조를 지정하려면 sethlcolor{색상 이름} 명령을 사용해야 합니다. 단일 프로그램에서 다양한 색상 하이라이트를 사용할 수도 있습니다.

색상 강조 표시에 대한 코드는 다음과 같습니다.

 documentclass[12pt]{article} usepackage{xcolor, soul}% you can also write both the packages in this format egin{document} egin{center} 	extbf{color{blue}The color highlighted text below :} end{center} sethlcolor{pink} The text given here is the hl{highlighted text in pink.}\ sethlcolor{orange} The text given here is the hl{highlighted text in orange.} end{document} 

산출:

라텍스 색상

텍스트 배경

다음을 사용하여 텍스트 배경 색상과 해당 배경의 프레임/경계 색상을 변경할 수 있습니다. fcolorbox {프레임의 모든 색상}{모든 배경 색상}{텍스트} 명령. 텍스트 배경은 다음을 사용하여 변경할 수 있습니다. colorbox {anycolor}{text} 명령.

텍스트 배경을 변경하려면 코드가 아래와 같습니다.

 documentclass[12pt]{article} usepackage{xcolor, soul} egin{document} colorbox{green}{The text is written here}\ \ colorbox{lightgray}{The text is written here} end{document} 

산출:

라텍스 색상

텍스트 배경과 프레임을 변경하려면 코드가 아래와 같습니다.

 documentclass[12pt]{article} usepackage{xcolor, soul} egin{document} fcolorbox{red}{white}{The text is the simple LaTeX text}\ \ fcolorbox{red}{pink}{This is the normal text}\ \ fcolorbox{blue}{cyan}{text is here}% you can choose any color of your choice end{document} 

산출:

라텍스 색상

페이지 배경색

다음을 사용하여 페이지의 배경색을 변경할 수 있습니다. pagecolor {색상 이름} 명령. 배경색을 변경하는 코드는 다음과 같습니다.

 documentclass[12pt]{article} usepackage{xcolor, soul} egin{document} fcolorbox{red}{white}{The text is the simple LaTeX text}\ \ pagecolor{lightgray} fcolorbox{blue}{cyan}{text is here} end{document} 

여기서 우리가 선택한 것은 밝은 회색 색상. 귀하의 요구 사항에 따라 색상을 변경할 수 있습니다.

산출:

라텍스 색상

색깔이 나오자 주황색 지금. 출력은 다음과 같습니다:

라텍스 색상

당신이 선택하는 경우 분홍색 색상을 지정하면 출력은 다음과 같습니다.

라텍스 색상

컬러 라인

문서의 어느 곳에나 컬러 선을 그릴 수 있습니다. 요구 사항에 따라 선의 너비를 설정할 수 있습니다. 코드는 아래와 같습니다:

 documentclass{article} usepackage[dvipsnames]{xcolor} colorlet{LightRubineRed}{RubineRed!70!} colorlet{Mycolor1}{green!40!orange!60!} egin{document} 

LaTeX의 색상 선은 다음과 같습니다. \

 
oindent {color{LightRubineRed} 
ule{linewidth}{1mm} }\ 
oindent {color{Mycolor1} 
ule{linewidth}{1mm} } end{document} 

여기서는 먼저 색상을 만든 다음 추가로 색상 선을 그리는 데 사용했습니다.

산출:

라텍스 색상