1

I'm new to XeLaTeX, and my code won't compile when I use the packages titlesec and framed. Am I doing something wrong, or are these packages just incompatible with XeLaTeX? If they are incompatible, what is a good alternative?

There's nothing to say as far as an MWE: I just get an emergency stop after trying to load either package in the preamble.

Edit 01: Here's an MWE anyway. The following won't compile with XeLaTeX. It only works if neither package is loaded.

\documentclass[]{report}
\usepackage{titlesec}
\usepackage{framed}

\begin{document}

Content.

\end{document}

I should also point out that it will compile as it is with ShareLaTeX, but not with my preferred program, LaTeXian (for Mac).

Edit 02: Here is the log file (I think):

This is XeTeX, Version 3.14159265-2.6-0.99991 (TeX Live 2014) (preload
ed format=xelatex)
 \write18 enabled.
entering extended mode
(/Users/<username>/Library/Application Support/Latexian/TSWLatexian
Temp_001332.tex
LaTeX2e <2014/05/01>
Babel <3.9k> and hyphenation patterns for 21 languages loaded.
(/usr/local/texlive/2014basic/texmf-dist/tex/latex/base/report.cls
Document Class: report 2007/10/19 v1.4h Standard LaTeX document class
(/usr/local/texlive/2014basic/texmf-dist/tex/latex/base/size10.clo))

! LaTeX Error: File `titlesec.sty' not found.

Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: sty)

Enter file name:  
  • I've already used titlesec with XeLaTeX and had no problem. Without a minimal working example it's hard to say whatever. – Bernard May 3 '15 at 17:09
  • @RandyRanderson There must be something else up: that demo is 'works for me' (not really a surprise). Could you add \listfiles to your input and edit in the log file here? (The log should be pretty short so should fit happily.) – Joseph Wright May 3 '15 at 17:45
  • Well the error is clear enough: you've got a TeX system lacking titlesec. A normal MacTeX install includes everything, and titlesec has been around for years. (BTW, this is nothing to do with XeTeX.) Your log shows you've installed the BasicTeX system, which is designed to be minimal and requires that you add any packages it doesn't have. – Joseph Wright May 3 '15 at 18:01
  • When I installed it I just clicked the next button until it said it was done. And titlesec and framed both work when I use LaTeX as my typesetter. – Randy Randerson May 3 '15 at 18:04
  • @RandyRanderson Unless you have two TeX systems installed then XeTeX and TeX (latex) share the same tree. Can you edit in a log for a latex run? – Joseph Wright May 3 '15 at 18:07
6

Your log indicates you have BasicTeX installed. It only contains a minimal number of packages from the full TeX Live. As such, assuming you want a small system (rather than just downloading and installing the full MacTeX) you can use the TeX Live Manager to add titlesec and framed. You could also use the Terminal to do this: that's what I would do

sudo tlmgr install titlesec
sudo tlmgr install framed
  • Thanks for your help. I decided to just reinstall MacTeX, and it works fine now. – Randy Randerson May 3 '15 at 18:29
  • I spoke too soon. It only works for the document I'd already started. When I try to open a new one, it can't find my fonts. Trying to fix this is what screwed everything up in the first place. So what's the right way to do it? – Randy Randerson May 3 '15 at 18:40
  • @RandyRanderson That would be a different question but: how are you looking for your fonts. The most reliable way is by font file name, and they should really be system-wide installed (using Fontbook). – Joseph Wright May 3 '15 at 18:43
  • By file name, all of the fonts are .ttf. They are system-wide installed, but it still wouldn't work unless I put them in the same folder as my tex document. – Randy Randerson May 3 '15 at 18:51
  • @RandyRanderson Ah, I remember. For XeTeX on the Mac, you can only use file name for files in the TeX tree (which includes 'here') and have to use the font name for system-wide fonts. These things are dependent on system and TeX program (LuaTeX vs XeTeX). So for example for Arial you need \setmainfont{Arial} not \setmainfont{Arial.ttf} with XeTeX (Mac). – Joseph Wright May 3 '15 at 18:57

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.