4

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{
    colorlinks=true,
    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}
\def\mycopyright{2018}
\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}
{http://www.linkedin.com/in/chrisfinazzo}
\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\\
BNY Mellon & Facebook\\
Chubb & Google\\
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?

egreg
  • 1,121,712
Chris
  • 527
  • 3
    Don't load mathptmx. Use instead after loading fontspec, \setmainfont{TeX Gyre Termes). – Alan Munn Dec 31 '18 at 20:33
  • 2
    Switch to LuaTeX instead. Math typesetting in XeTeX is sort of broken https://tex.stackexchange.com/questions/281549/why-is-the-fraction-off-the-math-axis-in-xetex – Henri Menke Dec 31 '18 at 20:34
  • @egreg, The reason it is linked is to avoid simply dumping a bunch of text into my answer which is, by itself annoying. – Chris Dec 31 '18 at 20:40
  • 1
    @Chris We'd have to go through the link and copy-paste everything anyhow. – egreg Dec 31 '18 at 20:42
  • @Raaja, The strict adherence to providing MWE's in examples helps no one if the reason for asking the question is that the code I have does not work correctly. I am aware the conversion is not working, I want to know why, not get shamed for asking a reasonable question. – Chris Dec 31 '18 at 20:42
  • 3
    @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_at_topanswers.xyz Dec 31 '18 at 21:38
  • @Raaja, Please do not misunderstand, the root of my complaint isn't with you, but rather the opinion you expressed without reservation. Although I've been on TeX SE for some time, it has always seemed odd that the larger community of participants decided that MWE's were (for practical purposes) required in answers. More information is useful, but many questions are asked precisely because something isn't working. At times, this meant questions went unanswered for long stretches of time without any explanation why - which is why I originally flagged your earlier comment as dismissive. – Chris Dec 31 '18 at 22:53
  • If there is an established procedure in meta which describes how to address questions that contain an incomplete example (because, for example, the code as written won't compile), that should be stated explicitly so as to avoid these kinds of situations – Chris Dec 31 '18 at 22:56
  • 2
    @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 01 '19 at 02:32
  • @Mico - This explains the mindset a bit more, good to know. As has happened a couple times before, the basis for my question really was, 'I was trying to compile and have some error x, what does this mean?' I realize without surrounding context that becomes more difficult, and expected someone to possibly say 'Here's a probable cause' - because they've seen it before themselves - and describe in broad terms how I might correct it. – Chris Jan 01 '19 at 06:28

2 Answers2

7

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.

output of code

Alan Munn
  • 218,180
  • 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
7

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.

See also the comments I added.

\documentclass[letterpaper,11pt]{article}

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

%\usepackage[none]{hyphenat} % Loading this is a recipe for bad typography
\usepackage{enumitem}
\usepackage[hyphens]{url}
\urlstyle{same}
\usepackage{hyperref} % no xelatex nor xetex option; it should be loaded last
\hypersetup{
    colorlinks=true,
    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
\newcommand\mycopyright{2018}

\begin{document}

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

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

\begin{flushleft}
chris@chrisfinazzo.com\\
http://www.linkedin.com/in/chrisfinazzo
\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 
to multitask, set priorities, and meet deadlines.
\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\\
BNY Mellon & Facebook\\
Chubb & Google\\
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}

enter image description here

The typesetting is very unbalanced, though.

Mico
  • 506,678
egreg
  • 1,121,712
  • 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