为什么 \textsc 在这里不起作用?

为什么 \textsc 在这里不起作用?

第一种情况(“微类型”):\textsc没有产生任何效果,但左列的其余部分对齐得很好(注意日期是“齐平”的):

在此处输入图片描述

\PassOptionsToPackage{svgnames}{xcolor}

\documentclass[a4paper]{article}

\usepackage{gitinfo}

\usepackage[none]{hyphenat}

\usepackage{fontspec}

\pdfprotrudechars=2
\pdfadjustspacing=2
\newfontfeature{Microtype}{protrusion=default;expansion=default;}
\directlua{fonts.protrusions.setups.default.factor=.5}

\setmainfont[Microtype, Numbers={OldStyle, Proportional}, Ligatures=TeX]{Calibri}
 \newfontface\NoMicrotype[Numbers={OldStyle}, Ligatures=TeX]{Calibri}



\usepackage{graphicx}

%%%http://tex.stackexchange.com/questions/79414/how-to-align-the-following-in-a-table
\usepackage{calc}
%%%http://tex.stackexchange.com/questions/79414/how-to-align-the-following-in-a-table

% \usepackage{booktabs}
% \usepackage{array}

%%%-------------------------------------

\usepackage{colortbl}
 \newlength{\mycustomlength}


\settowidth\mycustomlength{blaaaaaaaaaaaaaaaa}



%%%%%%%%%%%%%%%%%%%%%%%%

\usepackage[framemethod=TikZ]{mdframed}    
\usepackage{tabularx}


%%% tex.SX (97180) - How to get column alignment in tabularx?
\usepackage{array}
\newcolumntype{Z}{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}X}



\begin{document}

%\begin{tabularx}{\textwidth}{@{} >{\NoMicrotype}*{1}{p{\mycustomlength}}*{1}{X}@{}} % sub-headings modification
\begin{tabularx}{\textwidth}{@{}*{1}{p{\mycustomlength}}*{1}{X}@{}} % sub-headings modification
%%%

\strut\rlap{\textsc{\color{blue}Some Subtitle}}%
  \raisebox{-.7mm}
  {%
    \noindent\tikz\shade[left color=blue, right color=white, middle color=white] 
    (0,0) rectangle (\textwidth,-0.02);
  } 
  \\ 
%%%%%%
blaaaaaaaaa & blaaaaaaaaaaa.
\\
& blaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
\\
01/1803\,–\,04/1901 & blaaaaa blaaaablaaaaa blaaaablaaaaa blaaaa
\\
12/1815\,–\,07/1899 & blaaaaa blaaaablaaaaa blaaaablaaaaa blaaaa
\\

\end{tabularx}

\end{document}

第二种情况(“无微型”):\textsc 作品,但该列的其余部分是不是很好地对齐(日期是不是“冲洗”):

在此处输入图片描述

\PassOptionsToPackage{svgnames}{xcolor}

\documentclass[a4paper]{article}

\usepackage{gitinfo}

\usepackage[none]{hyphenat}

\usepackage{fontspec}

\pdfprotrudechars=2
\pdfadjustspacing=2
\newfontfeature{Microtype}{protrusion=default;expansion=default;}
\directlua{fonts.protrusions.setups.default.factor=.5}

\setmainfont[Microtype, Numbers={OldStyle, Proportional}, Ligatures=TeX]{Calibri}
 \newfontface\NoMicrotype[Numbers={OldStyle}, Ligatures=TeX]{Calibri}



\usepackage{graphicx}

%%%http://tex.stackexchange.com/questions/79414/how-to-align-the-following-in-a-table
\usepackage{calc}
%%%http://tex.stackexchange.com/questions/79414/how-to-align-the-following-in-a-table

% \usepackage{booktabs}
% \usepackage{array}

%%%-------------------------------------

\usepackage{colortbl}
 \newlength{\mycustomlength}


\settowidth\mycustomlength{blaaaaaaaaaaaaaaaa}



%%%%%%%%%%%%%%%%%%%%%%%%

\usepackage[framemethod=TikZ]{mdframed}    
\usepackage{tabularx}


%%% tex.SX (97180) - How to get column alignment in tabularx?
\usepackage{array}
\newcolumntype{Z}{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}X}



\begin{document}

%\begin{tabularx}{\textwidth}{@{} >{\NoMicrotype}*{1}{p{\mycustomlength}}*{1}{X}@{}} % sub-headings modification
\begin{tabularx}{\textwidth}{@{}*{1}{p{\mycustomlength}}*{1}{X}@{}} % sub-headings modification
%%%

\strut\rlap{\textsc{\color{blue}Some Subtitle}}%
  \raisebox{-.7mm}
  {%
    \noindent\tikz\shade[left color=blue, right color=white, middle color=white] 
    (0,0) rectangle (\textwidth,-0.02);
  } 
  \\ 
%%%%%%
blaaaaaaaaa & blaaaaaaaaaaa.
\\
& blaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
\\
01/1803\,–\,04/1901 & blaaaaa blaaaablaaaaa blaaaablaaaaa blaaaa
\\
12/1815\,–\,07/1899 & blaaaaa blaaaablaaaaa blaaaablaaaaa blaaaa
\\

\end{tabularx}

\end{document}

有什么方法可以覆盖“某些字幕”行(行、单元格等)的列\NoMicrotype(似乎导致缺​​陷\textsc)设置?

答案1

microtype它与或无关tabularx,您指定了比例数字,因此数字具有不同的宽度,只需省略它,您就不需要加载两种字体。

在此处输入图片描述

\PassOptionsToPackage{svgnames}{xcolor}

\documentclass[a4paper]{article}

\usepackage{gitinfo}

\usepackage[none]{hyphenat}

\usepackage{fontspec}

\protrudechars=2
\adjustspacing=2
\newfontfeature{Microtype}{protrusion=default;expansion=default;}
\directlua{fonts.protrusions.setups.default.factor=.5}

\setmainfont[Microtype, Numbers={OldStyle}]{Calibri}




\usepackage{graphicx}

%%%http://tex.stackexchange.com/questions/79414/how-to-align-the-following-in-a-table
\usepackage{calc}
%%%http://tex.stackexchange.com/questions/79414/how-to-align-the-following-in-a-table

% \usepackage{booktabs}
% \usepackage{array}

%%%-------------------------------------

\usepackage{colortbl}
 \newlength{\mycustomlength}


\settowidth\mycustomlength{blaaaaaaaaaaaaaaaa}



%%%%%%%%%%%%%%%%%%%%%%%%

\usepackage[framemethod=TikZ]{mdframed}    
\usepackage{tabularx}


%%% tex.SX (97180) - How to get column alignment in tabularx?
\usepackage{array}
\newcolumntype{Z}{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}X}



\begin{document}

%\begin{tabularx}{\textwidth}{@{} >{\NoMicrotype}*{1}{p{\mycustomlength}}*{1}{X}@{}} % sub-headings modification
\begin{tabularx}{\textwidth}{@{}*{1}{p{\mycustomlength}}*{1}{X}@{}} % sub-headings modification
%%%

\strut\rlap{\textsc{\color{blue}Some Subtitle}}%
  \raisebox{-.7mm}
  {%
    \noindent\tikz\shade[left color=blue, right color=white, middle color=white] 
    (0,0) rectangle (\textwidth,-0.02);
  } 
  \\ 
%%%%%%
blaaaaaaaaa & blaaaaaaaaaaa.
\\
& blaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
\\
01/1803\,–\,04/1901 & blaaaaa blaaaablaaaaa blaaaablaaaaa blaaaa
\\
12/1815\,–\,07/1899 & blaaaaa blaaaablaaaaa blaaaablaaaaa blaaaa
\\

\end{tabularx}

\end{document}

请注意,此页面有超过可用框,但我暂时保留它:

ABD: EveryShipout initializing macros
Overfull \hbox (263.07129pt too wide) in paragraph at lines 75--75
[]||[][]| 

Overfull \hbox (15.0pt too wide) in paragraph at lines 75--76

相关内容