{
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "\n# Usetex font effects\n\nThis script demonstrates that font effects specified in your pdftex.map\nare now supported in usetex mode.\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "import matplotlib.pyplot as plt\n\n\ndef setfont(font):\n    return rf'\\font\\a {font} at 14pt\\a '\n\n\nfig = plt.figure()\nfor y, font, text in zip(\n    range(5),\n    ['ptmr8r', 'ptmri8r', 'ptmro8r', 'ptmr8rn', 'ptmrr8re'],\n    [f'Nimbus Roman No9 L {x}'\n     for x in ['', 'Italics (real italics for comparison)',\n               '(slanted)', '(condensed)', '(extended)']],\n):\n    fig.text(.1, 1 - (y + 1) / 6, setfont(font) + text, usetex=True)\n\nfig.suptitle('Usetex font effects')\n# Would also work if saving to pdf.\nplt.show()"
      ]
    }
  ],
  "metadata": {
    "kernelspec": {
      "display_name": "Python 3",
      "language": "python",
      "name": "python3"
    },
    "language_info": {
      "codemirror_mode": {
        "name": "ipython",
        "version": 3
      },
      "file_extension": ".py",
      "mimetype": "text/x-python",
      "name": "python",
      "nbconvert_exporter": "python",
      "pygments_lexer": "ipython3",
      "version": "3.14.6"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 0
}