如何在表格和段落中设置统一的字体大小

如何在表格和段落中设置统一的字体大小

当我调整表格大小、使用\resizebox或任何其他操作时,字体大小会减小。如何设置整个文档的统一字体大小,我需要至少 12pt(最低要求)。

代码:

\documentclass[12pt,letterpaper,borde=10pt]{moderncv}
\moderncvstyle{banking}
\moderncvcolor{blue}
\usepackage{libertine}
\usepackage[scale=0.75]{geometry}
\usepackage{array}
\usepackage{threeparttable}
\usepackage{graphics}
\newcolumntype{C}{>{\centering\arraybackslash}m{0.25\linewidth}}
\newcolumntype{L}{>{\centering\arraybackslash}m{0.15\linewidth}}
\makeatletter
%\renewcommand*{\maketitlesymbol}{}%
%
\renewcommand*{\flushmaketitle}{%
  \strut\usebox{\maketitlebox}%
  \savebox{\maketitlebox}{}%
  \savebox{\maketitletempbox}{}%
  \setlength{\maketitleboxwidth}{0pt}}
\renewcommand*{\maketitle}{%
%  \setlength{\maketitlewidth}{0.8\textwidth}% ORIGINAL
  \setlength{\maketitlewidth}{\textwidth}% NEW
  %\hfil% ORIGINAL
  \parbox{\maketitlewidth}{%
%    \centering% ORIGINAL
    \raggedright% NEW
    % name and title
    \namestyle{\@firstname~\@lastname}%
    \ifthenelse{\equal{\@title}{}}{}{\titlestyle{~|~\@title}}\\% \isundefined doesn't work on \@title, as LaTeX itself defines \@title (before it possibly gets redefined by \title)
    % detailed information
    \addressfont\color{color2}%
    \parbox[t]{0.45\maketitlewidth}{%
    \ifthenelse{\isundefined{\@addressstreet}}{}{\addtomaketitle{\addresssymbol\@addressstreet}%
    \flushmaketitle\@firstmaketitleelementtrue\\       %%% <--- HK here
      \ifthenelse{\equal{\@addresscity}{}}{}{\addtomaketitle[~--~]{\@addresscity}}% if \addresstreet is defined, \addresscity and \addresscountry will always be defined but could be empty
      \flushmaketitle\@firstmaketitleelementtrue\\     %%% <--- HK here
      \ifthenelse{\equal{\@addresscountry}{}}{}{\addtomaketitle[~--~]{\@addresscountry}}%
  \flushmaketitle\@firstmaketitleelementtrue\\     %%% <--- HK here
      }}%
      \hfill
    \parbox[t]{0.45\maketitlewidth}{%
    \raggedleft%    %% optional
    \collectionloop{phones}{% the key holds the phone type (=symbol command prefix), the item holds the number
      \addtomaketitle{\csname\collectionloopkey phonesymbol\endcsname\collectionloopitem}
      \flushmaketitle\@firstmaketitleelementtrue\\}%           %% <--- HK here
    \ifthenelse{\isundefined{\@email}}{}{\addtomaketitle{\emailsymbol\emaillink{\@email}}}%
    \flushmaketitle\@firstmaketitleelementtrue\\           %% <--- HK here
    \ifthenelse{\isundefined{\@homepage}}{}{\addtomaketitle{\homepagesymbol\httplink{\@homepage}}}%
    \flushmaketitle\@firstmaketitleelementtrue\\           %% <--- HK here
    \collectionloop{socials}{% the key holds the social type (=symbol command prefix), the item holds the link
      \addtomaketitle{\csname\collectionloopkey socialsymbol\endcsname\collectionloopitem}
      \flushmaketitle\@firstmaketitleelementtrue\\}           %% <--- HK here
    \ifthenelse{\isundefined{\@extrainfo}}{}{\addtomaketitle{\@extrainfo}}%
    \flushmaketitle}}\\[2.5em]}% need to force a \par after this to avoid weird spacing bug at the first section if no blank line is left after \maketitle
\makeatother

\name{SUBHAM}{SONI}
%\address{No.8, I-Floor, I-Cross, Suriya Gandhi Nagar(North), Muthialpet}{Puducherry $-$ 605003}{India}
%\phone[mobile]{+91~8124~410~721}
%\phone[fixed]{+91~0413~22~11~380}
%\email{[email protected]}
%\homepage{www.johndoe.com}
%\social[linkedin]{john.doe}
%\social[twitter]{jdoe}
%\social[github]{jdoe}
%\quote{Some quote}

\begin{document}
\makecvtitle

\section{CAREER OBJECTIVE}
A challenging role in a dynamic organisation, which would serve as a platform for being
resourceful, innovative and flexible, where good technical and soft skills can enhance the
company's welfare and offer professional growth.
\section{EDUCATIONAL QUALIFICATION}
\centering
%\begin{table}
  \begin{threeparttable}
  \centering
  \resizebox{\columnwidth}{!}{%
     \begin{tabular}{|C|C|C|C|C|C|}\hline
\textbf{Sl. No.} & \textbf{Course} &  \textbf{Institution/ School}  & \textbf{Board/University}  &  \textbf{Years of  passing}  & \textbf{Aggregate}  \\ \hline
1. & B.Tech. (Computer Science and Engineering)& Pondicherry  Engineering College  Puducherry & Pondicherry  University& April 2015 (pursuing) & $8.554^\star$ \\     \hline
2. & Higher  Secondary  &  Petit Seminaire H.S.S. Puducherry & Tamilnadu Board of
Higher Secondary  Education & March 2011  & 92\% \\   \hline
3. & Matriculation  &  Petit Seminaire H.S.S. Puducherry & Tamilnadu Board of
Higher Secondary  Education  & March 2009 & 90\% \\ \hline
    \end{tabular}
}
    \begin{tablenotes}
      \small
      \item  \textbf{${}^\star$ Cumulative grade point average up to $5^{th}$ semester}.
    \end{tablenotes}
  \end{threeparttable}
%\end{table}
\end{document} 

答案1

你不需要tabulary。定义一个新列,例如

\newcolumntype{C}[1]{>{\centering\arraybackslash}m{#1}}

并选择为每列指定适当的列宽:

\begin{tabular}{|C{\dimexpr0.06\textwidth-2\tabcolsep-2\arrayrulewidth\relax}|
                 C{\dimexpr0.22\textwidth-2\tabcolsep-\arrayrulewidth\relax}|
                 C{\dimexpr0.22\textwidth-2\tabcolsep-\arrayrulewidth\relax}|
                 C{\dimexpr0.22\textwidth-2\tabcolsep-\arrayrulewidth\relax}|
                 C{\dimexpr0.15\textwidth-2\tabcolsep-\arrayrulewidth\relax}|
                 C{\dimexpr0.13\textwidth-2\tabcolsep-\arrayrulewidth\relax}|}\hline 

代码:

\documentclass[12pt,letterpaper,borde=10pt]{moderncv}
\moderncvstyle{banking}
\moderncvcolor{blue}
\usepackage{libertine}
\usepackage[scale=0.75]{geometry}
\usepackage{array}
\usepackage{threeparttable}
\usepackage{graphics}
%\usepackage{tabulary}
\newcolumntype{C}[1]{>{\centering\arraybackslash}m{#1}}

\makeatletter
%\renewcommand*{\maketitlesymbol}{}%
%
\renewcommand*{\flushmaketitle}{%
  \strut\usebox{\maketitlebox}%
  \savebox{\maketitlebox}{}%
  \savebox{\maketitletempbox}{}%
  \setlength{\maketitleboxwidth}{0pt}}
\renewcommand*{\maketitle}{%
%  \setlength{\maketitlewidth}{0.8\textwidth}% ORIGINAL
  \setlength{\maketitlewidth}{\textwidth}% NEW
  %\hfil% ORIGINAL
  \parbox{\maketitlewidth}{%
%    \centering% ORIGINAL
    \raggedright% NEW
    % name and title
    \namestyle{\@firstname~\@lastname}%
    \ifthenelse{\equal{\@title}{}}{}{\titlestyle{~|~\@title}}\\% \isundefined doesn't work on \@title, as LaTeX itself defines \@title (before it possibly gets redefined by \title)
    % detailed information
    \addressfont\color{color2}%
    \parbox[t]{0.45\maketitlewidth}{%
    \ifthenelse{\isundefined{\@addressstreet}}{}{\addtomaketitle{\addresssymbol\@addressstreet}%
    \flushmaketitle\@firstmaketitleelementtrue\\       %%% <--- HK here
      \ifthenelse{\equal{\@addresscity}{}}{}{\addtomaketitle[~--~]{\@addresscity}}% if \addresstreet is defined, \addresscity and \addresscountry will always be defined but could be empty
      \flushmaketitle\@firstmaketitleelementtrue\\     %%% <--- HK here
      \ifthenelse{\equal{\@addresscountry}{}}{}{\addtomaketitle[~--~]{\@addresscountry}}%
  \flushmaketitle\@firstmaketitleelementtrue\\     %%% <--- HK here
      }}%
      \hfill
    \parbox[t]{0.45\maketitlewidth}{%
    \raggedleft%    %% optional
    \collectionloop{phones}{% the key holds the phone type (=symbol command prefix), the item holds the number
      \addtomaketitle{\csname\collectionloopkey phonesymbol\endcsname\collectionloopitem}
      \flushmaketitle\@firstmaketitleelementtrue\\}%           %% <--- HK here
    \ifthenelse{\isundefined{\@email}}{}{\addtomaketitle{\emailsymbol\emaillink{\@email}}}%
    \flushmaketitle\@firstmaketitleelementtrue\\           %% <--- HK here
    \ifthenelse{\isundefined{\@homepage}}{}{\addtomaketitle{\homepagesymbol\httplink{\@homepage}}}%
    \flushmaketitle\@firstmaketitleelementtrue\\           %% <--- HK here
    \collectionloop{socials}{% the key holds the social type (=symbol command prefix), the item holds the link
      \addtomaketitle{\csname\collectionloopkey socialsymbol\endcsname\collectionloopitem}
      \flushmaketitle\@firstmaketitleelementtrue\\}           %% <--- HK here
    \ifthenelse{\isundefined{\@extrainfo}}{}{\addtomaketitle{\@extrainfo}}%
    \flushmaketitle}}\\[2.5em]}% need to force a \par after this to avoid weird spacing bug at the first section if no blank line is left after \maketitle
\makeatother

\name{SUBHAM}{SONI}
%\address{No.8, I-Floor, I-Cross, Suriya Gandhi Nagar(North), Muthialpet}{Puducherry $-$ 605003}{India}
%\phone[mobile]{+91~8124~410~721}
%\phone[fixed]{+91~0413~22~11~380}
%\email{[email protected]}
%\homepage{www.johndoe.com}
%\social[linkedin]{john.doe}
%\social[twitter]{jdoe}
%\social[github]{jdoe}
%\quote{Some quote}

\begin{document}
\makecvtitle

\section{CAREER OBJECTIVE}
A challenging role in a dynamic organisation, which would serve as a platform for being
resourceful, innovative and flexible, where good technical and soft skills can enhance the
company's welfare and offer professional growth.
\section{EDUCATIONAL QUALIFICATION}
\centering
%\begin{table}
  \begin{threeparttable}
  \centering

     \begin{tabular}{|C{\dimexpr0.06\textwidth-2\tabcolsep-2\arrayrulewidth\relax}|
                      C{\dimexpr0.22\textwidth-2\tabcolsep-\arrayrulewidth\relax}|
                      C{\dimexpr0.22\textwidth-2\tabcolsep-\arrayrulewidth\relax}|
                      C{\dimexpr0.22\textwidth-2\tabcolsep-\arrayrulewidth\relax}|
                      C{\dimexpr0.15\textwidth-2\tabcolsep-\arrayrulewidth\relax}|
                      C{\dimexpr0.13\textwidth-2\tabcolsep-\arrayrulewidth\relax}|}\hline
\textbf{Sl. No.} & \textbf{Course} &  \textbf{Institution/ School}  & \textbf{Board/University}  &  \textbf{Years of  passing}  & \textbf{Aggregate}  \\ \hline
1. & B.Tech. (Computer Science and Engineering)& Pondicherry  Engineering College  Puducherry & Pondicherry  University& April 2015 (pursuing) & $8.554^\star$ \\     \hline
2. & Higher  Secondary  &  Petit Seminaire H.S.S. Puducherry & Tamilnadu Board of
Higher Secondary  Education & March 2011  & 92\% \\   \hline
3. & Matriculation  &  Petit Seminaire H.S.S. Puducherry & Tamilnadu Board of
Higher Secondary  Education  & March 2009 & 90\% \\ \hline
    \end{tabular}

    \begin{tablenotes}
      \small
      \item  \textbf{${}^\star$ Cumulative grade point average up to $5^{th}$ semester}.
    \end{tablenotes}
  \end{threeparttable}
%\end{table}
\end{document}

在此处输入图片描述

booktabs这是一个使用且无垂直线的选项:

\documentclass[12pt,letterpaper,borde=10pt]{moderncv}
\moderncvstyle{banking}
\moderncvcolor{blue}
\usepackage{libertine}
\usepackage[scale=0.75]{geometry}
\usepackage{array}
\usepackage{booktabs}
\usepackage{threeparttable}
\usepackage{graphics}
%\usepackage{tabulary}
\newcolumntype{C}[1]{>{\centering\arraybackslash}p{#1}}

\makeatletter
%\renewcommand*{\maketitlesymbol}{}%
%
\renewcommand*{\flushmaketitle}{%
  \strut\usebox{\maketitlebox}%
  \savebox{\maketitlebox}{}%
  \savebox{\maketitletempbox}{}%
  \setlength{\maketitleboxwidth}{0pt}}
\renewcommand*{\maketitle}{%
%  \setlength{\maketitlewidth}{0.8\textwidth}% ORIGINAL
  \setlength{\maketitlewidth}{\textwidth}% NEW
  %\hfil% ORIGINAL
  \parbox{\maketitlewidth}{%
%    \centering% ORIGINAL
    \raggedright% NEW
    % name and title
    \namestyle{\@firstname~\@lastname}%
    \ifthenelse{\equal{\@title}{}}{}{\titlestyle{~|~\@title}}\\% \isundefined doesn't work on \@title, as LaTeX itself defines \@title (before it possibly gets redefined by \title)
    % detailed information
    \addressfont\color{color2}%
    \parbox[t]{0.45\maketitlewidth}{%
    \ifthenelse{\isundefined{\@addressstreet}}{}{\addtomaketitle{\addresssymbol\@addressstreet}%
    \flushmaketitle\@firstmaketitleelementtrue\\       %%% <--- HK here
      \ifthenelse{\equal{\@addresscity}{}}{}{\addtomaketitle[~--~]{\@addresscity}}% if \addresstreet is defined, \addresscity and \addresscountry will always be defined but could be empty
      \flushmaketitle\@firstmaketitleelementtrue\\     %%% <--- HK here
      \ifthenelse{\equal{\@addresscountry}{}}{}{\addtomaketitle[~--~]{\@addresscountry}}%
  \flushmaketitle\@firstmaketitleelementtrue\\     %%% <--- HK here
      }}%
      \hfill
    \parbox[t]{0.45\maketitlewidth}{%
    \raggedleft%    %% optional
    \collectionloop{phones}{% the key holds the phone type (=symbol command prefix), the item holds the number
      \addtomaketitle{\csname\collectionloopkey phonesymbol\endcsname\collectionloopitem}
      \flushmaketitle\@firstmaketitleelementtrue\\}%           %% <--- HK here
    \ifthenelse{\isundefined{\@email}}{}{\addtomaketitle{\emailsymbol\emaillink{\@email}}}%
    \flushmaketitle\@firstmaketitleelementtrue\\           %% <--- HK here
    \ifthenelse{\isundefined{\@homepage}}{}{\addtomaketitle{\homepagesymbol\httplink{\@homepage}}}%
    \flushmaketitle\@firstmaketitleelementtrue\\           %% <--- HK here
    \collectionloop{socials}{% the key holds the social type (=symbol command prefix), the item holds the link
      \addtomaketitle{\csname\collectionloopkey socialsymbol\endcsname\collectionloopitem}
      \flushmaketitle\@firstmaketitleelementtrue\\}           %% <--- HK here
    \ifthenelse{\isundefined{\@extrainfo}}{}{\addtomaketitle{\@extrainfo}}%
    \flushmaketitle}}\\[2.5em]}% need to force a \par after this to avoid weird spacing bug at the first section if no blank line is left after \maketitle
\makeatother

\name{SUBHAM}{SONI}
%\address{No.8, I-Floor, I-Cross, Suriya Gandhi Nagar(North), Muthialpet}{Puducherry $-$ 605003}{India}
%\phone[mobile]{+91~8124~410~721}
%\phone[fixed]{+91~0413~22~11~380}
%\email{[email protected]}
%\homepage{www.johndoe.com}
%\social[linkedin]{john.doe}
%\social[twitter]{jdoe}
%\social[github]{jdoe}
%\quote{Some quote}

\begin{document}
\makecvtitle

\section{CAREER OBJECTIVE}
A challenging role in a dynamic organisation, which would serve as a platform for being
resourceful, innovative and flexible, where good technical and soft skills can enhance the
company's welfare and offer professional growth.
\section{EDUCATIONAL QUALIFICATION}
\centering
%\begin{table}
  \begin{threeparttable}
  \centering
   \tabcolsep=3pt
     \begin{tabular}{C{\dimexpr0.06\textwidth-2\tabcolsep-2\arrayrulewidth\relax}
                      C{\dimexpr0.22\textwidth-2\tabcolsep-\arrayrulewidth\relax}
                      C{\dimexpr0.22\textwidth-2\tabcolsep-\arrayrulewidth\relax}
                      C{\dimexpr0.22\textwidth-2\tabcolsep-\arrayrulewidth\relax}
                      C{\dimexpr0.15\textwidth-2\tabcolsep-\arrayrulewidth\relax}
                      C{\dimexpr0.13\textwidth-2\tabcolsep-\arrayrulewidth\relax}}\toprule
\textbf{Sl. No.} & \textbf{Course} &  \textbf{Institution/ School}  & \textbf{Board/University}  &  \textbf{Years of  passing}  & \textbf{Aggregate}  \\ \midrule
1. & B.Tech. (Computer Science and Engineering)& Pondicherry  Engineering College  Puducherry & Pondicherry  University& April 2015 (pursuing) & $8.554^\star$ \\     
2. & Higher  Secondary  &  Petit Seminaire H.S.S. Puducherry & Tamilnadu Board of
Higher Secondary  Education & March 2011  & 92\% \\   
3. & Matriculation  &  Petit Seminaire H.S.S. Puducherry & Tamilnadu Board of
Higher Secondary  Education  & March 2009 & 90\% \\ \bottomrule
    \end{tabular}

    \begin{tablenotes}
      \small
      \item  \textbf{${}^\star$ Cumulative grade point average up to $5^{th}$ semester}.
    \end{tablenotes}
  \end{threeparttable}
%\end{table}
\end{document}

在此处输入图片描述

补充笔记

  1. 而要$5^{th}$使用5\textsuperscript{th}
  2. Years of passing应该Year of passing
  3. 除了使用$8.554^\star$and ${}^\star$(在 内tablenotes) 组合外,您还可以在 ,8.554\tnote{*}内使用 and tablenotes\item [*] \textbf{Cumulative .....该包threeparttable提供了\tnote宏。

结合这些附加说明,您将获得:

在此处输入图片描述

答案2

在此处输入图片描述

\documentclass[12pt,letterpaper,borde=10pt]{moderncv}
\moderncvstyle{banking}
\moderncvcolor{blue}
\usepackage{libertine}
\usepackage[scale=0.75]{geometry}
\usepackage{array}
\usepackage{threeparttable}
\usepackage{graphics}
\usepackage{tabulary}

\makeatletter
%\renewcommand*{\maketitlesymbol}{}%
%
\renewcommand*{\flushmaketitle}{%
  \strut\usebox{\maketitlebox}%
  \savebox{\maketitlebox}{}%
  \savebox{\maketitletempbox}{}%
  \setlength{\maketitleboxwidth}{0pt}}
\renewcommand*{\maketitle}{%
%  \setlength{\maketitlewidth}{0.8\textwidth}% ORIGINAL
  \setlength{\maketitlewidth}{\textwidth}% NEW
  %\hfil% ORIGINAL
  \parbox{\maketitlewidth}{%
%    \centering% ORIGINAL
    \raggedright% NEW
    % name and title
    \namestyle{\@firstname~\@lastname}%
    \ifthenelse{\equal{\@title}{}}{}{\titlestyle{~|~\@title}}\\% \isundefined doesn't work on \@title, as LaTeX itself defines \@title (before it possibly gets redefined by \title)
    % detailed information
    \addressfont\color{color2}%
    \parbox[t]{0.45\maketitlewidth}{%
    \ifthenelse{\isundefined{\@addressstreet}}{}{\addtomaketitle{\addresssymbol\@addressstreet}%
    \flushmaketitle\@firstmaketitleelementtrue\\       %%% <--- HK here
      \ifthenelse{\equal{\@addresscity}{}}{}{\addtomaketitle[~--~]{\@addresscity}}% if \addresstreet is defined, \addresscity and \addresscountry will always be defined but could be empty
      \flushmaketitle\@firstmaketitleelementtrue\\     %%% <--- HK here
      \ifthenelse{\equal{\@addresscountry}{}}{}{\addtomaketitle[~--~]{\@addresscountry}}%
  \flushmaketitle\@firstmaketitleelementtrue\\     %%% <--- HK here
      }}%
      \hfill
    \parbox[t]{0.45\maketitlewidth}{%
    \raggedleft%    %% optional
    \collectionloop{phones}{% the key holds the phone type (=symbol command prefix), the item holds the number
      \addtomaketitle{\csname\collectionloopkey phonesymbol\endcsname\collectionloopitem}
      \flushmaketitle\@firstmaketitleelementtrue\\}%           %% <--- HK here
    \ifthenelse{\isundefined{\@email}}{}{\addtomaketitle{\emailsymbol\emaillink{\@email}}}%
    \flushmaketitle\@firstmaketitleelementtrue\\           %% <--- HK here
    \ifthenelse{\isundefined{\@homepage}}{}{\addtomaketitle{\homepagesymbol\httplink{\@homepage}}}%
    \flushmaketitle\@firstmaketitleelementtrue\\           %% <--- HK here
    \collectionloop{socials}{% the key holds the social type (=symbol command prefix), the item holds the link
      \addtomaketitle{\csname\collectionloopkey socialsymbol\endcsname\collectionloopitem}
      \flushmaketitle\@firstmaketitleelementtrue\\}           %% <--- HK here
    \ifthenelse{\isundefined{\@extrainfo}}{}{\addtomaketitle{\@extrainfo}}%
    \flushmaketitle}}\\[2.5em]}% need to force a \par after this to avoid weird spacing bug at the first section if no blank line is left after \maketitle
\makeatother

\name{SUBHAM}{SONI}
%\address{No.8, I-Floor, I-Cross, Suriya Gandhi Nagar(North), Muthialpet}{Puducherry $-$ 605003}{India}
%\phone[mobile]{+91~8124~410~721}
%\phone[fixed]{+91~0413~22~11~380}
%\email{[email protected]}
%\homepage{www.johndoe.com}
%\social[linkedin]{john.doe}
%\social[twitter]{jdoe}
%\social[github]{jdoe}
%\quote{Some quote}

\begin{document}
\makecvtitle

\section{CAREER OBJECTIVE}
A challenging role in a dynamic organisation, which would serve as a platform for being
resourceful, innovative and flexible, where good technical and soft skills can enhance the
company's welfare and offer professional growth.
\section{EDUCATIONAL QUALIFICATION}
\centering
%\begin{table}
  \begin{threeparttable}
  \centering

     \begin{tabulary}{\columnwidth}{|C|C|C|C|C|C|}\hline
\textbf{Sl. No.} & \textbf{Course} &  \textbf{Institution/ School}  & \textbf{Board/University}  &  \textbf{Years of  passing}  & \textbf{Aggregate}  \\ \hline
1. & B.Tech. (Computer Science and Engineering)& Pondicherry  Engineering College  Puducherry & Pondicherry  University& April 2015 (pursuing) & $8.554^\star$ \\     \hline
2. & Higher  Secondary  &  Petit Seminaire H.S.S. Puducherry & Tamilnadu Board of
Higher Secondary  Education & March 2011  & 92\% \\   \hline
3. & Matriculation  &  Petit Seminaire H.S.S. Puducherry & Tamilnadu Board of
Higher Secondary  Education  & March 2009 & 90\% \\ \hline
    \end{tabulary}

    \begin{tablenotes}
      \small
      \item  \textbf{${}^\star$ Cumulative grade point average up to $5^{th}$ semester}.
    \end{tablenotes}
  \end{threeparttable}
%\end{table}
\end{document} 

相关内容