
섹션, 하위 섹션, 하위 하위 섹션에 색상을 지정하고 싶습니다.숫자내 논문 문서에. 이 스레드가 끝날 때 해결 방법을 시도했습니다.섹션 번호 색상 그런데 색상 패키지와 충돌이 있다는 오류가 발생합니다.
저는 Andre Miéde의 뒷면 템플릿을 사용하고 있습니다.https://www.overleaf.com/latex/templates/classic-esis-style-v4-dot-2-by-andre-miede/dwgtvykzvdtk
제 순진함을 양해해주세요. 저는 최근에야 LaTeX를 배우기 시작했습니다.
내 코드의 예는 다음과 같습니다.
\documentclass{scrreprt}
\input{classicthesis-config}
\usepackage{classicthesis}
\usepackage[svgnames]{xcolor}
\colorlet{SecnumColor}{teal}
\newcommand*\colorsecnum[2][SecnumColor]{%
\expandafter\renewcommand\csname#2format\endcsname{%
\textcolor{#1}{\csname the#2\endcsname}\autodot\enskip
}}
\begin{document}
\section{A section}
Bla
\subsection{A subsection}
Bla.
\end{document}
섹션화와 관련하여 classicesis-config에 포함된 내용은 다음과 같습니다.
\RequirePackage{titlesec}
\ifthenelse{\boolean{@parts}}{
\newcommand{\ct@parttext}{\relax}
\newcommand{\ctparttext}[1]{\renewcommand{\ct@parttext}{#1 \relax}}
\titleformat{\part}[display]
{\normalfont\centering\large}
{\thispagestyle{empty}\partname~\MakeTextUppercase{\thepart}}{1em}
{\color{Violet}\spacedallcaps}[\bigskip\normalfont\normalsize\color{Violet}\begin{quote}\ct@parttext\end{quote}]
}{\relax}
\ifthenelse{\boolean{@linedheaders}}
{\titleformat{\chapter}[display]
{\relax}{\raggedleft{\color{myheadingscolour}\chapterNumber\thechapter} \\ }{0pt}
{\vspace*{.9\baselineskip}\raggedright\spacedallcaps}[\normalsize\vspace*{.8\baselineskip}\titlerule]
}{
\titleformat{\chapter}[display]
{\relax}{\mbox{}\oldmarginpar{\vspace*{-3\baselineskip}\color{myheadingscolour}\chapterNumber\thechapter}}{0pt}
{\raggedright\spacedallcaps}[\normalsize\vspace*{.8\baselineskip}\titlerule]
}
\titleformat{\section}
{\relax}{\textsc{\MakeTextLowercase{\thesection}}}{1em}{\spacedlowsmallcaps}
\titleformat{\subsection}
{\relax}{\textsc{\MakeTextLowercase{\thesubsection}}}{1em}{\normalsize\itshape}
\titleformat{\subsubsection}
{\relax}{\textsc{\MakeTextLowercase{\thesubsubsection}}}{1em}{\normalsize\itshape}
\titleformat{\paragraph}[runin]
{\normalfont\normalsize}{\theparagraph}{0pt}{\spacedlowsmallcaps}
\renewcommand{\descriptionlabel}[1]{\hspace*{\labelsep}\spacedlowsmallcaps{#1}}
\ifthenelse{\boolean{@nochapters}}
{\relax}
{\titlespacing*{\chapter}{0pt}{1\baselineskip}{1.2\baselineskip}}
\titlespacing*{\section}{0pt}{1.25\baselineskip}{1\baselineskip}
\titlespacing*{\subsection}{0pt}{1.25\baselineskip}{1\baselineskip}
\titlespacing*{\paragraph}{0pt}{1\baselineskip}{1\baselineskip}
답변1
패키지는 classicthesis
이미 옵션으로 로드되어 xcolor
있으므로 로 다시 dvipsnames
로드하려고 하면 옵션이 충돌합니다 . 이제 당신에게 드리는 질문은 다음과 같습니다.xcolor
svgnames
옵션 이 정말 필요한가요
svgnames
?
teal
귀하의 MWE는 에 설정된 기본 색상의 일부인 색상을 사용합니다 xcolor
. 즉, 선만 제거하면 제대로 구축될 것입니다.
\usepackage[svgnames]{xcolor}
귀하의 코드에서. 기본 세트(19)와 명명된 세트(68)의 색상만 사용하는 것이 만족스러우면 dvips
이 작업만 수행해도 괜찮습니다.
만약 너라면~ 해야 하다svg
세트(151) 에서 명명된 색상을 사용하는 경우 한 가지 옵션은 발행하는 것입니다.
\PassOptionsToPackage{svgnames}{xcolor}
~ 전에you \usepackage{classicthesis}
이므로 및 옵션이 xcolor
모두 로드됩니다 . 그러나 이는 및 세트의 이름이 상당히 중복된다는 점에서 큰 경고가 됩니다 . 예를 들어 둘 다 "Cyan"과 "Fuschia", "ForestGreen" 및 "LimeGreen"을 정의하지만 서로 다른 색상을 지정합니다. 패키지가 구성되는 방식에 따라 충돌이 있을 때 버전이 사용됩니다. 매뉴얼 에는 이 경우 버전을 대신 사용하려는 경우 수행할 작업에 대한 설명이 있습니다 . 직접 로드하지 않고 에 의존 하므로 컨텍스트에서 더 많은 작업이 필요합니다 .dvipsnames
svgnames
svg
dvips
svg
xcolor
dvips
xcolor
classicthesis