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

Style file for neurips2024 #145

Merged
merged 5 commits into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/source/docs_dev/contribution_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ If you want to contribute but need help knowing where to start, reach out!
## Where do I put my code?

Once you've got the basic setup (forks, clones, git) going, it is time to write code.
Check out the [continuous-integration](https://tueplots.readthedocs.io/en/latest/docs_dev/continuous_integration) page for information about installing all dev-related tools.
Check out the [continuous-integration](https://tueplots.readthedocs.io/en/latest/docs_dev/continuous_integration.html) page for information about installing all dev-related tools.


Then, roughly follow these steps:
Expand Down
5 changes: 5 additions & 0 deletions tests/test_rc_params_cases/case_bundles.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ def case_bundles_neurips2023(usetex):
return bundles.neurips2023(usetex=usetex, nrows=2, ncols=2, family="serif")


@pytest_cases.parametrize(usetex=[True, False])
def case_bundles_neurips2024(usetex):
return bundles.neurips2024(usetex=usetex, nrows=2, ncols=2, family="serif")


@pytest_cases.parametrize(usetex=[True, False])
def case_bundles_iclr2023(usetex):
return bundles.iclr2023(usetex=usetex, nrows=2, ncols=2, family="serif")
Expand Down
4 changes: 4 additions & 0 deletions tests/test_rc_params_cases/case_figsizes.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ def case_figsizes_neurips2023():
return figsizes.neurips2023(nrows=2, ncols=3, height_to_width_ratio=1.0)


def case_figsizes_neurips2024():
return figsizes.neurips2024(nrows=2, ncols=3, height_to_width_ratio=1.0)


def case_figsizes_iclr2023():
return figsizes.iclr2023(nrows=2, ncols=3, height_to_width_ratio=1.0)

Expand Down
16 changes: 16 additions & 0 deletions tests/test_rc_params_cases/case_fonts.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,22 @@ def case_fonts_neurips2023_tex_custom():
return fonts.neurips2023_tex(family="serif")


def case_fonts_neurips2024_default():
return fonts.neurips2024()


def case_fonts_neurips2024_custom():
return fonts.neurips2024(family="serif")


def case_fonts_neurips2024_tex_default():
return fonts.neurips2024_tex()


def case_fonts_neurips2024_tex_custom():
return fonts.neurips2024_tex(family="serif")


def case_fonts_iclr2023_tex_default():
return fonts.iclr2023_tex()

Expand Down
4 changes: 4 additions & 0 deletions tests/test_rc_params_cases/case_fontsizes.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ def case_fontsizes_neurips2023():
return fontsizes.neurips2023()


def case_fontsizes_neurips2024():
return fontsizes.neurips2024()


def case_fontsizes_iclr2023():
return fontsizes.iclr2023()

Expand Down
11 changes: 11 additions & 0 deletions tueplots/bundles.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,17 @@ def neurips2023(*, usetex=True, rel_width=1.0, nrows=1, ncols=1, family="serif")
return {**font_config, **size, **fontsize_config}


def neurips2024(*, usetex=True, rel_width=1.0, nrows=1, ncols=1, family="serif"):
"""Neurips 2024 bundle."""
if usetex is True:
font_config = fonts.neurips2024_tex(family=family)
elif usetex is False:
font_config = fonts.neurips2024(family=family)
size = figsizes.neurips2024(rel_width=rel_width, nrows=nrows, ncols=ncols)
fontsize_config = fontsizes.neurips2024()
return {**font_config, **size, **fontsize_config}


def iclr2023(*, usetex=True, rel_width=1.0, nrows=1, ncols=1, family="serif"):
"""ICLR 2023 bundle."""
if usetex is True:
Expand Down
23 changes: 23 additions & 0 deletions tueplots/figsizes.py
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,29 @@ def neurips2023(
)


def neurips2024(
*,
rel_width=1.0,
nrows=1,
ncols=2,
constrained_layout=True,
tight_layout=False,
height_to_width_ratio=_GOLDEN_RATIO,
pad_inches=_PAD_INCHES,
):
"""Neurips 2024 figure size.
Source: https://nips.cc/Conferences/2024/CallForPapers"""
libbylbaker marked this conversation as resolved.
Show resolved Hide resolved
return _neurips_and_iclr_common(
rel_width=rel_width,
nrows=nrows,
ncols=ncols,
constrained_layout=constrained_layout,
tight_layout=tight_layout,
height_to_width_ratio=height_to_width_ratio,
pad_inches=pad_inches,
)


def iclr2023(
*,
rel_width=1.0,
Expand Down
14 changes: 14 additions & 0 deletions tueplots/fonts.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,20 @@ def neurips2023_tex(*, family="serif"):
return _times_tex_via_pkg_ptm(family=family)


def neurips2024(*, family="serif"):
"""Fonts for Neurips 2024."""
# NeurIPS' style-files states that it uses Times New Roman
# font, but includes the 'ptm' package, which implements
# the 'Times' font.
# Therefore, refer to 'Times' instead of 'Times New Roman'
return _times(family=family)


def neurips2024_tex(*, family="serif"):
"""Fonts for Neurips 2024. LaTeX version."""
return _times_tex_via_pkg_ptm(family=family)


def iclr2023_tex(*, family="serif"):
"""Fonts for ICLR 2023. LaTeX version."""
return _times_tex_via_pkg_times(family=family)
Expand Down
5 changes: 5 additions & 0 deletions tueplots/fontsizes.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ def neurips2023(*, default_smaller=1):
return _from_base(base=10 - default_smaller)


def neurips2024(*, default_smaller=1):
"""Font size for Neurips 2024."""
return _from_base(base=10 - default_smaller)


def iclr2023(*, default_smaller=1):
"""Font size for ICLR 2023."""
return _from_base(base=10 - default_smaller)
Expand Down
Loading