I used this and trying to put underline as shown here
This works alone perfectly but whenever I try to add the line
\titleformat*{\section}{\bfseries\sectionfont}{\thesubsection}{1em}{#1}[{\titlerule[0.8pt]}]
instead of
\titleformat*{\section}{\bfseries\sectionfont}
it says
Missing
\begin{document}. ...ion}{\bfseries\sectionfont}{\thesubsection
\documentclass[12pt,a4paper]{article}
\usepackage[explicit]{titlesec} % control over title section
\usepackage{fontspec} % change to system font
\usepackage{anyfontsize} % changing font size any
\usepackage{graphicx} % import figure
\usepackage{setspace} % line gap => \setstretch
\usepackage{parskip} % linegap => \linespread
\usepackage{gensymb} % degree symbol
\usepackage{ragged2e} % Text alignment
\usepackage{xcolor} % changing color
\usepackage{sectsty} % underline section
\definecolor{Nblack}{rgb}{0,0,0}
\newfontfamily\sectionfont[Color=Nblack,Scale=1.34]{Arial}
\newfontfamily\subsectionfont[Color=Nblack,Scale=1.34]{Garton Medium}
\newfontfamily\subsubsectionfont[Color=Nblack,Scale=1.34]{Garton Medium}
\titleformat{\section}{\bfseries\sectionfont}{\thesubsection}{1em}{#1}[{\titlerule[0.8pt]}]
\titleformat{\subsection}{\subsectionfont}
\titleformat{\subsubsection}{\itshape\subsubsectionfont}
\begin{document}
\section{Introduction}
\end{document}
or if I remove [explicit]
and add *
after \titleformat
it gives
Illegal parameter number in definition of
\ttlf@section. ...esubsection}{1em}{#1}[{\titlerule[0.8pt]}]
Also, like to have First Word Big caps and others small caps
\documentclass
is missing, and other issues .... – user31729 Aug 24 '16 at 14:11