Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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}
share|improve this question
    
possible duplicate of Fonts larger than \Huge? –  DG' Feb 25 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 Feb 25 at 8:54

3 Answers 3

up vote 7 down vote accepted

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

share|improve this answer

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{"}
share|improve this answer
    
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 Feb 25 at 8:42
    
@Aung I've updated the answer. –  karlkoeller Feb 25 at 9:07

use

\documentclass[fontsize=20pt]{scrartcl}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.