question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CTex fontset `mac' is unavailable in current mode

See original GitHub issue

I’m trying to run manim on a mac with latex installed via the Tex Live Utility. I’m trying to run old_projects/eoc/chapter1.py. Perhaps that’s not intended to work any longer.

I see this error in a tex log:

… . LaTeX info: “xparse/define-command” . . Defining command \CTeX with sig. ‘’ on line 746. …

(/usr/local/texlive/2017/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-mac.def File: ctex-fontset-mac.def 2017/11/22 v2.4.11 Mac OS X fonts definition (CTEX)

!!! ! ! Critical ctex error: “fontset-unavailable” ! ! CTeX fontset `mac’ is unavailable in current mode. ! ! See the ctex documentation for further information. ! ! For immediate help type H <return>. !..

Any thoughts anyone?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5

github_iconTop GitHub Comments

2reactions
Sreejeshgnaircommented, Feb 15, 2018

For me, what helped was to replace the above with

def tex_to_dvi(tex_file):
	result = tex_file.replace(".tex", ".xdv")
	if not os.path.exists(result):
		commands = [
			"xelatex",
			"-no-pdf",
			"-interaction=batchmode",
			"-halt-on-error",
			"-output-directory=" + TEX_DIR,
			tex_file,
			">",
			get_null()
		]
		exit_code = os.system(" ".join(commands))
		if exit_code != 0:
			latex_output = ''
			log_file = tex_file.replace(".tex", ".log")
			if os.path.exists(log_file):
				with open(log_file, 'r') as f:
					latex_output = f.read()
			raise Exception(
				"Latex error converting to dvi. "
				"See log output above or the log file: %s" % log_file)
	return result

def dvi_to_svg(dvi_file, regen_if_exists = False):
	"""
	Converts a dvi, which potentially has multiple slides, into a
	directory full of enumerated pngs corresponding with these slides.
	Returns a list of PIL Image objects for these images sorted as they
	where in the dvi
	"""
	result = dvi_file.replace(".xdv", ".svg")
	if not os.path.exists(result):
	    commands = [
	        "dvisvgm",
	        dvi_file,
	        "-n",
	        "-v",
	        "0",
	        "-o",
	        result,
	        ">",
	        get_null()
	    ]
	    os.system(" ".join(commands))
	return result

what this does is forces xelatex to output an xdv that dvisvgm can then use.

1reaction
Ogofocommented, Feb 13, 2018

What helped me to resolve this issue, was to not use CTEX. In the manim root folder you have two .tex templates. You can comment out the \usepackage[UTF8]{ctex} line and uncomment the \usepackage[utf8x]{inputenc} line. This helped me and the examples, as well as the old projects, seem to run without any latex problems.

Read more comments on GitHub >

github_iconTop Results From Across the Web

critical package ctex error:ctex fontset"fandol" is ...
According to the author, all I need is to use ctex package, but when I copy paste the example code in his website...
Read more >
bookdown Error 'CTeX fontset `mac' is unavailable in ...
Critical ctex error: "fontset-unavailable" ! ! CTeX fontset 'mac' is unavailable in current mode. ! ! See the ctex documentation for further ...
Read more >
CTeX fontset `mac' is unavailable in current(ctex) mode.
Critical Package ctex Error: CTeX fontset `mac' is unavailable in current(ctex) mode. } 1. 在这里插入图片描述 点击在访达中显示
Read more >
CTex fontset 'mac' is unavailab... 来自长安少年不负平身- 微博
problem: CTex fontset 'mac' is unavailable in current mode, texlive solved: You may use xelatex or lualatex to compile, rather than pdflatex ...
Read more >
LaTeX报错CTeX fontset `mac' is unavailable in ... - kakkk's Blog
LaTeX报错CTeX fontset `mac' is unavailable in current(ctex)mode. 博主: kakkk; 发布时间: 2022 年06 月29 日; 435 次浏览; 2 条评论; 56字数; 分类: 其他.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found