1

I'm working a document using the scrartclclass with the following options and packages:

\documentclass[10pt,letterpaper,DIV=14,titlepage=false,twocolumn=on]{scrartcl}
%\usepackage[DIV=14]{typearea}
\usepackage[spanish,activeacute,mexico]{babel}
\usepackage[english=british,french=quotes,german=quotes,spanish=mexican]{csquotes}
\usepackage{ucs}
\usepackage{hyperref}
\hypersetup{
    bookmarks=true,         % show bookmarks bar?
    unicode=true,           % non-Latin characters in Acrobat’s bookmarks
    pdftoolbar=true,        % show Acrobat’s toolbar?
    pdfmenubar=true,        % show Acrobat’s menu?
    pdffitwindow=false,     % window fit to page when opened
    %pdfstartview={FitH},   % fits the width of the page to the window
    pdftitle={Document},    % title
    pdfauthor={Me},     % author
    pdfsubject={Fortation},   % subject of the document
    pdfcreator={Listopad},   % creator of the document
    pdfproducer={Balerdi}, % producer of the document
    %pdfkeywords={keyword1} {key2} {key3}, % list of keywords
    pdfnewwindow=true,      % links in new window
    colorlinks=true,       % false: boxed links; true: colored links
    linkcolor=teal,          % color of internal links (change box color with linkbordercolor)
    citecolor=green,        % color of links to bibliography
    filecolor=red,      % color of file links
    urlcolor=blue,           % color of external links
    anchorcolor=magenta, % color for anchor texto
    filecolor=cyan, % color for urls which open local files
    menucolor=orange, % color for acrobat menu items
    runcolor=violet, % color for run links (launch annotations)
}
\usepackage{url}
\usepackage{fontspec} % 
\defaultfontfeatures{Mapping=tex-text}
\usepackage{xunicode}
\usepackage{xltxtra}
\setmainfont{Constantia} 
\setsansfont{Corbel}
\setmonofont{Consolas}

\renewcommand{\familydefault}{\sfdefault}
\pagestyle{plain}

\usepackage[usenames,dvipsnames,x11names,table]{xcolor}
\usepackage[per-mode=symbol]{siunitx}
\sisetup{
%output-decimal-marker = {,},
detect-weight= true, 
range-units = brackets,
list-final-separator = { \translate{and} },
list-pair-separator = { \translate{and} },
range-phrase = { \translate{to (numerical range)} },
}
\usepackage{array}
\usepackage{makeidx}
\usepackage{graphicx}
%\usepackage[grid=true,gridcolor=cyan,subgridcolor=orange,gridunit=pt]{eso-pic}% dibuja la reticula de las paginas

\usepackage{scrpage2}
\pagestyle{scrheadings}
\ohead{\textbf{Me} -- Document}
\ihead{\texttt{http://listopad.org.mx}}    

\usepackage[stable,bottom]{footmisc}
\raggedbottom
\clubpenalty=10000
\widowpenalty=10000
%\setlength{\parskip}{3pt plus 2pt minus 2pt}

\parskip0.4\baselineskip

\begin{document}

\end{document}

This works fine compiling with XeLaTeXmy problem is how to use correctly in the same document those three fonts, because I can only load Cobel, all the document appears with Corbel, but not with Cosntantia and Consolas.

I use this preamble and works fine every time I want to compose a document with this class (remember that the KOMA Script classes can use by default serif and sans serif fonts for headers and other stuff) with only one typeface, sucha as Myriad, but I don't know why it doesn't work when I add another font as \setmainfont.

  • You've set the default font family to sans serif. So the settings of the serif font will have no effect unless you explicitly change to serif. If you remove the line setting the entire document to sans, you will get the normal behaviour. (So if that's a mix of serif with sans for headers etc., that's what you'll then get.) That is, remove \renewcommand{\familydefault}{\sfdefault} if you want to use all three fonts. – cfr Apr 28 '14 at 21:38
  • Yeah, thanks, I was in a hurry and there was long time ago I didn't use XeLaTeX so I forgot to remove or comment that line. – Aradnix Apr 29 '14 at 1:11
3

Your document includes the following line in the preamble:

\renewcommand{\familydefault}{\sfdefault}

This sets the default font family to sans serif. So the settings of the serif font have no effect unless you explicitly request serif using something like \rmfamily or \textrm{}.

If you remove that line from the preamble, you will get the normal behaviour. So if your document is configured to use serif for the main body with with sans for headers, for example, that's what you'll then get.

  • @Aradnix I know. It is gone from the comments now but I was asked to post an answer as part of the 'Answer the Unanswered' session earlier. (Unanswered questions affect the standing of the site within the SE network, I think, so every month there's a session trying to tidy up a bit.) Only somebody has deleted the comments discussing this! – cfr Sep 6 '14 at 23:08
  • I know and I understand it, and thanks for the answer and for the feedback. That's the best of the answers. – Aradnix Sep 6 '14 at 23:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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