当前位置: 首页>>代码示例>>Python>>正文


Python latex.Latex类代码示例

本文整理汇总了Python中inspirehep.utils.latex.Latex的典型用法代码示例。如果您正苦于以下问题:Python Latex类的具体用法?Python Latex怎么用?Python Latex使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Latex类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_get_publi_info_from_publication_info_a_list_of_two_elements

def test_get_publi_info_from_publication_info_a_list_of_two_elements():
    publication_info_a_list_of_two_elements = Record({
        'publication_info': [
            {
                'journal_title': 'Int.J.Theor.Phys.',
                'journal_volume': '38',
                'page_start': '1113',
                'page_end': '1133',
                'year': 1999
            },
            {
                'journal_title': 'Adv.Theor.Math.Phys.',
                'journal_volume': '2',
                'page_start': '231',
                'page_end': '252',
                'year': 1998
            }
        ]
    })
    latex = Latex(publication_info_a_list_of_two_elements, 'latex_eu')

    expected = [
        'Int.\\ J.\\ Theor.\\ Phys.\\  {\\bf 38} (1999) 1113',
        '[Adv.\\ Theor.\\ Math.\\ Phys.\\  {\\bf 2} (1998) 231]'
    ]
    result = latex._get_publi_info()

    assert expected == result
开发者ID:bittirousku,项目名称:inspire-next,代码行数:28,代码来源:test_utils_latex.py

示例2: test_format_output_row_more_than_eight_authors_collaboration_an_empty_list

def test_format_output_row_more_than_eight_authors_collaboration_an_empty_list():
    collaboration_an_empty_list = Record({'collaboration': []})
    latex = Latex(collaboration_an_empty_list, 'latex_eu')

    expected = '  0 {\\it et al.}'
    result = latex._format_output_row('author', [str(i) for i in range(9)])

    assert expected == result
开发者ID:bittirousku,项目名称:inspire-next,代码行数:8,代码来源:test_utils_latex.py

示例3: test_format_output_row_one_author

def test_format_output_row_one_author():
    record = Record({})
    latex = Latex(record, 'latex_eu')

    expected = u'  S.~L.~Glashow,\n'
    result = latex._format_output_row('author', ['S.~L.~Glashow'])

    assert expected == result
开发者ID:bittirousku,项目名称:inspire-next,代码行数:8,代码来源:test_utils_latex.py

示例4: test_get_author_from_corporate_author_an_empty_list

def test_get_author_from_corporate_author_an_empty_list():
    corporate_author_an_empty_list = Record({'corporate_author': []})
    latex = Latex(corporate_author_an_empty_list, 'latex_eu')

    expected = []
    result = latex._get_author()

    assert expected == result
开发者ID:bittirousku,项目名称:inspire-next,代码行数:8,代码来源:test_utils_latex.py

示例5: test_format_output_row_unknown_field

def test_format_output_row_unknown_field():
    record = Record({})
    latex = Latex(record, 'latex_eu')

    expected = ''
    result = latex._format_output_row('unknown_field', 'foo')

    assert expected == result
开发者ID:bittirousku,项目名称:inspire-next,代码行数:8,代码来源:test_utils_latex.py

示例6: test_get_publi_info_from_publication_info_an_empty_list

def test_get_publi_info_from_publication_info_an_empty_list():
    publication_info_an_empty_list = Record({'publication_info': []})
    latex = Latex(publication_info_an_empty_list, 'latex_eu')

    expected = []
    result = latex._get_publi_info()

    assert expected == result
开发者ID:bittirousku,项目名称:inspire-next,代码行数:8,代码来源:test_utils_latex.py

示例7: test_format_output_row_between_one_and_eight_authors

def test_format_output_row_between_one_and_eight_authors():
    record = Record({})
    latex = Latex(record, 'latex_eu')

    expected = u'  F.~Englert and R.~Brout,\n'
    result = latex._format_output_row('author', ['F.~Englert', 'R.~Brout'])

    assert expected == result
开发者ID:bittirousku,项目名称:inspire-next,代码行数:8,代码来源:test_utils_latex.py

示例8: test_format_output_row_report_number

def test_format_output_row_report_number():
    record = Record({})
    latex = Latex(record, 'latex_eu')

    expected = u'  CMS-PAS-TOP-13-007.\n'
    result = latex._format_output_row('report_number', 'CMS-PAS-TOP-13-007')

    assert expected == result
开发者ID:bittirousku,项目名称:inspire-next,代码行数:8,代码来源:test_utils_latex.py

示例9: test_get_author_from_authors_an_empty_list

def test_get_author_from_authors_an_empty_list():
    authors_an_empty_list = Record({'authors': []})
    latex = Latex(authors_an_empty_list, 'latex_eu')

    expected = []
    result = latex._get_author()

    assert expected == result
开发者ID:bittirousku,项目名称:inspire-next,代码行数:8,代码来源:test_utils_latex.py

示例10: test_get_report_number_yes_publi_info_yes_arxiv

def test_get_report_number_yes_publi_info_yes_arxiv(g_a, g_p_i):
    g_a.return_value = True
    g_p_i.return_value = True

    record = Record({})
    latex = Latex(record, 'latex_eu')

    assert latex._get_report_number() is None
开发者ID:bittirousku,项目名称:inspire-next,代码行数:8,代码来源:test_utils_latex.py

示例11: test_format_output_row_arxiv_without_publi_info

def test_format_output_row_arxiv_without_publi_info():
    without_publi_info = Record({})
    latex = Latex(without_publi_info, 'latex_eu')

    expected = u'  arXiv:1512.01296 [hep-th].\n'
    result = latex._format_output_row('arxiv', 'arXiv:1512.01296 [hep-th]')

    assert expected == result
开发者ID:bittirousku,项目名称:inspire-next,代码行数:8,代码来源:test_utils_latex.py

示例12: test_format_output_row_publi_info_not_a_list

def test_format_output_row_publi_info_not_a_list():
    record = Record({})
    latex = Latex(record, 'latex_eu')

    expected = u'  Phys. Lett. 12 (1964) 132-133.\n'
    result = latex._format_output_row('publi_info', 'Phys. Lett. 12 (1964) 132-133')

    assert expected == result
开发者ID:bittirousku,项目名称:inspire-next,代码行数:8,代码来源:test_utils_latex.py

示例13: test_format_output_row_title

def test_format_output_row_title():
    record = Record({})
    latex = Latex(record, 'latex_eu')

    expected = u"  %``Partial Symmetries of Weak Interactions,''\n"
    result = latex._format_output_row('title', 'Partial Symmetries of Weak Interactions')

    assert expected == result
开发者ID:bittirousku,项目名称:inspire-next,代码行数:8,代码来源:test_utils_latex.py

示例14: test_get_title_from_titles_an_empty_list

def test_get_title_from_titles_an_empty_list():
    titles_an_empty_list = Record({'titles': []})
    latex = Latex(titles_an_empty_list, 'latex_eu')

    expected = ''
    result = latex._get_title()

    assert expected == result
开发者ID:bittirousku,项目名称:inspire-next,代码行数:8,代码来源:test_utils_latex.py

示例15: test_get_title_no_titles

def test_get_title_no_titles():
    no_titles = Record({})
    latex = Latex(no_titles, 'latex_eu')

    expected = ''
    result = latex._get_title()

    assert expected == result
开发者ID:bittirousku,项目名称:inspire-next,代码行数:8,代码来源:test_utils_latex.py


注:本文中的inspirehep.utils.latex.Latex类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。