(1) I manage to add a line above and below the title. I modify some codes I search from the web, and I can only add a line below the title, but I do not know how to add a line above the section title. Could someone show me how to do it?
(2) Another thing I would like to do is to add a dot after the section number, e.g., I would like "3. The application of ......", but I have "3 The application of ......" Thanks!
The core codes are as follows:
Code: Select all
\usepackage[explicit]{titlesec}\definecolor{Blue}{rgb}{0,0,0.8}.......\titleformat{\section}{\normalfont\large\bfseries\color{Blue}}{\titlerule\vspace{1pc}\thesection}{1em}{#1}[{\titlerule[0.8pt]}]
Complete codes:
Code: Select all
\documentclass[11pt]{article}\usepackage{amsmath,amssymb,amsthm}\usepackage{graphicx}\usepackage[margin=1in]{geometry}\usepackage{fancyhdr}\usepackage[shortlabels]{enumitem}\usepackage{enumitem}\usepackage{xcolor}\usepackage[explicit]{titlesec}\definecolor{Blue}{rgb}{0,0,0.8}\setlength{\parindent}{0pt}\setlength{\parskip}{5pt plus 1pt}\setlength{\headheight}{13.6pt}\numberwithin{equation}{section}\titleformat{\section}{\normalfont\large\bfseries\color{Blue}}{\titlerule\vspace{1pc}\thesection}{1em}{#1}[{\titlerule[0.8pt]}]\newcommand\question[2]{\vspace{.25in}\hrule\textbf{#1. #2}\vspace{.5em}\hrule\vspace{.10in}}\renewcommand\part[1]{\vspace{.10in}\textbf{(#1)}}\pagestyle{fancyplain}\lhead{\textbf{\NAME}}\chead{\textbf{Econ 100A HW\HWNUM}}\rhead{\today}\begin{document}\raggedright\newcommand\NAME{John Smith}\newcommand\HWNUM{3}\section{First section}\section{Lucas puzzle}\section{The Application of}\section{Capital Control and NDF}xxxx\section{Cagan variant and exchange rates}\begin{enumerate}[(a)]