Makebox 对齐和特定字体大小的使用

Makebox 对齐和特定字体大小的使用

的对齐\makebox不正确(左右不均匀)。我该如何修复它?以及如何使用特定字体大小(12pt、11pt)代替\Large或类似开关。我需要的是,全局大小必须是 12pt,标题需要是 14pt。这是 MWE:

\documentclass[letterpaper,12pt]{article}
\newlength{\outerbordwidth}
\pagestyle{empty}
\raggedbottom
\raggedright
\usepackage[svgnames]{xcolor}
\usepackage{framed,tabularx,array}
\usepackage{tocloft}
\usepackage{mathptmx}

%-----------------------------------------------------------
%Edit these values as you see fit

\setlength{\outerbordwidth}{3pt}  % 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}{0in}
\setlength{\headsep}{0in}
\setlength{\oddsidemargin}{-0.25in}
\setlength{\paperheight}{11in}
\setlength{\paperwidth}{8.5in}
\setlength{\tabcolsep}{0in}
\setlength{\textheight}{9.5in}
\setlength{\textwidth}{7in}
\setlength{\topmargin}{-0.3in}
\setlength{\topskip}{0in}
\setlength{\voffset}{0.1in}


%-----------------------------------------------------------
%Custom commands
\newcommand{\resheadings}[1]{\vspace{8pt}  
\parbox{\textwidth}{\setlength{\FrameSep}{\outerbordwidth}
    \begin{shaded}
\setlength{\fboxsep}{0pt}\makebox[\textwidth][l]{\setlength{\fboxsep}{4pt}\fcolorbox{shadecolorB}{shadecolorB}{\textbf{{\mbox{~}\makebox[6.762in][l]{\large #1} \vphantom{p\^{E}}}}}}
    \end{shaded}
  }\vspace{-5pt}
}
%-----------------------------------------------------------


\begin{document}

\begin{tabularx}{7in}{Xr}
  \textbf{\Large Your Name} & \textbf{\today} \\
  Short description of you & E-mail \\
  Adress & Homepage \\
\end{tabularx}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\resheadings{Education}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\end{document}

在此处输入图片描述

答案1

也许这就是你想要的:

\documentclass[letterpaper,12pt]{article}
\newlength{\outerbordwidth}
\pagestyle{empty}
\raggedbottom
\raggedright
\usepackage[svgnames]{xcolor}
\usepackage{framed,tabularx,array}
\usepackage{tocloft}
\usepackage{mathptmx}

%-----------------------------------------------------------
%Edit these values as you see fit

\setlength{\outerbordwidth}{3pt}  % 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}{0in}
\setlength{\headsep}{0in}
\setlength{\oddsidemargin}{-0.25in}
\setlength{\paperheight}{11in}
\setlength{\paperwidth}{8.5in}
\setlength{\tabcolsep}{0in}
\setlength{\textheight}{9.5in}
\setlength{\textwidth}{7in}
\setlength{\topmargin}{-0.3in}
\setlength{\topskip}{0in}
\setlength{\voffset}{0.1in}


%-----------------------------------------------------------
%Custom commands
\newcommand{\resheadings}[1]{\vspace{8pt}
\parbox{\textwidth}{%
    \setlength{\FrameSep}{\outerbordwidth}
    \begin{shaded}
        \setlength{\fboxsep}{0pt}\makebox[\textwidth][l]{%
        \setlength{\fboxsep}{4pt}\fcolorbox{shadecolorB}{shadecolorB}%
            {\textbf{{\makebox[\dimexpr\textwidth-4pt-2\fboxsep\relax][l]{\Large #1} \vphantom{p\^{E}}}}}}
    \end{shaded}
  }\vspace{-5pt}
}
%-----------------------------------------------------------


\begin{document}

\begin{tabularx}{7in}{Xr}
  \textbf{\Large Your Name} & \textbf{\today} \\
  Short description of you & E-mail \\
  Adress & Homepage \\
\end{tabularx}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\resheadings{Education}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\end{document}

在此处输入图片描述

相关内容