diff --git a/tests/test_rc_params_cases/case_bundles.py b/tests/test_rc_params_cases/case_bundles.py index 6d38976..6966f2e 100644 --- a/tests/test_rc_params_cases/case_bundles.py +++ b/tests/test_rc_params_cases/case_bundles.py @@ -5,6 +5,14 @@ from tueplots import bundles +@pytest_cases.parametrize(column=["full", "half"]) +@pytest_cases.parametrize(usetex=[True, False]) +def case_bundles_cvpr2024(column, usetex): + return bundles.cvpr2024( + nrows=2, ncols=2, family="serif", column=column, usetex=usetex + ) + + @pytest_cases.parametrize(column=["full", "half"]) @pytest_cases.parametrize(usetex=[True, False]) def case_bundles_icml2022(column, usetex): diff --git a/tests/test_rc_params_cases/case_figsizes.py b/tests/test_rc_params_cases/case_figsizes.py index 546415b..1b7efa4 100644 --- a/tests/test_rc_params_cases/case_figsizes.py +++ b/tests/test_rc_params_cases/case_figsizes.py @@ -36,6 +36,14 @@ def case_figsizes_cvpr2022_full(): return figsizes.cvpr2022_full(nrows=2, ncols=3, height_to_width_ratio=1.0) +def case_figsizes_cvpr2024_half(): + return figsizes.cvpr2024_half(nrows=2, ncols=3, height_to_width_ratio=1.0) + + +def case_figsizes_cvpr2024_full(): + return figsizes.cvpr2024_full(nrows=2, ncols=3, height_to_width_ratio=1.0) + + def case_figsizes_neurips2021(): return figsizes.neurips2021(nrows=2, ncols=3, height_to_width_ratio=1.0) diff --git a/tests/test_rc_params_cases/case_fonts.py b/tests/test_rc_params_cases/case_fonts.py index 12bab90..d4192f8 100644 --- a/tests/test_rc_params_cases/case_fonts.py +++ b/tests/test_rc_params_cases/case_fonts.py @@ -130,3 +130,19 @@ def case_fonts_aistats2022_tex_custom(): def case_fonts_aistats2023_tex_custom(): return fonts.aistats2023_tex(family="serif") + + +def case_fonts_cvpr2024_default(): + return fonts.cvpr2024() + + +def case_fonts_cvpr2024_custom(): + return fonts.cvpr2024(family="serif") + + +def case_fonts_cvpr2024_tex_default(): + return fonts.cvpr2024_tex() + + +def case_fonts_cvpr2024_tex_custom(): + return fonts.cvpr2024_tex(family="serif") diff --git a/tests/test_rc_params_cases/case_fontsizes.py b/tests/test_rc_params_cases/case_fontsizes.py index 1347318..2b76e18 100644 --- a/tests/test_rc_params_cases/case_fontsizes.py +++ b/tests/test_rc_params_cases/case_fontsizes.py @@ -3,6 +3,10 @@ from tueplots import fontsizes +def case_fontsizes_cvpr2024(): + return fontsizes.cvpr2024() + + def case_fontsizes_icml2022(): return fontsizes.icml2022() diff --git a/tueplots/bundles.py b/tueplots/bundles.py index 6bb974c..bace65a 100644 --- a/tueplots/bundles.py +++ b/tueplots/bundles.py @@ -4,6 +4,20 @@ from tueplots.constants.color import palettes, rgb +def cvpr2024(*, column="half", nrows=1, ncols=1, usetex=True, family="serif"): + """CVPR 2024 bundle.""" + if column == "half": + size = figsizes.cvpr2024_half(nrows=nrows, ncols=ncols) + elif column == "full": + size = figsizes.cvpr2024_full(nrows=nrows, ncols=ncols) + if usetex is True: + font_config = fonts.cvpr2024_tex(family=family) + elif usetex is False: + font_config = fonts.cvpr2024(family=family) + fontsize_config = fontsizes.cvpr2024() + return {**font_config, **size, **fontsize_config} + + def icml2022(*, column="half", nrows=1, ncols=1, usetex=True, family="serif"): """ICML 2022 bundle.""" if column == "half": diff --git a/tueplots/figsizes.py b/tueplots/figsizes.py index 5be23d1..bfb123a 100644 --- a/tueplots/figsizes.py +++ b/tueplots/figsizes.py @@ -253,6 +253,59 @@ def cvpr2022_full( ) +def cvpr2024_half( + *, + nrows=1, + ncols=1, + constrained_layout=True, + tight_layout=False, + height_to_width_ratio=_GOLDEN_RATIO, + pad_inches=_PAD_INCHES, +): + """Double-column (half-width) figures for CVPR 2024.""" + + figsize = _from_base_in( + base_width_in=3.25, + rel_width=1.0, + height_to_width_ratio=height_to_width_ratio, + nrows=nrows, + ncols=ncols, + ) + return _figsize_to_output_dict( + figsize=figsize, + constrained_layout=constrained_layout, + tight_layout=tight_layout, + pad_inches=pad_inches, + ) + + +def cvpr2024_full( + *, + rel_width=1.0, + nrows=1, + ncols=2, + constrained_layout=True, + tight_layout=False, + height_to_width_ratio=_GOLDEN_RATIO, + pad_inches=_PAD_INCHES, +): + """Single-column (full-width) figures for CVPR 2024.""" + + figsize = _from_base_in( + base_width_in=6.875, + rel_width=rel_width, + height_to_width_ratio=height_to_width_ratio, + nrows=nrows, + ncols=ncols, + ) + return _figsize_to_output_dict( + figsize=figsize, + constrained_layout=constrained_layout, + tight_layout=tight_layout, + pad_inches=pad_inches, + ) + + # Single-column formats diff --git a/tueplots/fonts.py b/tueplots/fonts.py index 8bd3dbc..e812066 100644 --- a/tueplots/fonts.py +++ b/tueplots/fonts.py @@ -51,6 +51,16 @@ def iclr2024(*, family="serif"): return _neurips_and_iclr_common(family=family) +def cvpr2024_tex(*, family="serif"): + """Fonts for CVPR 2024. LaTeX version.""" + return _neurips_and_iclr_tex_common(family=family) + + +def cvpr2024(*, family="serif"): + """Fonts for CVPR 2024. LaTeX version.""" + return _neurips_and_iclr_common(family=family) + + def _neurips_and_iclr_common(*, family="serif"): """Default fonts for Neurips.""" return { diff --git a/tueplots/fontsizes.py b/tueplots/fontsizes.py index cb3b229..f6932b1 100644 --- a/tueplots/fontsizes.py +++ b/tueplots/fontsizes.py @@ -11,6 +11,13 @@ def icml2022(*, default_smaller=1): return _from_base(base=9 - default_smaller) +def cvpr2024(*, default_smaller=1): + """Font size for CVPR 2024.""" + # CVPR text size is 10, but captions are in size 9. + # Therefore, we use base 9 instead of 10. + return _from_base(base=9 - default_smaller) + + def neurips2021(*, default_smaller=1): """Font size for Neurips 2021.""" return _from_base(base=10 - default_smaller)