[Tex/LaTex] How to use fontspec and also have small bold caps with LuaLaTeX


I was told by the Latex gurus that I should use \usepackage{fontspec} when using lualatex.

But now my small bold caps do not work: they come out only bold, but not caps,
even though I added \usepackage[T1]{fontenc} which is needed to get this to work

\textbf{\textsc{bold small caps}}

But it no longer work because \usepackage{fontspec} is there.

Removing \usepackage{fontspec} and keeping \usepackage[T1]{fontenc} made it work (i.e. bold and also small caps)

Removing \usepackage[T1]{fontenc} and keeping \usepackage{fontspec} does not work: It becomes only bold, but not caps.

The question is, for lualatex only (I only use lualatex, not pdflatex), and if one is supposed to include \usepackage{fontspec}, how can one get small caps and bold? Does one really need \usepackage{fontspec} or can one get away with only \usepackage[T1]{fontenc} (too many packages, too much font confusion with Latex).



   \usepackage[T1]{fontenc} %watch out, Makes tex4ht \verb not accept  different fonts. bug
    \usepackage{fontspec}%for lualatex case
    \usepackage[T1]{fontenc}%needed for small cap bold


\textbf{\textsc{bold small caps}}    


lualatex foo.tex

This is LuaTeX, Version 0.95.0 (TeX Live 2016) 
 restricted system commands enabled.
LaTeX2e <2016/03/31> patch level 2

LaTeX Font Warning: Font shape `T1/lmr/bx/sc' undefined
(Font)              using `T1/lmr/bx/n' instead on input line 13.


LaTeX Font Warning: Some font shapes were not available, defaults substituted.

Output written on foo.pdf (1 page, 39002 bytes).
Transcript written on foo.log.

TL 2016

Best Answer

It is completely wrong to say that you need a particular font encoding to get small caps.

the issue is that CM Unicode includes bold small caps, but the (otherwise recommended) latin modern does not.

So you want cm unicode not latin modern (which is the default with fontspec)

enter image description here


    \usepackage[tuenc]{fontspec}%for lualatex case

\setmainfont{CMU Serif}


  not bold or caps

\textsc{small caps}    

\textbf{\textsc{bold small caps}}