我想在简历中制作一些半阴影条纹来突出显示每个字段,如下图所示:
但是我使用的模板代码如下:
\newcommand{\resitem}[1]{\item #1 \vspace{-2pt}}
%
\newcommand{\resheading}[1]{%
\vspace{8pt}
\parbox{\textwidth}{%
\setlength{\FrameSep}{\outerbordwidth}
\begin{shaded}
\setlength{\fboxsep}{0pt}
\framebox[\textwidth][l]{%
\setlength{\fboxsep}{4pt}
\fcolorbox{shadecolorB}{shadecolorB}{%
\textbf{\sffamily{\mbox{~}\makebox[6.762in][l]{\large #1}\vphantom{p\^{E}}}}%
}%
}%
\end{shaded}
}%
\vspace{-10pt}%
}
%
\resheading{Education}
结果如下:
你能告诉我如何更改此模板代码以获得上面的第一张图片吗?我试了几次,但都失败了。
////////////////////////////////////////////////////////////////////////////////////////// 此模板使用的完整标题和包如下:
\documentclass[letterpaper,13pt]{article}
\newlength{\outerbordwidth}
\pagestyle{empty}
\raggedbottom
\raggedright
\usepackage[svgnames]{xcolor}
\usepackage{framed}
\usepackage{tocloft}
%-----------------------------------------------------------
\setlength{\outerbordwidth}{1pt} % Width of border outside of title bars
\definecolor{shadecolor}{gray}{0.75} % Outer background color of title bars (0 = black, 1 = white)
\definecolor{shadecolorB}{gray}{0.93} % Inner background color of title bars
%-----------------------------------------------------------
%Margin setup
\setlength{\evensidemargin}{-0.25in}
\setlength{\headheight}{-0.25in}
\setlength{\headsep}{0in}
\setlength{\oddsidemargin}{-0.25in}
\setlength{\paperheight}{11in}
\setlength{\paperwidth}{8.5in}
\setlength{\tabcolsep}{0in}
\setlength{\textheight}{10in}
\setlength{\textwidth}{7in}
\setlength{\topmargin}{-0.3in}
\setlength{\topskip}{0in}
\setlength{\voffset}{0.1in}
\setlength{\parskip}{1pt plus 1pt minus 1pt}
答案1
需要进行两项变革:
1)在序言中,\setlength{\outerbordwidth}{0pt}
而不是1pt
2)在\resheading
宏中添加\fboxrule=0pt
删除框边框。
\documentclass[letterpaper,13pt]{article}
\newlength{\outerbordwidth}
\pagestyle{empty}
\raggedbottom
\raggedright
\usepackage[svgnames]{xcolor}
\usepackage{framed}
\usepackage{tocloft}
%-----------------------------------------------------------
\setlength{\outerbordwidth}{0pt} % Width of border outside of title bars
\definecolor{shadecolor}{gray}{0.75} % Outer background color of title bars (0 = black, 1 = white)
\definecolor{shadecolorB}{gray}{0.93} % Inner background color of title bars
%-----------------------------------------------------------
%Margin setup
\setlength{\evensidemargin}{-0.25in}
\setlength{\headheight}{-0.25in}
\setlength{\headsep}{0in}
\setlength{\oddsidemargin}{-0.25in}
\setlength{\paperheight}{11in}
\setlength{\paperwidth}{8.5in}
\setlength{\tabcolsep}{0in}
\setlength{\textheight}{10in}
\setlength{\textwidth}{7in}
\setlength{\topmargin}{-0.3in}
\setlength{\topskip}{0in}
\setlength{\voffset}{0.1in}
\setlength{\parskip}{1pt plus 1pt minus 1pt}
\begin{document}
\newcommand{\resitem}[1]{\item #1 \vspace{-2pt}}
\newcommand{\resheading}[1]{\vspace{8pt}
\parbox{\textwidth}{\setlength{\FrameSep}{\outerbordwidth}
\begin{shaded}
\fboxrule=0pt
\setlength{\fboxsep}{0pt}\framebox[\textwidth][l]{\setlength{\fboxsep}{4pt}\fcolorbox{shadecolorB}{shadecolorB}{\textbf{\sffamily{\mbox{~}\makebox[6.762in][l]{\large #1} \vphantom{p\^{E}}}}}}
\end{shaded}
}\vspace{-10pt}
}
\resheading{Education}
\end{document}
结果:
shadecolorB
通过降低前导码中的值可以使条形颜色变暗。
答案2
\documentclass{article}
\usepackage{color}
\begin{document}
\noindent
\rule[-5pt]{1pt}{20pt}%
\hspace{10pt}%
\colorbox[gray]{.9}{%
\makebox[\dimexpr\linewidth-2\fboxsep-11pt\relax][l]{Education}}
\bigskip
\noindent X\dotfill X
\end{document}