4

I have tried to specify the color for my section as shown here, but it has no effect. What am I doing wrong?

MWE:

\documentclass[10pt,letterpaper]{article}
\usepackage{lipsum}

\usepackage{multirow}
\usepackage{textcomp}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{url}
\usepackage{hyperref}
\usepackage{geometry}
\usepackage{enumitem}
\usepackage[T1]{fontenc}
\usepackage{array}
\usepackage[osf,sc]{mathpazo}

\usepackage{titlesec}

\def\name{John Doe}

\def\footerlink{http://www.org.edu}
\hypersetup{
  colorlinks = true,
  urlcolor = black,
  pdfauthor = {\name},
  pdfkeywords = {John Doe},
  pdftitle = {\name: Curriculum Vitae},
  pdfsubject = {Curriculum Vitae},
  pdfpagemode = UseNone
}

\geometry{
  body={6.8in, 10.0in},
  left=0.8in,
  top=0.5in
}

% Customize page headers
\pagestyle{myheadings}
\markright{\name}
\thispagestyle{empty}

% Custom section fonts
\usepackage{sectsty}
\usepackage{xspace}
\sectionfont{\rmfamily\mdseries\Large}
\subsectionfont{\rmfamily\mdseries\itshape\large}

\setlength\parindent{0em}

\newenvironment{noBullets}{
  \begin{list}{}{
    \setlength{\leftmargin}{1.0em}
  }
}{
  \end{list}
}


\titleformat{\section}
{\color{red}\normalfont\Large\bfseries}
{\color{red}\thesection}{1em}{}


\begin{document}



{\Large \name}

\section*{Test section}
\lipsum[1]


\end{document}
0
3

You're using two conflicting packages, sectsty and titlesec. Use either of them, but not both.

If you use sectsty you can surely specify color with something like

\usepackage{sectsty}
\sectionfont{\normalfont\bfseries\Large\color{red}}
\subsectionfont{\normalfont\mdseries\itshape\large}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.