1

Background: I'm writing my thesis and per the department guidelines, I have to use TrueType fonts and they need to be embedded in the PDF.

Now, I have managed to change everything into Computer Modern Unicode (CMU) or Latin Modern for monospace font, but the output file says there are other font types (Type 1) embedded in the PDF (and there are so many duplicates for some reason):

Adobe Acrobat

My question is, how can I make sure only TrueType fonts are being used? I searched for these fonts in the preamble:

\usepackage[paper= letterpaper,left=1.5in,right=1in,top=1.25in,bottom=1.25in]{geometry}
\usepackage{verbatim}
\usepackage{latexsym}
\usepackage{mathchars}
\usepackage{setspace}

\usepackage[english]{babel}
\usepackage{blindtext}
\usepackage[compact]{titlesec} % removing extra white space with "titlespacing"
\usepackage[labelsep=period]{caption} % adds dots instead of colon
\usepackage[none]{hyphenat} % removes word hyphenating
\usepackage[document]{ragged2e}% no word-wrap justification
\setlength{\RaggedRightParindent}{\parindent}
\usepackage{etoolbox} % to fix the problem caused by above code -- see "AtBeginEnvironment"
\usepackage{txfonts}  % for upright greek letters | use $\betaup$ or $\muup$
\usepackage{bibentry} % for full citation inline
\usepackage{textcomp} % for copyright and other symbols
\usepackage{datetime} % for date
\usepackage{tabto} % for tabbing (see committee.tex)
\usepackage{fontspec} % to import fonts via XeTeX
\setmainfont{CMU Serif} % TrueType font of Computer Modern
\setmonofont{Latin Modern Mono Prop} % Mono TrueType font
\setromanfont{CMU Serif} % TrueType
\setsansfont{CMU Serif} % TrueType
\usepackage{enumitem} % for better item listing and change its spacing
\usepackage{fixltx2e} % for textsubscript{}
\usepackage[natbibapa]{apacite} % for bibliography % use apacite or apalike
\usepackage[nottoc,notlof,notlot]{tocbibind} % to fix bib href jump
\usepackage{hyperref} % for bibliography
\usepackage{setspace} % Allows for \singlespacing and \doublespacing command
\usepackage[super]{nth} % for creating 1st, 2nd, etc. using \nth{1}, \nth{2}
\usepackage{tabu} % for more adjustments for table
\usepackage{tabularx} % for table
\usepackage{placeins} % for table -- add \FloatBarrier before and after begin/end table
\usepackage[flushleft]{threeparttable} % for table
\usepackage{booktabs,caption,fixltx2e} % caption width setup (captionsetup) is further down
\usepackage[space]{grffile} % for spacing in graphics path name
\usepackage{graphicx} % for images - related: use [float] package for placement
\graphicspath{ {/Users/Payam/Google Drive/Thesis/images/} } % image directory
\usepackage{gensymb} % for degree sign \degree
\usepackage[table,xcdraw]{xcolor} % for table

\usepackage{xpatch} % for two spaces after period
\makeatletter % for two spaces after period
\xpatchcmd{\selectfont} % for two spaces after period
  {\pickup@font\font@name} % for two spaces after period
  {\pickup@font\font@name\fontdimen7\font=\fontdimen2\font}
 {}{}
\makeatother % for two spaces after period
\usepackage{tocloft} % changing TOC boldness

\usepackage{color} % for color text
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \let\oldtextbf\textbf % changes all bolod text color to red
 \renewcommand{\textbf}[1]{\textcolor{red}{\oldtextbf{#1}}} % changes bold text color to red
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Remove the two lines above after userpackage{color} before submitting  %%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


% Removing extra space
\titlespacing{\section}{0pt}{*0}{*0}
\titlespacing{\subsection}{0pt}{*0}{*0}
\titlespacing{\subsubsection}{0pt}{*0}{*0}

%%% This is for shortauthor references
\defcitealias{CDC2012}{CDC, 2012}
\defcitealias{CDCfasd}{CDC, 2014}
\defcitealias{NIHalcohol}{NIH, 2015}
\defcitealias{NIHcpt1}{NIH, 2014}
\defcitealias{DoHaHS2014}{HSS, 2014}

% Removes bolded TOC entries
\renewcommand\cftchapfont{\mdseries}
\renewcommand\cftchappagefont{\mdseries}

% centers table tex vertically when use "m"
\renewcommand\tabularxcolumn[1]{>{\Centering}m{#1}}

\input{blocked.sty}
\input{uhead.sty}
\input{boxit.sty}
\input{icthesis.sty}

\newcommand{\ipc}{{\sf ipc}}

\newcommand{\Prob}{\bbbp}
\newcommand{\Real}{\bbbr}
\newcommand{\real}{\Real}
\newcommand{\Int}{\bbbz}
\newcommand{\Nat}{\bbbn}

\newcommand{\NN}{{\sf I\kern-0.14emN}}   % Natural numbers
\newcommand{\ZZ}{{\sf Z\kern-0.45emZ}}   % Integers
\newcommand{\QQQ}{{\sf C\kern-0.48emQ}}   % Rational numbers
\newcommand{\RR}{{\sf I\kern-0.14emR}}   % Real numbers
\newcommand{\KK}{{\cal K}}
\newcommand{\OO}{{\cal O}}
\newcommand{\AAA}{{\bf A}}
\newcommand{\HH}{{\bf H}}
\newcommand{\II}{{\bf I}}
\newcommand{\LL}{{\bf L}}
\newcommand{\PP}{{\bf P}}
\newcommand{\PPprime}{{\bf P'}}
\newcommand{\QQ}{{\bf Q}}
\newcommand{\UU}{{\bf U}}
\newcommand{\UUprime}{{\bf U'}}
\newcommand{\zzero}{{\bf 0}}
\newcommand{\ppi}{\mbox{\boldmath $\pi$}}
\newcommand{\aalph}{\mbox{\boldmath $\alpha$}}
\newcommand{\bb}{{\bf b}}
\newcommand{\ee}{{\bf e}}
\newcommand{\mmu}{\mbox{\boldmath $\mu$}}
\newcommand{\vv}{{\bf v}}
\newcommand{\xx}{{\bf x}}
\newcommand{\yy}{{\bf y}}
\newcommand{\zz}{{\bf z}}
\newcommand{\oomeg}{\mbox{\boldmath $\omega$}}
\newcommand{\res}{{\bf res}}
\newcommand{\cchi}{{\mbox{\raisebox{.4ex}{$\chi$}}}}
%\newcommand{\cchi}{{\cal X}}
%\newcommand{\cchi}{\mbox{\Large $\chi$}}

% Logical operators and symbols
\newcommand{\imply}{\Rightarrow}
\newcommand{\bimply}{\Leftrightarrow}
\newcommand{\union}{\cup}
\newcommand{\intersect}{\cap}
\newcommand{\boolor}{\vee}
\newcommand{\booland}{\wedge}
\newcommand{\boolimply}{\imply}
\newcommand{\boolbimply}{\bimply}
\newcommand{\boolnot}{\neg}
\newcommand{\boolsat}{\!\models}
\newcommand{\boolnsat}{\!\not\models}


\newcommand{\op}[1]{\mathrm{#1}}
\newcommand{\s}[1]{\ensuremath{\mathcal #1}}

% Properly styled differentiation and integration operators
\newcommand{\diff}[1]{\mathrm{\frac{d}{d\mathit{#1}}}}
\newcommand{\diffII}[1]{\mathrm{\frac{d^2}{d\mathit{#1}^2}}}
\newcommand{\intg}[4]{\int_{#3}^{#4} #1 \, \mathrm{d}#2}
\newcommand{\intgd}[4]{\int\!\!\!\!\int_{#4} #1 \, \mathrm{d}#2 \, \mathrm{d}#3}

% Large () brackets on different lines of an eqnarray environment
\newcommand{\Leftbrace}[1]{\left(\raisebox{0mm}[#1][#1]{}\right.}
\newcommand{\Rightbrace}[1]{\left.\raisebox{0mm}[#1][#1]{}\right)}

% Funky symobols for footnotes
\newcommand{\symbolfootnote}{\renewcommand{\thefootnote}{\fnsymbol{footnote}}}
% now add \symbolfootnote to the beginning of the document...

\newcommand{\normallinespacing}{\renewcommand{\baselinestretch}{1.5} \normalsize}
\newcommand{\mediumlinespacing}{\renewcommand{\baselinestretch}{1.2} \normalsize}
\newcommand{\narrowlinespacing}{\renewcommand{\baselinestretch}{1.0} \normalsize}
\newcommand{\bump}{\noalign{\vspace*{\doublerulesep}}}
\newcommand{\cell}{\multicolumn{1}{}{}}
\newcommand{\spann}{\mbox{span}}
\newcommand{\diagg}{\mbox{diag}}
\newcommand{\modd}{\mbox{mod}}
\newcommand{\minn}{\mbox{min}}
\newcommand{\andd}{\mbox{and}}
\newcommand{\forr}{\mbox{for}}
\newcommand{\EE}{\mbox{E}}

\newcommand{\deff}{\stackrel{\mathrm{def}}{=}}
\newcommand{\syncc}{~\stackrel{\textstyle \rhd\kern-0.57em\lhd}{\scriptstyle L}~}

\def\coop{\mbox{\large $\rhd\!\!\!\lhd$}}
\newcommand{\sync}[1]{\raisebox{-1.0ex}{$\;\stackrel{\coop}{\scriptscriptstyle
#1}\,$}}

\newtheorem{definition}{Definition}[chapter]
\newtheorem{theorem}{Theorem}[chapter]

\newcommand{\Figref}[1]{Figure~\ref{#1}}
\newcommand{\fig}[3]{
\begin{figure}[!ht]
\begin{center}
\scalebox{#3}{\includegraphics{figs/#1.ps}}
\vspace{-0.1in}
\caption[ ]{\label{#1} #2}
\end{center}
\end{figure}
}

\newcommand{\figtwo}[8]{
\begin{figure}
\parbox[b]{#4 \textwidth}{
\begin{center}
\scalebox{#3}{\includegraphics{figs/#1.ps}}
\vspace{-0.1in}
\caption{\label{#1}#2}
\end{center}
}
\hfill
\parbox[b]{#8 \textwidth}{
\begin{center}
\scalebox{#7}{\includegraphics{figs/#5.ps}}
\vspace{-0.1in}
\caption{\label{#5}#6}
\end{center}
}
\end{figure}
}

but I don't see anything.

I am using XeLaTeX and have the following codes in preamble:

\usepackage{fontspec} % to import fonts via XeTeX
\setmainfont{CMU Serif} % TrueType font of Computer Modern
\setromanfont{CMU Serif} % Roman TrueType
\setsansfont{CMU Serif} % Sans TrueType
\setmonofont{Latin Modern Mono Prop} % Mono TrueType font

Other notes: I am using EPS files (edited in Illustrator) to embed my graphs, but I've made sure the fonts used there are TrueType as well:

Adobe Illustrator

UPDATE: Just wanted to update this post in case somebody else has the same problem. I followed @cfr suggestion and got rid of the CMR, Nimbus, rtxmi, txmia and txsy. Also, as @Sverre mentioned in the comments below, one of the culprits was the images I was using in my document. They were EPS files and Illustrator was embedding the font within them. So to get around that, I followed this guide and converted my images into outlines.

And now I only have these TT fonts embedded:

enter image description here

Re-l
  • 13
  • 1
    Welcome! Why have you set the sans font to a serif? Your department is nuts. I realise that is not your fault and doesn't help, but it has to be said. What do they mean by true type exactly? I ask because some open type fonts are true type, and some true type fonts are actually collections of true type fonts, so asking for true type is not, just by itself, sufficiently specific. We need a complete, small example to help you effectively. Most of the type1 fonts are probably in your maths set up. But you are also using a Times clone somewhere. – cfr Oct 01 '15 at 22:25
  • For example, I bet that the CMU fonts which show as true type are .otf. If that's acceptable, try just \usepackage{fontspec}- don't set the text fonts specifically. That way, you'll get all Latin Modern which is probably better. Then you could try using unicode-math and Latin Modern Math. But you need to zap your current maths font configuration. – cfr Oct 01 '15 at 22:28
  • I'm pretty sure it's your imported graphics. Even when I use .ttf and/or .otf fonts in my graphics, they will nevertheless show up as type1 fonts when I import them in a latex document. – Sverre Oct 01 '15 at 22:28
  • @Sverre Do they also get switched to Times even if you've asked for CMU? – cfr Oct 01 '15 at 22:30
  • @Sverre Even \documentclass[a4paper]{article} \usepackage{fontspec} \setmainfont{CMU Serif} % TrueType font of Computer Modern \setromanfont{CMU Serif} % Roman TrueType \setsansfont{CMU Serif} % Sans TrueType \setmonofont{Latin Modern Mono Prop} % Mono TrueType font \begin{document} Some text $some maths$. \end{document} introduces a type1 subset because the maths is still type1. fontspec doesn't touch it. – cfr Oct 01 '15 at 22:34
  • @cfr No, but that doesn't seem to be the case with the OP either, does it? – Sverre Oct 01 '15 at 22:35
  • @Sverre Yes. There is Nimbus Roman No 9, which is the default Times clone. And the tx... are from a Times-clone package, too, if I remember correctly. – cfr Oct 01 '15 at 22:36
  • @cfr I see (I've never used math expressions in my documents before). Hard to say what's going on in the OP's case since there is no MWE. – Sverre Oct 01 '15 at 22:37
  • @cfr well I saw in the OP's preamble that he's loading txfonts, so ... (Plus a bunch of other strange things I noticed in that preamble). – Sverre Oct 01 '15 at 22:39
  • @Sverre Indeed. I've never used graphics using true type fonts this way, so you are probably right about those. Given your information, I'd guess that the CMU type1 fonts are from the graphics and that the OP is then using a Times-alike maths configuration which is responsible for the others. This is a poor typographic mix, as well, though the department no doubt has a requirement for that as well. – cfr Oct 01 '15 at 22:39
  • @Sverre I missed the preamble. Would be much better inline. Even better as an MWE. – cfr Oct 01 '15 at 22:40
  • 1
    At least latexsym, txfonts and gensymb will introduce type1 fonts. But if these weren't loaded, you'd still get type1 CM maths by default. The preamble is a mess and uses font commands which were deprecated 20+ years ago, but that seems par for the course in thesis preambles - they are inherited and extended like a rambling old house, and people forget there's an old woman spinning in one of the turrets until it is too late. – cfr Oct 01 '15 at 22:46
  • Thank you both for your replies. To answer some of your questions: 1: The department guidelines only say "Create your manuscript using a TrueType font, not a scalable font." Their reasoning is because they have to scale the document down and TT looks better this way. 2: The CMU is actually a .ttf file. 3: I didn't think about the math fonts, I'll try the unicode-math and will try again. 4: I'll play with the images, too, and see what happens. – Re-l Oct 01 '15 at 22:48
  • I repeat: they are nuts. True Type fonts are scalable. Moreover, they surely want a scalable font if they are going to scale it. Similarly, type1 fonts, like True Type, scale well. If you can only use .ttf, then I don't see anyway to typeset the mathematics. The only thing you could do would be to create your maths stuff as PNG or something and include them as images. Obviously, these will not scale at all well, but they will avoid using type1 fonts. If you can use .otf, you can probably do it although the requirement is, I repeat, nuts. Type1 scale beautifully. – cfr Oct 01 '15 at 23:09
  • You could try Asana Math. This is a .ttc font. It won't look very good, but that is probably not a requirement. (I don't think it will look very good with CMU - this isn't an aesthetic judgement of the font itself.) – cfr Oct 01 '15 at 23:11
  • I was able to get rid of the Nimbus Roman No 9 using \usepackage[no-math]{fontspec} and \usepackage{mathastext}, so thank you for that. I will email the graduation office and ask them about Type1 and see if they allow it. In the mean time, I'll see if I can figure out where the last three remaining Type1 fonts are coming from: rtxr, txmia, and txsy. – Re-l Oct 01 '15 at 23:17
  • txfonts. See my answer below. I don't think no-math is doing anything. mathastext is doing the work by overriding partially txfonts. – cfr Oct 01 '15 at 23:18

1 Answers1

5

Here's a cut-down version of your preamble with some comments and a minimal set up for Latin Modern with Latin Modern Math:

\documentclass[letterpaper]{article}
\usepackage[left=1.5in,right=1in,top=1.25in,bottom=1.25in]{geometry}

\usepackage{fontspec}% to import fonts via XeTeX
% better to use Latin Modern across the board than mix with CMU, I think - LM is the default
\setmonofont{Latin Modern Mono Prop} % Mono TrueType font
\usepackage{unicode-math}

%% The following packages will all introduce type1 fonts:
% \usepackage{latexsym}
% \usepackage{txfonts}  % for upright greek letters | use $\betaup$ or $\muup$
% \usepackage{gensymb} % for degree sign \degree

%% These seem prima facie problematic based on name alone but I've no idea what is in them so can't say for sure
% \usepackage{mathchars}
% \input{icthesis.sty}

%% These are potentially problematic but I've no idea how they are defined
% \newcommand{\Prob}{\bbbp}
% \newcommand{\Real}{\bbbr}
% \newcommand{\real}{\Real}
% \newcommand{\Int}{\bbbz}
% \newcommand{\Nat}{\bbbn}

%% Do NOT use \sf, \bf, \cal etc. in LaTeX documents - these switches are long deprecated

\begin{document}
  Some text $some maths \mathcal{ab} \mathrm{roman} \mathbb{blackboard}$

\textcopyright
\end{document}

Note that textcomp is not required for things like \textcopyright with this configuration.

For Asana, add

\setmathfont{Asana Math}

which will use the .ttc.

You need to be very careful about the symbols and scripts you use in order to ensure that no type1 fonts creep in.

I would seriously ask them to clarify this requirement. If their point is that they want to insist on scalable fonts, that is entirely reasonable and an awful lot easier to implement.

And if they really don't want scalable, as they claim, then presumably they do not permit submissions prepared with word processors at all. They also can't possibly want True Type in that case. In that case, you would need to force TeX to use only MetaFont source fonts. These scale horribly in well-know PDF viewing software.

cfr
  • 198,882
  • Thank you for taking the time and helping me. I really appreciate it. I'll check with them regarding this whole font issue and ask for clarification. – Re-l Oct 01 '15 at 23:21
  • 2
    @Re-l No problem. Institutional requirements are horrible because they are usually entirely wrong-headed. They say they want X because they think X is a way to get Y and they want Y. But they don't say they want Y - they just insist on X, which probably isn't even a good way to get Y and may be no way to get Y at all! Classic XY problem with the added twist given by the asymmetrical nature of the power-dynamic. – cfr Oct 01 '15 at 23:25
  • Just wanted to update this and say that your edits worked! After changing those lines, I downloaded Asana.ttc and it replaced the txsy etc. Thank you very much, I have all TT fonts now! But I will still email the department and ask. – Re-l Oct 01 '15 at 23:38
  • @Re-l If they'll at least let you use .otf, Latin Modern Math will blend better with CM - even better with Latin Modern itself - than Asana. Then you could just load fontspec and unicode-math and adjust the typewriter font, which would probably give a nicer looking result. But, heck, if they think TT are not scalable and they're convinced that's an advantage, they'll probably tell you to use Comic Sans ;). – cfr Oct 02 '15 at 03:08
  • @cfr Hi! Sorry to bother. I'm pretty sure the basic vertical structure for forest that I used in my answer here is yours and I want to credit you for it in my answer; however, I haven't been able to locate the post in which you produced it (I have the structure saved in a folder with useful snippets that I like to keep for personal use). Could you please guide me to the proper post? – Gonzalo Medina Oct 02 '15 at 19:27
  • @GonzaloMedina I'm sure I use your code inadvertently at times... (Do let me know if you ever think I ought to have credited you - I try to keep track, but I'm not sure I always succeed.) Maybe this answer or this one? Or this? Not sure...? – cfr Oct 02 '15 at 23:58
  • @GonzaloMedina It is no bother. Just I don't find it much easier to find my own posts than I do other people's ;). And it is only even a little easier if I've saved my code for reference. Let me know if you think none of those is it. – cfr Oct 03 '15 at 00:00
  • I chose one of those, but it's not the one I recall. Regarding other people's code, yes, I'm on the same situation; I'm sure I've used your code inadvertently at times, but in this occasion the "core" of the answer was your setting (which I copied to my useful snippets file), so credit was in order. No worries; you can use my code whenever you want; I hereby grant you permission to do so even without crediting me :) (although I know that you give credit when required). – Gonzalo Medina Oct 03 '15 at 01:13
  • Thank you. The command \usepackage{unicode-math} removed Computer Modern Type 1C fonts when compiling with XeLaTeX. – beroal Jan 20 '20 at 14:50