Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update turkish-font.mplstyle #132

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

WhiteSymmetry
Copy link
Contributor

In this way, the code represents a modern standard in terms of both being up-to-date and supporting Turkish fonts and language.

In this way, the code represents a modern standard in terms of both being up-to-date and supporting Turkish fonts and language.
@echedey-ls echedey-ls added the enhancement New feature or request label Jan 14, 2025
@echedey-ls
Copy link
Collaborator

Thanks for still contributing @WhiteSymmetry !! ❣️
First of all, is there a problem with the current styles? Like using deprecated features or so? As of now, I only find the small differences between the following files. You may need a tool (e.g. GitHub Desktop) to compare them:

master style:

Details

from matplotlib import pyplot as plt
import numpy as np

import scienceplots  # noqa: F401

import os


def model(x, p):
    return x ** p


os.makedirs('figures', exist_ok=True)
x = np.linspace(0, 1, 100)
with plt.style.context(['science', 'turkish-font']):
    fig, ax = plt.subplots()
    for p in [5, 7, 10, 15, 20, 30, 38, 50, 100]:
        ax.plot(x, model(x, p), label=p)
    ax.legend(title=r'Düzen', fontsize=7)
    ax.set(xlabel=r'Gerilim/Volt (mV)')
    ax.set(ylabel=r'Mevcut Güç/Akım ($\mu$A)')
    ax.autoscale(tight=True)
    fig.savefig('figures/fig17a.jpg', dpi=300)

pr132 style:

Details

# %%
from matplotlib import pyplot as plt
import numpy as np

import scienceplots  # noqa: F401

import os


def model(x, p):
    return x ** p


os.makedirs('figures', exist_ok=True)
x = np.linspace(0, 1, 100)

# %%
with plt.style.context(['science', 'turkish-font-edited.mplstyle']):
    fig, ax = plt.subplots()
    for p in [5, 7, 10, 15, 20, 30, 38, 50, 100]:
        ax.plot(x, model(x, p), label=p)
    ax.legend(title=r'Düzen', fontsize=7)
    ax.set(xlabel=r'Gerilim/Volt (mV)')
    ax.set(ylabel=r'Mevcut Güç/Akım ($\mu$A)')
    ax.autoscale(tight=True)
    fig.savefig('figures/fig17.jpg', dpi=300)

I'm on board with the changes, but if there is a rationale for including them, please detail, so we can reference bug reports if needed and publish them in the changelog (you may want to edit the changelog file too).

@WhiteSymmetry
Copy link
Contributor Author

To avoid manually declaring features already provided by default in modern TeX systems, improve typography quality, and simplify the document setup.

  1. The shorthands=:! option modifies the interpretation of colon and exclamation marks. Its removal indicates a preference for the default behavior of these symbols.
  2. The utf8 encoding is essential for handling Turkish characters correctly. However, in modern TeX compilers, utf8 is usually the default, making this declaration redundant.
  3. latin5 is an encoding method used for Turkish character support. However, UTF-8 has become the more widespread and modern standard, rendering latin5 unnecessary.
  4. The lmodern package provides better font quality by using Latin Modern fonts. It enhances compatibility, especially with T1 font encoding.
  5. The removal of certain packages (like inputenc) simplifies the configuration, as modern TeX compilers inherently support these features.
  6. \usepackage[turkish]{babel} declaration is sufficient for Turkish documents. Removing additional options focuses solely on basic language support.

@echedey-ls
Copy link
Collaborator

That's super, thanks for the in-depth explanation.
I understand this adds some unlikely breaking changes. I will merge this in a week or so, in case somebody wants to review as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants