我正在使用文章类,需要在部分周围加下划线或加方框。这是简历标题,所以需要整洁。
\documentclass{article}
\usepackage[a4paper,bottom = 0.6in,left = 0.56in,right = 0.56in,top = 0.6in]{geometry}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{array}
\usepackage{enumitem}
\usepackage{wrapfig}
\usepackage{microtype}
\usepackage{titlesec}
\usepackage{textcomp}
\usepackage[colorlinks=false]{hyperref}
\usepackage[table]{xcolor}% http://ctan.org/pkg/xcolor
\usepackage{verbatim}
\newcommand{\xfilll}[2][1ex]{
\dimen0=#2\advance\dimen0 by #1
\leaders\hrule height \dimen0 depth -#1\hfill}
\titleformat{\section}{\large\scshape\raggedright}{}{0em}{}
\renewcommand\labelitemi{\raisebox{0.4ex}{\tiny$\bullet$}}
\renewcommand{\labelitemii}{$\cdot$}
\pagenumbering{gobble}
\begin{document}
\section*{\colorbox{lightgray!50}{\hspace{57.5mm}\Large Professional Experience\hspace{57.5mm}}}
\end{document}
我尝试/hline
向上移动,但也做不到。
答案1
我建议这样做:
\documentclass{article}
\usepackage[a4paper, bottom=0.6in, left=0.56in, right=0.56in, top=0.6in]{geometry}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{array}
\usepackage{enumitem}
\usepackage{wrapfig}
\usepackage{microtype}
\usepackage{titlesec}
\usepackage{textcomp}
\usepackage[colorlinks=false]{hyperref}
\usepackage[table, svgnames]{xcolor}% http://ctan.org/pkg/xcolor
\usepackage{verbatim}
\newcommand{\xfilll}[2][1ex]{
\dimen0=#2\advance\dimen0 by #1
\leaders\hrule height \dimen0 depth -#1\hfill}
\colorlet{headingcolor}{Gainsboro!50!Lavender!30}
\newcommand{\headingbox}[1]{%
\setlength{\fboxsep}{1ex}\SetTracking[ no ligatures=f]{encoding=*, shape=sc}{70} \colorbox{headingcolor}{\parbox{\linewidth}{\centering#1}}}
\titleformat{\section}{\Large\scshape\filcenter}{}{0em}{\headingbox}
\renewcommand\labelitemi{\raisebox{0.4ex}{\tiny$\bullet$}}
\renewcommand{\labelitemii}{$\cdot$}
\pagenumbering{gobble}
\begin{document}
Some text. Some more text. Some more text. Some more text. Some more text. Some more text. Some more text.
\section*{Professional Experience}
Some other text. Some other text. Some other text. Some other text…
\end{document}