Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[MNT]: Use fix-cm rather than type1cm for LaTeX #27654

Closed
@jakelevi1996

Description

@jakelevi1996

Summary

When I try use LaTeX with matplotlib (see script below), I get an error containing! LaTeX Error: File type1cm.sty not found. Onthe site fortype1cm, it says "Note that the LATEX distribution now contains a packagefix-cm, which performs the task oftype1cm, as well as doing the same job for T1- and TS1-encoded ec fonts". On my system/LaTeX installation,fix-cm is installed by default, whereastype1cm is not, so assuming this is generally true for other users, it would make more sense for matplotlib to usefix-cm instead oftype1cm, as this should achieve the same results, and avoid forcing the user to install extra LaTeX packages.

importmatplotlib.pyplotaspltimportmatplotlibmatplotlib.rc('font',**{'family':'serif','serif': ['Computer Modern']})matplotlib.rc('text',usetex=True)plt.plot([1,2],c="b")plt.savefig("output.png")

Python 3.10.12
matplotlib Version: 3.8.2
Ubuntu 22.04.1 LTS

Proposed fix

Use fix-cm rather than type1cm for LaTeX

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp