# Convert to Xelatex

I have a document I want to convert using Xelatex. Based on the info here, I've gone through the file and made a number of changes. However, while it will output a new PDF, the conversion fails to pick up any text formatting, such as Bold.

In my Makefile, I am simply pointing Xelatex at the source file - e.g, make foo.pdf.

## preamble.sty

\ProvidesPackage{preamble}

\PassOptionsToPackage{hyphens}{url}
\usepackage[xelatex]{hyperref}
\hypersetup{
urlcolor=blue,
}
\urlstyle{same}
\usepackage[margin=1.905cm]{geometry}
\usepackage{fontspec}
\usepackage{mathptmx}
\usepackage{ulem}
\usepackage[none]{hyphenat} % This style needs to be in the repo, It's not in BasicTex
\usepackage{enumitem} % This style needs to be in the repo, It's not in BasicTex
\pagenumbering{gobble}
\def\myauthor{Christopher M. Finazzo}
\endinput


## Code

\documentclass[letterpaper,11pt]{article}
\usepackage{preamble}
\begin{document}
\begin{center}
\textbf
{\small{CHRISTOPHER M. FINAZZO}} \\
\end{center}
\begin{raggedleft}
\noindent {973.906.0496}
\end{raggedleft}
\hfill \hfill {chris@chrisfinazzo.com}\\
\begin{raggedright}
\end{raggedright}
\begin{center}
\textbf
{PROFESSIONAL OBJECTIVE}
\end{center}
\begin{center}
Communications Analyst
\end{center}
\noindent
\begin{center}
\textbf{PREFERRED FUNCTIONS}
\end{center}
\begin{center}
\begin{tabular}{lll}
Marketing Communications & Internal Communications & Client Communications\\
\end{tabular}
\end{center}
\begin{center}
\textbf{POSITIONING STATEMENT}\\
\end{center}
\begin{raggedright}
Results driven individual with a passion for conveying complex ideas to technical and nontechnical audiences in a way that is accurate, clear, and concise. Proven ability to create audience appropriate messages with a range of authoring tools. Strong verbal and written communication skills as well as the ability to multitask, set priorities, and meet deadlines.\\
\end{raggedright}
\begin{center}
\textbf{COMPETENCIES}
\end{center}
\begin{center}
\begin{tabular}{lll}
\textbf{Writing \& Editing} & \textbf{Authoring Tools} & \textbf{Project Management}\\
AP \& APA Style & HTML, CSS, \& SASS & Requirements Gathering\\
Research Skills & Content Management Systems & Estimating Project Scope\\
Creating a Written Narrative & Social Media & Audience Analysis\\
\end{tabular}
\end{center}
\begin{center}
\textbf{TARGET MARKET CHARACTERISTICS}
\end{center}
\textbf{Geographic Location:} New York Metro area, Should be commutable via public transit.\\
\textbf{Industry or Type of Organization:} Communications, Financial Services, Insurance, Technology\\
\textbf{Size of Organization:} Medium to Large\\
\textbf{Organizational Culture:}\\
Values employees\\
Encourages employee autonomy and individual initiative\\
Provides opportunities for personal and professional growth\\
Leveraging technology to engage with target audiences\\
\begin{center}
\textbf{TARGET LIST}
\end{center}
\begin{center}
\begin{tabular}{ll}
\textbf{Financial Services/Insurance} & \textbf{Communications/Tech/Other}\\
ACE Insurance Group & Bloomberg\\
AIG & Columbia University\\
American Express & Coyne Public Relations\\
Bank of America & Discovery Communications\\
BlackRock & Edelman\\
Citigroup & HP\\
Goldman Sachs & IBM\\
JPMorgan Chase & Microsoft\\
Liberty Mutual & The New York Times\\
Morgan Stanley & NYU\\
New York Life & Rapp\\
Prudential & PwC\\
Travelers & The Star Ledger\\
UBS & Unilever\\
\end{tabular}
\end{center}
\end{document}


What am I missing?

• Don't load mathptmx. Use instead after loading fontspec, \setmainfont{TeX Gyre Termes). – Alan Munn Dec 31 '18 at 20:33
• Switch to LuaTeX instead. Math typesetting in XeTeX is sort of broken tex.stackexchange.com/questions/281549/… – Henri Menke Dec 31 '18 at 20:34
• @Chris We'd have to go through the link and copy-paste everything anyhow. – egreg Dec 31 '18 at 20:42
• @Chris I did not mean to tell you in a wrong way. But, when you are providing links there is no guarantee that the links will stay alive forever. Hence, for archiving purposes, it is better to dump an MWE here. This will be useful for future users who face this same (or close) issue (Since you are already here for long-time, you would know this already). Nevertheless, a happy new year! – Raaja is not active on TEXSE Dec 31 '18 at 21:38
• @Chris - I'm an experienced member of this group and have provided several thousand answers over the years. It's true that I don't absolutely insist on an OP providing an MWE before I'm willing to sit down and come up with a solution. However, queries that contain usable code examples do clearly demonstrate focused mental engagement of the OP, and they are thus are far more likely to generate responses with usable solutions than are queries of the "umm, I'm kinda experiencing a weird problem with LaTeX" type. If a query is unfocused, I refuse to waste my time figuring out what's going on. – Mico Jan 1 '19 at 2:32

Here's (real) minimal example that solves your problem.

\documentclass{article}

\usepackage{fontspec}
%\usepackage{mathptmx} % don't use this package with XeLaTeX
\setmainfont{TeX Gyre Termes}
\begin{document}
\textbf{Some text}
\end{document}


Independently, don't pass the xelatex option to hyperref.

• That did it. I still have an \hbox issue to deal with, but I suspect that is due to a lack of structure in a particular section. – Chris Dec 31 '18 at 21:02

You get

LaTeX Font Warning: Font shape TU/ptm/m/n' undefined
(Font)              using TU/lmr/m/n' instead on input line 23.

LaTeX Font Warning: Font shape TU/ptm/bx/n' undefined
(Font)              using TU/ptm/m/n' instead on input line 25.


and this means you won't get Times, but Latin Modern, with no font shape or series variation.

The error is loading mathptmx. If you want Times, there are several choices, depending on your setup. If you just have BasicTeX, forget it: it doesn't have most of the useful things. However Mac OS X provides an OpenType Times font.

I fixed several errors; mainly package loading and names of environments: don't use \begin{raggedleft} or \begin{raggedright}, but \begin{flushright} and \begin{flushleft} respectively.

\documentclass[letterpaper,11pt]{article}

\usepackage[margin=1.905cm]{geometry}
\usepackage{fontspec}
\usepackage{ulem}

\usepackage{enumitem}
\usepackage[hyphens]{url}
\urlstyle{same}
\usepackage{hyperref} % no xelatex nor xetex option; it should be loaded last
\hypersetup{
urlcolor=blue,
}

%\pagenumbering{gobble} % never ever use this, particularly with hyperref
\pagestyle{empty} % this is good

\setmainfont{Times New Roman}

\newcommand\myauthor{Christopher M. Finazzo} % not \def

\begin{document}

\begin{center}
\bfseries\small CHRISTOPHER M. FINAZZO
\end{center}

\begin{flushright}
973.906.0496\\
\end{flushright}

\begin{flushleft}
chris@chrisfinazzo.com\\
\end{flushleft}

\begin{center}
\textbf{PROFESSIONAL OBJECTIVE} \\
Communications Analyst
\end{center}

\begin{center}
\textbf{PREFERRED FUNCTIONS} \\
\begin{tabular}[t]{lll}
Marketing Communications & Internal Communications & Client Communications\\
\end{tabular} \\[1ex]
\end{center}

\begin{flushleft}
{\centering\textbf{POSITIONING STATEMENT}\\}
Results driven individual with a passion for conveying complex
ideas to technical and nontechnical audiences in a way that is
accurate, clear, and concise. Proven ability to create audience
appropriate messages with a range of authoring tools. Strong
verbal and written communication skills as well as the ability
\end{flushleft}

\begin{center}
\textbf{COMPETENCIES} \\
\begin{tabular}[t]{lll}
\textbf{Writing \& Editing} & \textbf{Authoring Tools} & \textbf{Project Management}\\
AP \& APA Style & HTML, CSS, \& SASS & Requirements Gathering\\
Research Skills & Content Management Systems & Estimating Project Scope\\
Creating a Written Narrative & Social Media & Audience Analysis\\
\end{tabular}
\end{center}

\begin{flushleft}
{\centering\textbf{TARGET MARKET CHARACTERISTICS}\\}
\textbf{Geographic Location:} New York Metro area, Should be commutable via public transit.\\
\textbf{Industry or Type of Organization:} Communications, Financial Services, Insurance, Technology\\
\textbf{Size of Organization:} Medium to Large\\
\textbf{Organizational Culture:}\\
Values employees\\
Encourages employee autonomy and individual initiative\\
Provides opportunities for personal and professional growth\\
Leveraging technology to engage with target audiences
\end{flushleft}

\begin{center}
\textbf{TARGET LIST} \\
\begin{tabular}[t]{ll}
\textbf{Financial Services/Insurance} & \textbf{Communications/Tech/Other}\\
ACE Insurance Group & Bloomberg\\
AIG & Columbia University\\
American Express & Coyne Public Relations\\
Bank of America & Discovery Communications\\
BlackRock & Edelman\\
Citigroup & HP\\
Goldman Sachs & IBM\\
JPMorgan Chase & Microsoft\\
Liberty Mutual & The New York Times\\
Morgan Stanley & NYU\\
New York Life & Rapp\\
Prudential & PwC\\
Travelers & The Star Ledger\\
UBS & Unilever\\
\end{tabular}
\end{center}

\end{document}


The typesetting is very unbalanced, though.

• This is stable now, so I think we're OK. That said, I have two questions regarding your comments in the updated code: %\usepackage[none]{hyphenat} % Loading this is a recipe for bad typography Why is this bad? I'm using Arial intentionally, as it was the original font and hyphenat ensures I don't get weird line breaks, which are ugly and hard to read. %\pagenumbering{gobble} % never ever use this, particularly with hyperref I explicitly do not want page numbering, as the document is 1 page long. What side effects with hyperref are there to be concerned about? – Chris Jan 15 '19 at 17:36
• \pagenumbering{gobble} is always wrong. The correct way is to issue \pagestyle{empty}. About hyphenation, I prefer ten hyphens to a single spread out line. – egreg Jan 15 '19 at 18:53