3

Since I'm working with the fontspec package, using the Segoe UI font

(actually, let me include a secondary question here: which font would you prefer for a scientifical paper on influenza, keeping in mind both aesthetics and readability? Segoe UI or Segoe UI Light? If you please, you can recommend me another font for my paper, but as you see, I prefer "clean", modern, sleek fonts. I tried the Flanders Art font (since our Flemish government started using this one and I'm pretty fond of it), but it's just not compatible enough; the Segoe UI package is very compatible. Here are meaningless excerpts of an example document: https://i.stack.imgur.com/Rhs1J.png for the normal version and https://i.stack.imgur.com/5Y8Vw.png for the light version)

the bibliography will show "pp. 94--98" instead of "pp. 94-98". Is there a way I can remove one hyphen? I tried to remove one from the bibliography itself, xetex'ing the main file, running bibtex and twive xetex again, but this didn't work.

Can someon help me on both my primary and secondary question?

Thanks!

Michael

Part of the source code that might be interesting. Don't mind any Dutch comments:

BIBLIOGRAPHY FILE (BIBINFLU.BIB)

@Article{Met78,
Author = {Metz, Charles E.},
Title = {Basic principles of {ROC} analysis},
Journal = {{S}eminars in {N}uclear {M}edicine},
Volume = 8,
Pages = {283-298},
year = 1978
}
@book{Wel03,
author = "Stefan Wellek", year = 2003,
title = "Testing Statistical Hypotheses of Equivalence",
publisher = "{Chapman \& Hall/CRC Press}",
address = "New York"
}
@Article{pmid23462501,
   Author="Kuchar, E.  and Nitsch-Osuch, A.  and Karpinska, T.  and Kurpas, D.  and Zycinska, K.  and Wardyn, K.  and Szenborn, L. ",
   Title="{{P}andemic influenza in the 2009/2010 season in central {P}oland: the surveillance study of laboratory confirmed cases}",
   Journal="Respir Physiol Neurobiol",
   Year="2013",
   Volume="187",
   Number="1",
   Pages="94-98",
   Month="Jun"
}

MAIN FILE (INFLUENZA.TEX)

\documentclass[12pt]{report}
\usepackage[left=1.5in,right=1.5cm,top=2cm,bottom=2.5cm]{geometry}
\usepackage[dutch]{babel}       %vertaling naar Nederlands
\usepackage{graphicx}           %insluiten van afbeeldingen
\usepackage{framed}             %omkaderen van tekst
\usepackage{url}                %weergeven van url's
%\usepackage{makeidx}           %index maken, overbodig in casu
\usepackage{lmodern}            %beter lettertype
%\usepackage{nomencl}           %nomenclatuur, overbodig in casu
\newlength\longest
%\usepackage[toc,nonumberlist]{glossaries} 
                                %package voor glossarium
%\makeglossaries                %registreren van de entries
%\include{glossarium}
%\makeglossaries                %voor de zekerheid
%\printglossary[title=Verklarende woordenlijst] moet nog ingevoegd worden op de gewenste plaats van het glossarium!             
\usepackage{fancyhdr}           %mooiere hoofding en voettekst
\usepackage{tocloft}            %controleert ToC
\usepackage{ragged2e}           %controls voor uitlijning
\usepackage{fontspec}           %voor ander lettertype
\setmainfont[
  %SmallCapsFont={TeX Gyre Termes},
  %SmallCapsFeatures={Letters=SmallCaps},
]{Segoe UI Light}       
%\usepackage{hyperref}          %voor referentielinks       
\usepackage[parfill]{parskip}
\usepackage{natbib}
%\bibliographystyle{apalike}
\usepackage[nottoc]{tocbibind} % Bibliografie in ToC
\bibliographystyle{merlin}
\usepackage{titlesec}
% to change titles font family
\usepackage{titling}
%%% declare fonts and set some formats
% fontspec to use non-latex with xetex
\usepackage{xunicode}
\usepackage{fontspec}
\usepackage{xltxtra}
                                %Flanders Art Serif voor titels
% font declaration and title settings
%\newfontfamily\headingfont[]{Flanders Art Serif}
%\titleformat{\chapter}[hang]
%  {\huge\headingfont}{\thechapter}{20pt}{\Huge}
%\titleformat*{\section}{\LARGE\headingfont}
%\titleformat*{\subsection}{\Large\headingfont}
%\renewcommand{\maketitlehooka}{\headingfont}
\titleformat{\chapter}[hang]{\huge\bfseries}{\makebox[2.5em]{\thechapter\hfill}}{0pt}{}
\begin{document}
\bibliography{Bibinflu}
%\bibliographystyle{apalike}
%\bibliographystyle{bibliodutch}
\end{document}
Mico
  • 506,678
FSJ963
  • 529
  • if you specify tex ligatures -- should be typeset as an en-dash. You probably need to show a complete example that demonstrates the problem. – David Carlisle Dec 08 '14 at 22:03
  • you must load the font with the Ligatures=TeX option. See the documentation of fontspec. – Ulrike Fischer Dec 08 '14 at 22:08
  • Then is there a way - let me say, something like %SmallCapsFont={TeX Gyre Termes}, %SmallCapsFeatures={Letters=SmallCaps} but then for double hyphens, so it would use the standard TeX font? (Which name does that font have, actually?) Is there an alternative for the Ligatures=TeX option? I have absolutely no idea, truth be told, how to use that... – FSJ963 Dec 08 '14 at 22:15
  • Your code loads three [3!] bibliography styles: merlin, apalike, and bibliodutch. Which one is supposed to be in use? – Mico Dec 08 '14 at 22:17
  • Good question... I'd say merlin, since it's included before the inclusion of the bibliography? EDIT: it IS Merlin (here an APA-ref. style, but that aside); replaced the other ones with a % in front of them to prevent further personal confusion. – FSJ963 Dec 08 '14 at 22:19

1 Answers1

5

As for your primary question: use the Ligatures=TeX when selecting the font; for example, \setmainfont[Ligatures=TeX]{Segoe UI}. You can use Unicode en dash (–; U+2013) directly instead, which I find better than using the old TeX ligatures.

As for your secondary question: I can recommend wholeheartedly Gentium. It is free, libre, comprehensive and extremely readable and beautiful.

If you want to use bold and/or small caps, it’s a little bit tricky: Gentium Plus contains small caps, Gentium Basic contains bold glyphs, and both are available for download here. Using fontspec and XeLaTeX one can enjoy both worlds and fake bold small caps (this is not possible in LuaLaTeX, as far as I know). This is a way to make it possible:

\documentclass{article}

\usepackage{fontspec}
\setmainfont[BoldFont={Gentium Basic Bold}]{Gentium Plus}
\fontspec[FakeBold=2.5]{Gentium Plus}
\DeclareFontShape{EU1}{Gentium Plus(0)}{bx}{sc}{<->ssub * Gentium Plus(1)/m/sc}{}

\begin{document}
hello \textbf{hello} \textsc{hello} \textsc{\textbf{hello}} \textbf{\textsc{hello}}
\end{document}

Gentium with fontspec/XeLaTeX tricks

  • Great answer. any alternative for the small caps and bold text? (Gentium itself isn't fully compatible, and I'd like to use it, for which I thank you; I'm especially stunned by it's italic style) – FSJ963 Dec 08 '14 at 22:22
  • @MichaëlHenrotte: you can use Gentium Plus and Gentium Basic; see the part I’ve added to my answer as to how to achieve it nicely in fontspec+XeLaTeX. And yes, Gentium italic is really good looking… ☺ – Júda Ronén Dec 08 '14 at 23:17
  • 4
    Adding Ligatures=TeX is not needed with the last version of fontspec. – egreg Dec 08 '14 at 23:19
  • @JúdaRonén it still gives me LaTeX Font Warning: Font shape 'EU1/GentiumPlus(0)/m/sc' undefined when doing that :/ – FSJ963 Dec 08 '14 at 23:27
  • @MichaëlHenrotte: Have you installed all required font files from both Gentium Plus and Gentium Basic? Is your LaTeX distribution (e.g. TeX Live) up-to-date? – Júda Ronén Dec 08 '14 at 23:35
  • Serious sh!t has happened... Updates MiKTeX, installed the Gentium packages again, XeTeX'ed the main file, click on "View PDF"... "file not found". My gut is telling me this isn't right. Oh yes, the first problem persists, btw. EDIT: if I remove (read: add a % to) everything related with special font, the document is being processed normally again. What's wrong here? – FSJ963 Dec 08 '14 at 23:44
  • @MichaëlHenrotte: Please compile it manually (xelatex file.tex) and post the output LaTeX vomits (use Pastebin or similar website; comments at SE are quite limited). – Júda Ronén Dec 08 '14 at 23:50
  • Serious sh!t has happened... Updates MiKTeX, installed the Gentium packages again, XeTeX'ed the main file, click on "View PDF"... "file not found". My gut is telling me this isn't right. Oh yes, the first problem persists, btw. EDIT: if I remove (read: add a % to) everything related with special font, the document is being processed normally again. What's wrong here? EDIT(bis): processed with only \usepackage{fontspec}, no problem; processed with gentium settings, problem. Processed with Segoe UI settings, no problem. Somehow, now, Gentium Plus (! normal Gentium doesn't) creates a problem – FSJ963 Dec 08 '14 at 23:53
  • Manually compiling just gives me an error from the beginning: "undefined control sequence. l.1 \documentclass[12pt]{report}" UPDATE: Gentium Basic won't rip my paper in two either. It really is Gentium Plus that's ruining my night. – FSJ963 Dec 09 '14 at 00:06
  • Managed to get the error causing file loss when using Gentium Plus: "WARNING "seac" character deprecated in Type 2 charstring. ERROR Type2 Charstring Parser: Parsing charstring failed: (status=-1, stack=5) Output file removed."

    When purely trying to make the file coded by the source code you provided me, I'm getting this: "! No declaration for shape EU1/GentiumPlus(1)/m/sc."

    – FSJ963 Dec 09 '14 at 00:12
  • Fixed all the stuff with \usepackage[T1]{fontenc} \usepackage{gentium}. – FSJ963 Dec 09 '14 at 06:18
  • @MichaëlHenrotte: If it fits your needs well, that’s great. But I’m not sure the gentium package is compatible with fontspec (anyway, if you use XeLaTeX, you can omit the \usepackage[T1]{fontenc} part). – Júda Ronén Dec 09 '14 at 09:35
  • @MichaëlHenrotte: If for some mysterious reason Gentium Plus doesn’t work on your system, you can still use the regular Gentium for upright and italic text and Gentium Basic Bold for bold and bold-italic text: \usepackage{fontspec} \setmainfont[BoldFont={Gentium Basic Bold}]{Gentium}. This way you will still be able to use fontspec; notice that in both this way and using the gentium package you cannot use Gentium Plus’ small caps. If you want to use small caps, you can use another font using the SmallCapsFont option, but beware typographic messiness. – Júda Ronén Dec 09 '14 at 09:39
  • Used "\usepackage[T1]{fontenc} \usepackage{gentium}" and \normalfont\normalfont, and it's working perfectly :) Thanks for all your help. – FSJ963 Dec 09 '14 at 16:14
  • @MichaëlHenrotte: I don’t know what you mean by \normalfont\normalfont, but I’m happy that it’s working for you and I could help ☺ – Júda Ronén Dec 09 '14 at 17:32