4

I would like to know what is the right way to define all the text font as a specific size. I use \documentclass[20pt]{article} but it won't change the font size in xelatex. And these symbols (" and ') are not Times fonts and now matter how I changed the fonts , they look the same. Here is the min working code. I would like to know what is the right way to address font selection in xelatex. Can I get like this ?
enter image description here Instead of this ? enter image description here

 %!TEX TS-program = xelatex

 \documentclass[20pt]{article}
 \usepackage{geometry}
 \usepackage{mathspec}
 \usepackage{lipsum}
 \setmainfont{Times}
 \setmathsfont(Digits,Latin,Greek){Times}
 \usepackage{titling}
 \usepackage{titlesec}
 \usepackage{setspace}
 \usepackage[colorlinks,urlcolor=black]{hyperref}
 \doublespacing
 \titleformat{\section}{\singlespacing\fontsize{20}{24}\bfseries\rmfamily\uppercase} {\thesection.}{0.5em}{}
  \begin{document}
 \section{"check"}
"just checking" this is a "check" and 'check'. 
 \end{document}
2
  • possible duplicate of Fonts larger than \Huge?
    – DG'
    Commented Feb 25, 2014 at 8:29
  • 1
    To get the proper quotes, add the option Mapping=tex-text to your \setmainfont command. Opening quotes are typed with ` and ``; closing quotes are typed with ' and ''. Don't use ", since it has incorrect spacing.
    – ChrisS
    Commented Feb 25, 2014 at 8:54

3 Answers 3

6

In case if you are tied to article document class, here are the two options:

Option-1

You can use scrextend package, that extends the facilities (like font sizes) of `KOMA-script classes to other classes:

%!TEX TS-program = xelatex

\documentclass{article}
\usepackage{scrextend}         %%% this line
\changefontsizes[24pt]{20pt}   %%% and this line
\usepackage{geometry}
\usepackage{mathspec}
\usepackage{lipsum}
\setmainfont[Ligatures=TeX]{Times New Roman}
\setmathsfont(Digits,Latin,Greek){Times New Roman}
\usepackage{titling}
\usepackage{titlesec}
\usepackage{setspace}
\usepackage[colorlinks,urlcolor=black]{hyperref}
\doublespacing
\titleformat{\section}{\singlespacing\fontsize{20}{24}\bfseries\rmfamily\uppercase} {\thesection.}{0.5em}{}
\begin{document}
\section{``check''}
``just checking'' this is a ``check'' and `check'.
\end{document}

Option-2

You can use extsizes package, which is a package version of extarticle mentioned by Karl Koeller in his answer.

%!TEX TS-program = xelatex

\documentclass{article}
%\usepackage{scrextend}
%\changefontsizes[24pt]{20pt}
\usepackage[20pt]{extsizes} %%% this line
\usepackage{geometry}
\usepackage{mathspec}
\usepackage{lipsum}
\setmainfont[Ligatures=TeX]{Times New Roman}
\setmathsfont(Digits,Latin,Greek){Times New Roman}
\usepackage{titling}
\usepackage{titlesec}
\usepackage{setspace}
\usepackage[colorlinks,urlcolor=black]{hyperref}
\doublespacing
\titleformat{\section}{\singlespacing\fontsize{20}{24}\bfseries\rmfamily\uppercase} {\thesection.}{0.5em}{}
\begin{document}
\section{``check''}
``just checking'' this is a ``check'' and `check'.
\end{document} 

enter image description here

1
6

The article class only supports 10pt, 11pt, and 12pt.

You can use the extarticle (extended article) class which supports 20pt.

In the following MWE I've changed "Times" to "Times New Roman" and I get the correct quotes using Ligatures=TeX option, but you have to use the standard LaTeX way for double quotes.

%!TEX TS-program = xelatex

\documentclass[20pt]{extarticle}
\usepackage{geometry}
\usepackage{mathspec}
\usepackage{lipsum}
\setmainfont[Ligatures=TeX]{Times New Roman}
\setmathsfont(Digits,Latin,Greek){Times New Roman}
\usepackage{titling}
\usepackage{titlesec}
\usepackage{setspace}
\usepackage[colorlinks,urlcolor=black]{hyperref}
\doublespacing
\titleformat{\section}{\singlespacing\fontsize{20}{24}\bfseries\rmfamily\uppercase} {\thesection.}{0.5em}{}
\begin{document}
\section{``check''}
``just checking'' this is a ``check'' and `check'.
\end{document} 

Output

enter image description here

If you want "..." to behave this way, you can add these two lines in your preamble:

\usepackage{csquotes}
\MakeOuterQuote{"}
2
  • I thought if I use xelatex , I would get the identical fonts I can get in other places like the image I just updated. Is it not possible even though I use the same fonts? Thanks,
    – Aung
    Commented Feb 25, 2014 at 8:42
  • @Aung I've updated the answer. Commented Feb 25, 2014 at 9:07
1

use

\documentclass[fontsize=20pt]{scrartcl}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .