def test_rcParams(self): preamble = r"\documentclass[a4paper,12pt,noarxiv]{revtex4-1}" formatter = parse(preamble) assert plt.rcParams["axes.labelsize"] == formatter.fontsizes.small assert plt.rcParams["axes.titlesize"] == formatter.fontsizes.large assert plt.rcParams[ "xtick.labelsize"] == formatter.fontsizes.footnotesize assert plt.rcParams[ "ytick.labelsize"] == formatter.fontsizes.footnotesize assert plt.rcParams["font.size"] == formatter.fontsizes.small assert plt.rcParams["pgf.texsystem"] == "pdflatex" assert plt.rcParams["font.family"] == ["serif"] assert plt.rcParams["text.usetex"] == False assert plt.rcParams["pgf.rcfonts"] == True assert plt.rcParams["xtick.direction"] == "in" assert plt.rcParams["ytick.direction"] == "in" assert plt.rcParams["xtick.major.size"] == 4 assert plt.rcParams["ytick.major.size"] == 4 assert plt.rcParams["lines.linewidth"] == 1 assert plt.rcParams["axes.linewidth"] == 0.5 assert plt.rcParams["grid.linewidth"] == 0.5 assert plt.rcParams["lines.markersize"] == 3 assert plt.rcParams["legend.frameon"] == True assert plt.rcParams["legend.framealpha"] == 1.0 assert plt.rcParams["legend.fancybox"] == False
def test_parse_some(self): """Test the parsing if only some options are present.""" preamble = r"\documentclass[a4paper,12pt,noarxiv]{revtex4-1}" formatter = parse(preamble) assert formatter is not None assert formatter.columns == "twocolumn" assert formatter.fontsize == 12
def test_parse_default(self): """Test the default values.""" preamble = r"\documentclass{revtex4-1}" formatter = parse(preamble) assert formatter is not None assert formatter.columns == "twocolumn" assert formatter.fontsize == 10
def test_parse_all(self): """Test the parsing of all options.""" preamble = r"\documentclass[onecolumn,unpublished,letterpaper,11pt]{revtex4-1}" formatter = parse(preamble) assert formatter is not None assert formatter.columns == "onecolumn" assert formatter.fontsize == 11
def test_parse_none(self, preamble): """Test that the parser returns None if the preamble is not for quantumarticle.""" assert parse(preamble) is None