Ejemplo n.º 1
0
 def write_data_input(self, doc, dta_holder):
     ts = time.time()
     st = datetime.datetime.fromtimestamp(ts).strftime('%Y-%m-%d %H:%M:%S')
     with doc.create(Section("Data Input", numbering=True)):
         with doc.create(Subsection("Statistics", numbering=False)):
             with doc.create(Itemize()) as itmize:
                 itmize.add_item("timestamp: %s" % st)
                 itmize.add_item('analyzed text: "%s"' %
                                 dta_holder["text_file"].split('/')[-1])
                 itmize.add_item("length of text: %s tokens" %
                                 len(dta_holder["tokenized_text"]))
                 # itmize.add_item("number of characters: %s" % len(dta_holder["characters"]))
                 characters_with_at_least_one_degree = 0
                 for degree_list in dta_holder["network_parameters"][3]:
                     if degree_list[1] != 0:
                         characters_with_at_least_one_degree += 1
                 itmize.add_item(
                     "number of characters (with at least one degree): %s" %
                     str(characters_with_at_least_one_degree))
         with doc.create(Subsection("Input parameters", numbering=False)):
             with doc.create(Itemize()) as itmize:
                 itmize.add_item("distance measure: %s" %
                                 dta_holder["parameter"][0])
                 itmize.add_item(
                     "context measure 1 (words before Character 1): %s" %
                     dta_holder["parameter"][1])
                 itmize.add_item(
                     "context measure 2 (words after Character 2): %s" %
                     dta_holder["parameter"][2])
Ejemplo n.º 2
0
    def write_prgramm_statments(self, doc):
        section1 = Section("rCat, v.0.1", numbering=False)
        section1.append(
            "This program is developed by Florian Barth and Evgeny Kim with the help of Roman Klinger and Sandra Murr. It is part of the Center for Reflected Text Analytics (CRETA) at the Universtiy of Stuttgart.\n\nFeel free to contact us:"
        )

        list = Itemize()
        list.add_item("*****@*****.**")

        section1.append(list)
        doc.append(section1)
Ejemplo n.º 3
0
def test_lists():
    # Lists
    itemize = Itemize()
    itemize.add_item(s="item")
    itemize.append("append")

    enum = Enumerate()
    enum.add_item(s="item")
    enum.append("append")

    desc = Description()
    desc.add_item(label="label", s="item")
    desc.append("append")
Ejemplo n.º 4
0
def generate_user_story(user_story: UserStory, locale: LocaleDictionary,
                        paragraph: Paragraph) -> Paragraph:
    with paragraph.create(Tabularx(table_spec="|X|X|",
                                   row_height="1.4")) as tabularx:
        tabularx: Tabularx

        definitions_of_done = Itemize()
        for definition_of_done in user_story.definitions_of_done:
            definitions_of_done.add_item(definition_of_done)
        comments = Itemize()
        for comment in user_story.comments:
            comments.add_item(comment)

        tabularx.add_row(
            [MultiColumn(2, data=bold(user_story.name), color="gray")])
        tabularx.add_row([f"{locale.as_user}: ", f"{locale.user_want}: "])
        tabularx.add_row([user_story.user, user_story.action])
        if user_story.description is not None:
            tabularx.add_row([
                MultiColumn(
                    2,
                    align=NoEscape("|p{\\rowWidth}|"),
                    data=[f"{locale.description}: ", user_story.description],
                    color="gray")
            ])
        if len(user_story.definitions_of_done) > 0:
            tabularx.add_row([
                MultiColumn(2,
                            align=NoEscape("|p{\\rowWidth}|"),
                            data=[
                                f"{locale.definition_of_done}: ",
                                definitions_of_done
                            ])
            ])
        if len(user_story.assignments) > 0:
            tabularx.add_row([
                MultiColumn(2,
                            align=NoEscape("|p{\\rowWidth}|"),
                            data=[
                                f"{locale.assignation}: ",
                                ", ".join(user_story.assignments)
                            ],
                            color="gray")
            ])
        tabularx.add_row([
            f"{locale.estimated_duration}: ",
            f"{user_story.estimated_duration:g} {locale.man_days} ({int(user_story.estimated_duration * 8)}"
            f" {locale.hours})"
        ])
        tabularx.add_row(
            [f"{locale.status}: ",
             user_story.status.translate(locale)])
        if len(user_story.comments) > 0:
            tabularx.add_row([
                MultiColumn(2,
                            align=NoEscape("|p{\\rowWidth}|"),
                            data=[f"{locale.comments}: ", comments],
                            color="gray")
            ])
    return paragraph
Ejemplo n.º 5
0
    def build_text_automatic(self, record):
        text = record[Constants.TEXT_FIELD]
        sentences = nlp_utils.get_sentences(text)
        lemmatized_words = []
        for sentence in sentences:
            lemmatized_words.append(nlp_utils.lemmatize_sentence(
                sentence, nltk.re.compile(''),
                min_length=1, max_length=100))

        doc_parts = []
        itemize = Itemize()

        for sentence in lemmatized_words:
            new_words = []
            itemize.add_item('')
            for tagged_word in sentence:
                tag = tagged_word[1]
                word = tagged_word[0]
                singular = pattern.text.en.singularize(word)
                word_found = False

                # if tag == 'VBD':
                #     new_words.append(
                #         '\\colorbox[rgb]{0.5,0.5,0.5}{' + word + '}')
                #     word_found = True
                #
                # if tag.startswith('PRP'):
                #     new_words.append(
                #         '\\colorbox[rgb]{0.85,0.85,0.85}{' + word + '}')
                #     word_found = True

                for topic_id in self.automatic_context_topic_ids:
                    if word in self.topic_words_map[topic_id]:
                    # if singular in context_words[Constants.ITEM_TYPE][topic]:
                        self.tag_word(word)
                        color_id = self.automatic_context_topic_colors[topic_id]
                        color = self.rgb_tuples[color_id]
                        new_words.append(
                            '\\colorbox[rgb]{' +
                            str(color[0]) + ',' + str(color[1]) + ',' +
                            str(color[2]) + '}{' + word + '}')
                        word_found = True
                        break
                if not word_found:
                    new_words.append(word)
            itemize.append(NoEscape(' '.join(new_words)))
        doc_parts.append(itemize)

        return doc_parts
def render(img_filepath, output_list):
    image_filename = img_filepath.split('/')[-1]
    cwd = os.getcwd() + '/' + output_list[2]
    shutil.copy2(img_filepath, cwd)

    #print(image_filename)

    geometry_options = {"tmargin": "1cm", "lmargin": "1cm"}
    doc = Document(geometry_options=geometry_options)
    #creates image section in LaTeX

    with doc.create(Section("Xcos")):
        with doc.create(Figure(position='h!')) as abs_pic:
            abs_pic.add_image(image_filename, width='450px')
            doc.append("\n\n\n")
    #creates Context section in LaTeX if context exists
    if output_list[1]:
        with doc.create(Subsection("Context")):
            with doc.create(Itemize()) as itemize:
                for data in output_list[1]:
                    itemize.add_item(data)
    #creates Block section in LaTeX
    with doc.create(Subsection("Blocks")):
        for i in output_list[0]:
            if i is not None:
                doc.append("\n\n\n")
                with doc.create(Tabular('|c|c|')) as table:
                    table.add_hline()
                    for key, value in i.parameters().items():
                        table.add_row(key, value)
                        table.add_hline()

    file_path = output_list[2] + '/' + output_list[2]
    doc.generate_pdf(file_path, clean_tex=False)
Ejemplo n.º 7
0
def format_latex(title, soup):
    # create document
    doc = Document()

    # set preamble
    doc.preamble.append(Command('title', title))
    doc.append(NoEscape(r'\maketitle'))

    # get the main content body
    main_content = soup.body.find('div').find('div')
    elements = main_content.find_all(True)

    # iterate over elements
    for ele in elements:
        if ele.name == 'h1':
            doc.append(Section(ele.text))
        elif ele.name == 'h2':
            doc.append(Subsection(ele.text))
        elif ele.name == 'h3':
            doc.append(Subsubsection(ele.text))
        elif ele.name == 'h4':
            doc.append(Paragraph(ele.text))
        elif ele.name == 'h5':
            doc.append(Subparagraph(ele.text))
        elif ele.name == 'p':
            doc.append(ele.text + '\n')
        elif ele.name == 'ul':
            with doc.create(Itemize()) as item:
                for li in ele.find_all('li'):
                    item.add_item(li.text)
        elif ele.name == 'ol':
            with doc.create(Enumerate()) as enum:
                for li in ele.find_all('li'):
                    enum.add_item(li.text)
        elif ele.name == 'img':
            with doc.create(Figure(position='h!')) as fig:
                # create tmp directory for images
                pathlib.Path('build/images').mkdir(parents=True, exist_ok=True)

                # check if source is using // shorthand for http://
                src = ele['src']
                if src.startswith('//'):
                    src = 'http:' + src

                # generate image path
                image_path = 'images/' + src.split('/')[-1]

                # retrieve image
                print('downloading image ' + src)
                headers = {'User-Agent': USER_AGENT}
                response = requests.get(src, stream=True, headers=headers)
                with open('build/' + image_path, 'wb') as f:
                    response.raw.decode_content = True
                    shutil.copyfileobj(response.raw, f)

                # append image
                fig.add_image(image_path)

    return doc
Ejemplo n.º 8
0
def comments(doc):
    """
    Add comments (bullet points).
    """
    with doc.create(Section('Comments', numbers=True)):
        with doc.create(Itemize()) as itemize:
            for bullet in bullet_list:
                itemize.add_item(bullet)
Ejemplo n.º 9
0
def test_lists():
    # Lists
    itemize = Itemize()
    itemize.add_item(s="item")
    itemize.append("append")
    repr(itemize)

    enum = Enumerate(enumeration_symbol=r"\alph*)", options={'start': 172})
    enum.add_item(s="item")
    enum.add_item(s="item2")
    enum.append("append")
    repr(enum)

    desc = Description()
    desc.add_item(label="label", s="item")
    desc.append("append")
    repr(desc)
Ejemplo n.º 10
0
def announcements(doc):
    with doc.create(Itemize()) as itemize:
        announcement = input("Annoucement Section: ")
        if announcement == 'y':
            while announcement == 'y':
                new_announcement = input("Announcement: ")
                itemize.add_item(str(new_announcement))
                announcement = input("More announcements: ")
            itemize.append(Command("ldots"))
Ejemplo n.º 11
0
    def _document_test_result(self) -> None:
        """Document test results including test summary, passed tests, and failed tests.
        """
        self.test_id = 1
        instance_pass_tests, aggregate_pass_tests, instance_fail_tests, aggregate_fail_tests = [], [], [], []

        for test in self.json_summary["tests"]:
            if test["test_type"] == "per-instance" and test["passed"]:
                instance_pass_tests.append(test)
            elif test["test_type"] == "per-instance" and not test["passed"]:
                instance_fail_tests.append(test)
            elif test["test_type"] == "aggregate" and test["passed"]:
                aggregate_pass_tests.append(test)
            elif test["test_type"] == "aggregate" and not test["passed"]:
                aggregate_fail_tests.append(test)

        with self.doc.create(Section("Test Summary")):
            with self.doc.create(Itemize()) as itemize:
                itemize.add_item(
                    escape_latex("Execution time: {:.2f} seconds".format(
                        self.json_summary['execution_time(s)'])))

            with self.doc.create(Table(position='H')) as table:
                table.append(NoEscape(r'\refstepcounter{table}'))
                self._document_summary_table(
                    pass_num=len(instance_pass_tests) +
                    len(aggregate_pass_tests),
                    fail_num=len(instance_fail_tests) +
                    len(aggregate_fail_tests))

        if instance_fail_tests or aggregate_fail_tests:
            with self.doc.create(Section("Failed Tests")):
                if len(aggregate_fail_tests) > 0:
                    with self.doc.create(Subsection("Failed Aggregate Tests")):
                        self._document_aggregate_table(
                            tests=aggregate_fail_tests)
                if len(instance_fail_tests) > 0:
                    with self.doc.create(
                            Subsection("Failed Per-Instance Tests")):
                        self._document_instance_table(
                            tests=instance_fail_tests,
                            with_id=bool(self.data_id))

        if instance_pass_tests or aggregate_pass_tests:
            with self.doc.create(Section("Passed Tests")):
                if aggregate_pass_tests:
                    with self.doc.create(Subsection("Passed Aggregate Tests")):
                        self._document_aggregate_table(
                            tests=aggregate_pass_tests)
                if instance_pass_tests:
                    with self.doc.create(
                            Subsection("Passed Per-Instance Tests")):
                        self._document_instance_table(
                            tests=instance_pass_tests,
                            with_id=bool(self.data_id))

        self.doc.append(NoEscape(r'\newpage'))  # For QMS report
Ejemplo n.º 12
0
def display(ap, doc):
    properties, effects = analyze(ap)
    with doc.create(Subsection(ap['name'])):
        doc.append('Definition:')
        with doc.create(Itemize(options='noitemsep')) as itemize:
            if 'url' in ap:
                itemize.add_item('url: {}'.format(ap['url']))
            itemize.add_item('floor: {}'.format(ap['floor']))
            itemize.add_item('starting price: {:.2f} Mkr'.format(
                ap['startPrice'] / 1e6))
            if 'booliEstimate' in ap:
                itemize.add_item('Booli estimated price: {:.2f} Mkr'.format(
                    ap['booliEstimate'] / 1e6))
            itemize.add_item('fee: {:.0f} kr/month'.format(ap['fee']))
            ma = Math(inline=True, escape=False)
            ma.append('\\text{{area: }} {:.0f}\\,\\mathrm{{m}}^2'.format(
                ap['area']))
            itemize.add_item(ma)
            itemize.add_item(
                'commute time: {:.0f} min of which {:.0f} min is walking. Frequency every {:.0f} min.'
                .format(ap['commuteTime'], ap['commuteWalkTime'],
                        ap['commutePeriod']))

        doc.append('Results:')
        with doc.create(Itemize(options='noitemsep')) as itemize:
            itemize.add_item('interest: {:.1%}'.format(properties['interest']))
            itemize.add_item('amortization: {:.1%}'.format(
                properties['amortization']))
            itemize.add_item(
                'monthly cost: {a:.0f} kr/month (incl. amortization)'.format(
                    a=properties['monthlyCost']))
        # print('m2 price: {p:.0f}% of local market value'.format(p=100*ap['price']/(ap['area']*m2Price[ap['location']])))
        # print('Effective commute time: ',effectiveCommuteTime,' min')
        # print('Monthly apartment bill:',monthlyPrice)
        doc.append('Value breakdown:\n')
        with doc.create(Center()) as centered:
            with centered.create(Tabular('l|r')) as table:
                tot = 0
                for e in effects:
                    table.add_row((e, '{p}{v:.0f} kr/month'.format(
                        k=e, v=effects[e], p='+' if effects[e] > 0 else '')))
                    tot += effects[e]
                table.add_hline()
                table.add_row(('TOTAL', '{t:.0f} kr/month'.format(t=tot)))
Ejemplo n.º 13
0
def comments(doc):
    """
    Add comments (bullet points).
    """
    with doc.create(Section('Comments', numbers=True)):
        with doc.create(Itemize()) as itemize:
            itemize.add_item(bullet_1)
            itemize.add_item(bullet_2)
            itemize.add_item(bullet_3)
            itemize.add_item(bullet_4)
Ejemplo n.º 14
0
def auto_comments(doc):
    """
    Loop through bullets_std and add them to list.
    """
    with doc.create(Section('Comments', numbers=True)):
        with doc.create(Itemize()) as itemize:
            for s in bullets_std:
                itemize.add_item(s)
            for s in bullets_nstd:
                itemize.add_item(s)
Ejemplo n.º 15
0
def run_business(doc, type_of_business="Old Business"):
    business_section = input("More " + type_of_business + ": ")
    while business_section == 'y':
        add_business(doc)
        move_section = input("More motions? ")

        with doc.create(Itemize()) as itemize:

            while move_section == 'y':
                itemize.add_item(move(doc))
                move_section = input("More motions? ")
            itemize.append(Command("ldots"))
        business_section = input("More " + type_of_business + ": ")
Ejemplo n.º 16
0
def add_message_to_doc(doc, message):
    att_queryset = message.foiattachment_set.filter(
        is_redacted=False,
        is_converted=False
    )

    with doc.create(Description()) as descr:
        descr.add_item(str(_('From:')), message.real_sender)
        descr.add_item(str(_('To:')), message.get_text_recipient())
        descr.add_item(str(_('Date:')),
            formats.date_format(message.timestamp, "DATETIME_FORMAT"))
        descr.add_item(str(_('Via:')), message.get_kind_display())
        descr.add_item(str(_('URL:')), message.get_accessible_link())
        descr.add_item(str(_('Subject:')), message.subject)
        if len(att_queryset):
            itemize = Itemize()
            for att in att_queryset:
                itemize.add_item(att.name)
            descr.add_item(str(_('Attachments:')), itemize)

    doc.append(NoEscape('\\noindent\\makebox[\\linewidth]{\\rule{\\textwidth}{1pt}}'))
    doc.append(LineBreak())
    append_text(doc, message.plaintext)
Ejemplo n.º 17
0
def add_message_to_doc(doc, message):
    att_queryset = message.foiattachment_set.filter(
        is_redacted=False,
        is_converted=False
    )

    with doc.create(Description()) as descr:
        descr.add_item(str(_('From:')), message.real_sender)
        descr.add_item(str(_('To:')), message.get_text_recipient())
        descr.add_item(str(_('Date:')),
            formats.date_format(message.timestamp, "DATETIME_FORMAT"))
        descr.add_item(str(_('Via:')), message.get_kind_display())
        descr.add_item(str(_('URL:')), message.get_accessible_link())
        descr.add_item(str(_('Subject:')), message.subject)
        if len(att_queryset):
            itemize = Itemize()
            for att in att_queryset:
                itemize.add_item(att.name)
            descr.add_item(str(_('Attachments:')), itemize)

    doc.append(NoEscape('\\noindent\\makebox[\\linewidth]{\\rule{\\textwidth}{1pt}}'))
    doc.append(LineBreak())
    append_text(doc, message.plaintext)
Ejemplo n.º 18
0
 def _document_sys_config(self) -> None:
     """Add a system config summary to the traceability document.
     """
     with self.doc.create(Section("System Config")):
         with self.doc.create(Itemize()) as itemize:
             itemize.add_item(
                 escape_latex(f"FastEstimator {fe.__version__}"))
             itemize.add_item(
                 escape_latex(f"Python {platform.python_version()}"))
             itemize.add_item(escape_latex(f"OS: {sys.platform}"))
             itemize.add_item(
                 f"Number of GPUs: {torch.cuda.device_count()}")
             if fe.fe_deterministic_seed is not None:
                 itemize.add_item(
                     escape_latex(
                         f"Deterministic Seed: {fe.fe_deterministic_seed}"))
         with self.doc.create(LongTable('|lr|', pos=['h!'],
                                        booktabs=True)) as tabular:
             tabular.add_row((bold("Module"), bold("Version")))
             tabular.add_hline()
             tabular.end_table_header()
             tabular.add_hline()
             tabular.add_row((MultiColumn(2,
                                          align='r',
                                          data='Continued on Next Page'), ))
             tabular.add_hline()
             tabular.end_table_footer()
             tabular.end_table_last_footer()
             color = True
             for name, module in humansorted(sys.modules.items(),
                                             key=lambda x: x[0]):
                 if "." in name:
                     continue  # Skip sub-packages
                 if name.startswith("_"):
                     continue  # Skip private packages
                 if isinstance(module, Base):
                     continue  # Skip fake packages we mocked
                 if hasattr(module, '__version__'):
                     tabular.add_row(
                         (escape_latex(name),
                          escape_latex(str(module.__version__))),
                         color='black!5' if color else 'white')
                     color = not color
                 elif hasattr(module, 'VERSION'):
                     tabular.add_row((escape_latex(name),
                                      escape_latex(str(module.VERSION))),
                                     color='black!5' if color else 'white')
                     color = not color
Ejemplo n.º 19
0
 def assinatura_tecnicos(self, profissionais):
     with self.create(Itemize()) as itemize:
         itemize.add_item(bold("Elaborado em,"))
         itemize.append(Command("vfill"))
         itemize.append(Command("centerline", "DataAtual: 11/12/2018"))
         itemize.append(Command("vfill"))
         itemize.add_item(bold("Visto, Revisado e Aprovado em, "))
         itemize.append(Command("vfill"))
         with itemize.create(MiniPage(align='c')):
             itemize.append("Data Ontem: 21/12/2018")
         itemize.append(Command("vfill"))
         with itemize.create(MiniPage(align='c')):
             carimbo = r"".join("-" * 40) + r"\\{}\\{}\\{}".format(
                 profissionais[0]['nome'], profissionais[0]['titulo'],
                 profissionais[0]['numConselho'])
             itemize.append(Command("textsc", NoEscape(carimbo)))
Ejemplo n.º 20
0
def fill_document(doc):
    """Add a section, a subsection and some text to the document.

    :param doc: the document
    :type doc: :class:`pylatex.document.Document` instance
    """
    with doc.create(Section('Details of Original Notes')):
        doc.append('Word count: ')
        doc.append(italic('something'))

        with doc.create(Subsection('Key Words')):
            with doc.create(Itemize()) as itemize:
                itemize.add_item("the first item")
                itemize.add_item("the second item")
                itemize.add_item("the third etc")
                # you can append to existing items
                itemize.append(Command("ldots"))
Ejemplo n.º 21
0
    def add_list(self, lists, type=1):
        """ 添加列表

        :param list lists: 列表名称
        :param int type: 列表类型
        :return: 无返回值
        """
        if type == 1:
            items = Itemize()
        elif type == 2:
            items = Enumerate()
        elif type == 3:
            items = Description()
        else:
            items = Itemize()
        for item in lists:
            items.add_item(item)

        self.doc.append(items)
Ejemplo n.º 22
0
def do():
    doc = Document()

    # create a bulleted "itemize" list like the below:
    # \begin{itemize}
    #   \item The first item
    #   \item The second item
    #   \item The third etc \ldots
    # \end{itemize}

    with doc.create(Section('"Itemize" list')):
        with doc.create(Itemize()) as itemize:
            itemize.add_item("the first item")
            itemize.add_item("the second item")
            itemize.add_item("the third etc")
            # you can append to existing items
            itemize.append(Command("ldots"))

    # create a numbered "enumerate" list like the below:
    # \begin{enumerate}
    #   \item The first item
    #   \item The second item
    #   \item The third etc \ldots
    # \end{enumerate}

    with doc.create(Section('"Enumerate" list')):
        with doc.create(Enumerate()) as enum:
            enum.add_item("the first item")
            enum.add_item("the second item")
            enum.add_item(NoEscape("the third etc \\ldots"))

    # create a labelled "description" list like the below:
    # \begin{description}
    #   \item[First] The first item
    #   \item[Second] The second item
    #   \item[Third] The third etc \ldots
    # \end{description}

    with doc.create(Section('"Description" list')):
        with doc.create(Description()) as desc:
            desc.add_item("First", "The first item")
            desc.add_item("Second", "The second item")
            desc.add_item("Third", NoEscape("The third etc \\ldots"))

    doc.generate_pdf('lists', clean_tex=False)
Ejemplo n.º 23
0
def test_lists():
    # Lists
    itemize = Itemize()
    itemize.add_item(s="item")
    itemize.append("append")

    enum = Enumerate()
    enum.add_item(s="item")
    enum.append("append")

    desc = Description()
    desc.add_item(label="label", s="item")
    desc.append("append")
Ejemplo n.º 24
0
    def build_text_automatic(self, record):
        text = record[Constants.TEXT_FIELD]
        sentences = nlp_utils.get_sentences(text)
        lemmatized_words = []
        for sentence in sentences:
            lemmatized_words.append(
                nlp_utils.lemmatize_sentence(sentence,
                                             nltk.re.compile(''),
                                             min_length=1,
                                             max_length=100))

        doc_parts = []
        itemize = Itemize()

        for sentence in lemmatized_words:
            new_words = []
            itemize.add_item('')
            for tagged_word in sentence:
                tag = tagged_word[1]
                word = tagged_word[0]
                singular = pattern.text.en.singularize(word)
                word_found = False

                # if tag == 'VBD':
                #     new_words.append(
                #         '\\colorbox[rgb]{0.5,0.5,0.5}{' + word + '}')
                #     word_found = True
                #
                # if tag.startswith('PRP'):
                #     new_words.append(
                #         '\\colorbox[rgb]{0.85,0.85,0.85}{' + word + '}')
                #     word_found = True

                for topic_id in self.automatic_context_topic_ids:
                    if word in self.topic_words_map[topic_id]:
                        # if singular in context_words[Constants.ITEM_TYPE][topic]:
                        self.tag_word(word)
                        color_id = self.automatic_context_topic_colors[
                            topic_id]
                        color = self.rgb_tuples[color_id]
                        new_words.append('\\colorbox[rgb]{' + str(color[0]) +
                                         ',' + str(color[1]) + ',' +
                                         str(color[2]) + '}{' + word + '}')
                        word_found = True
                        break
                if not word_found:
                    new_words.append(word)
            itemize.append(NoEscape(' '.join(new_words)))
        doc_parts.append(itemize)

        return doc_parts
Ejemplo n.º 25
0
def test_lists():
    # Lists
    itemize = Itemize()
    itemize.add_item(s="item")
    itemize.append("append")
    repr(itemize)

    empty_itemize = Itemize()
    assert empty_itemize.dumps() == ''
    repr(empty_itemize)

    enum = Enumerate()
    enum.add_item(s="item")
    enum.append("append")
    repr(enum)

    desc = Description()
    desc.add_item(label="label", s="item")
    desc.append("append")
    repr(desc)
Ejemplo n.º 26
0
def test_lists():
    # Lists
    itemize = Itemize()
    itemize.add_item(s="item")
    itemize.append("append")
    repr(itemize)

    enum = Enumerate(enumeration_symbol=r"\alph*)", options={'start': 172})
    enum.add_item(s="item")
    enum.add_item(s="item2")
    enum.append("append")
    repr(enum)

    desc = Description()
    desc.add_item(label="label", s="item")
    desc.append("append")
    repr(desc)
 def write_introduction(self):
     with self.doc.create(Section('Introduction', numbering=False)):
         self.doc.append(
             'This monthly report aims to extract useful and meaningful information from the HF radar'
             ' data using qualitative and quantitative data analysis methods. The document is'
             ' automatically generated based on the information available in the THREDDS Data Server'
             ' (TDS) Catalog for the HF Radar managed by SOCIB.')
         self.doc.append('Automatic data processing includes:')
         with self.doc.create(Itemize()) as itemize:
             itemize.add_item(
                 'Monthly means of the direction vectors, statistics (time series and data tables)'
             )
             itemize.add_item(
                 NoEscape(
                     r'Comparisons of the horizontal current components derived from HF radar and'
                     r' the pointwise subsurface currents from the current-meter (1.5 m) deployed'
                     r' in the Ibiza Channel (at location 38$^{\circ}$49.46$^\prime$N and'
                     r' 0$^{\circ}$47.02$^\prime$W), which allow us to evaluate the radar'
                     r' performance and identify temporal periods or malfunctioning of the radar'
                     r' (or the current-meter).'))
             itemize.add_item(
                 'Note that figures are using the oceanographic convention (currents pointing in the'
                 ' direction the flow is toward). ')
Ejemplo n.º 28
0
def generate_work_report_page(schema: PLDSchema, locale: LocaleDictionary,
                              document: Document) -> Document:
    authors_user_stories = dict()
    for deliverable in schema.deliverables:
        for subset in deliverable.subsets:
            for user_story in subset.user_stories:
                for author in user_story.assignments:
                    for saved_author in schema.authors:
                        if author in saved_author:
                            if saved_author in authors_user_stories:
                                authors_user_stories[saved_author].append(
                                    user_story)
                            else:
                                authors_user_stories[saved_author] = [
                                    user_story
                                ]
    document.append(Command("setcounter", "secnumdepth", extra_arguments="0"))
    document.append(NewPage())
    with document.create(Section(title=locale.advancement_report)) as section:
        section: Section

        for author, user_stories in authors_user_stories.items():
            user_stories = sorted(user_stories,
                                  key=get_user_story_priority,
                                  reverse=True)
            with section.create(Subsection(title=author)) as subsection:
                subsection: Subsection

                with subsection.create(Itemize()) as itemize:
                    itemize: Itemize

                    for user_story in user_stories:
                        itemize.add_item(
                            f"{user_story.status.translate(locale)}: {user_story.name}"
                        )
    return document
Ejemplo n.º 29
0
def make_personal(doc, image=False):
    """Write up the personal data header
    """

    # doc.append(Command('hrule'))
    # doc.append(VerticalSpace("-5pt"))
    if image:
        with doc.create(MiniPage(width=r"0.45\textwidth")):
            # with doc.create(Figure()) as profil:
            doc.append(Command("centering"))
            doc.append(Command("includegraphics", PROFIL, "width=200pt"))

    with doc.create(MiniPage(width=r"0.6\textwidth")):
        with doc.create(Section(data['personal']['name'])):
            # doc.append(VerticalSpace("-3pt"))
            with doc.create(
                    Itemize(options=[
                        'align=parleft', 'leftmargin=2.25cm', 'labelwidth=2cm'
                    ])):
                # doc.append(Command("hrule"))
                doc.append(NoEscape("\\item[Phone]"))
                doc.append(phone_format(data['personal']['phone']))
                doc.append(NoEscape("\\item[Email]"))
                doc.append(Command("url", data['personal']['email'][0]))
                # doc.append(Command("url",data['personal']['email'][1]))
                doc.append(NoEscape("\\item[Website]"))
                doc.append(Command("url", data['personal']['website']))
                doc.append(NoEscape("\\item[Address]"))
                doc.append(NoEscape(",\\\\".join(data['personal']['address'])))
                doc.append(NoEscape("\\item[Birth]"))
                b = data['personal']['birth']
                birth = f"{b['day']} {b['month']['name']} {b['year']}"
                doc.append(NoEscape(birth + f", {b['city']}, {b['country']}"))

    # doc.append(Command('hrule'))
    doc.append(Command("hfill"))
Ejemplo n.º 30
0
    def add_list(self,lists,type=1):
        """ 添加列表

        :param list lists: 列表名称
        :param int type: 列表类型
        :return: 无返回值
        """
        if type == 1:
            items = Itemize()
        elif type == 2:
            items = Enumerate()
        elif type == 3:
            items = Description()
        else:
            items = Itemize()
        for item in lists:
            items.add_item(item)

        self.doc.append(items)
Ejemplo n.º 31
0
a = Axis(data=None, options=None)

p = Plot(name=None, func=None, coordinates=None, options=None)

# Utils
escape_latex(s='')

fix_filename(path='')

dumps_list(l=[], escape=False, token='\n')

bold(s='')

italic(s='')

verbatim(s='', delimiter='|')

# Lists
itemize = Itemize()
itemize.add_item(s="item")
itemize.append("append")

enum = Enumerate()
enum.add_item(s="item")
enum.append("append")

desc = Description()
desc.add_item(label="label", s="item")
desc.append("append")
Ejemplo n.º 32
0
def writeEntry(doc, item, curr, prev):

    e = curr
    if prev:
        # this selects which repeated keys to be removed:
        if curr['employer'] == prev['employer']:
            e['employer'] = ''
        if curr['location'] == prev['location']:
            e['location'] = ''

        # # this removes all repeated. comment-out if wanted
        # for (c_k, c_v), (p_k, p_v) in zip(curr.items(),prev.items()):
        #     if c_v == p_v:
        #         e[c_k] = ''

    dates = e['dates']
    title = e['title']
    employer = e['employer']
    description = e['description']
    location = e['location']
    year = e['year']
    subheader = e['subheader']
    narrative = e['narrative']

    if title and title[-1] == ".":
        title[:-2]
    if employer and employer[-1] == ".":
        employer[:-2]
    if description and description[-1] == ".":
        description[:-2]
    if location and location[-1] == ".":
        location[:-2]

    with doc.create(
            Itemize(options=[
                'align=parleft', 'leftmargin=2.25cm', 'labelwidth=2cm'
            ])):
        doc.append(NoEscape("\\item[" + item + "]"))

        if 'ongoing' in dates:
            doc.append(bold(title))
            doc.append("(ongoing). ")
        else:
            doc.append(bold(title + "."))

        if employer and subheader != employer:
            doc.append(employer + ". ")

        if description:
            # remove my name from the description if i'm the only one there...
            fd = "Federico Camara Halac"
            if fd != description and len(description) != len(fd):
                doc.append(description + ". ")

        if location:
            doc.append(location + ". ")

        if 'ongoing' not in dates and dates != year:
            doc.append(dates + ".")

        if NARRATIVE and narrative:
            with doc.create(Quote()):
                doc.append(narrative)
Ejemplo n.º 33
0
                    doc.append(Command("pagebreak"))
                # end subsection loop
                doc.append(VerticalSpace(NoEscape("-2pt")))
            # end subsections
        # end sections
        with doc.create(Section("Other Skills")):
            doc.append(Command('hrule'))

            for k, v in data['skills'].items():
                with doc.create(
                        MiniPage(width=NoEscape(r"0.33\textwidth"),
                                 pos='t',
                                 align='l')) as mp:
                    with mp.create(Subsection(k.title())):
                        # mp.append(VerticalSpace(NoEscape("-2pt")))
                        with mp.create(Itemize()):
                            for i in v:
                                mp.append(Command('item'))
                                if 'Latex' in i['item']:
                                    mp.append(Command("LaTeX"))
                                else:
                                    mp.append(bold(i['item']))
                                if i['description']:
                                    mp.append(": " + i['description'])
                                # mp.append(VerticalSpace(NoEscape("-2pt")))
                            mp.append(LineBreak())

            # with doc.create(Subsection("Languages")):
            #     with doc.create(Itemize(options=[
            #             'align=parleft',
            #             'leftmargin=2.25cm',
Ejemplo n.º 34
0
# More info @ http://en.wikibooks.org/wiki/LaTeX/List_Structures
from pylatex import Document, Section, Itemize, Enumerate, Description, \
    Command, NoEscape

if __name__ == '__main__':
    doc = Document()

    # create a bulleted "itemize" list like the below:
    # \begin{itemize}
    #   \item The first item
    #   \item The second item
    #   \item The third etc \ldots
    # \end{itemize}

    with doc.create(Section('"Itemize" list')):
        with doc.create(Itemize()) as itemize:
            itemize.add_item("the first item")
            itemize.add_item("the second item")
            itemize.add_item("the third etc")
            # you can append to existing items
            itemize.append(Command("ldots"))

    # create a numbered "enumerate" list like the below:
    # \begin{enumerate}
    #   \item The first item
    #   \item The second item
    #   \item The third etc \ldots
    # \end{enumerate}

    with doc.create(Section('"Enumerate" list')):
        with doc.create(Enumerate()) as enum:
Ejemplo n.º 35
0
    def write_netork_parameters(self, doc, dta_holder):
        with doc.create(Section("Network Parameters",
                                numbering=True)) as section1:
            section1.append(
                "Here you can get information about the network parameters.")
            with doc.create(Subsection("Definitions", numbering=False)):
                with doc.create(Itemize()) as definitions:
                    definitions.add_item(
                        "Average degree: The degree of a node is the number of edges connected to it. It measures the number of connections to other characters. Average degree is calculated\
                        on a probability of two nodes being connected.")
                    definitions.add_item(
                        "SD degree: Standard deviation of all degrees.")
                    definitions.add_item(
                        "Density: Graph density is the ratio of the number of edges to the number of possible edges."
                    )
                    definitions.add_item(
                        "Weighted degree: Sum of weights of incident edges. Measures the number of interactions of a character."
                    )
            with doc.create(
                    Subsection("Current network parameters", numbering=False)):
                with doc.create(Itemize()) as itmize:
                    itmize.add_item("average degree: %s" %
                                    dta_holder["network_parameters"][0])
                    itmize.add_item("sd degree: %s" %
                                    dta_holder["network_parameters"][1])
                    itmize.add_item("density: %s" %
                                    dta_holder["network_parameters"][2])
                # itmize.add_item("degrees for single characters: %s" %dta_holder["network_parameters"][3])

        # pdf_latex().write_table_degrees(doc, dta_holder)

        subsection1 = Subsection("Degrees", numbering=False)

        # table1 = Tabular('|c|c|c|c|')
        table1 = Tabular('|c|c|c|')

        table1.add_hline()
        table1.add_row(("Character (Node)", "degree", "weighted degree"))
        table1.add_hline()
        degree_list_weigthed_degree_tuple = zip(
            dta_holder["network_parameters"][3],
            dta_holder["network_parameters"][4])
        sorted_degree_list_weigthed_degree_tuple = sorted(
            degree_list_weigthed_degree_tuple,
            key=lambda x: x[1][1],
            reverse=True)
        #for degree_list, weigthed_degree_tuple in zip(dta_holder["network_parameters"][3],
        #                                              dta_holder["network_parameters"][4]):
        for degree_list, weigthed_degree_tuple in sorted_degree_list_weigthed_degree_tuple:
            if degree_list[0] == weigthed_degree_tuple[0]:
                table1.add_row(degree_list[0], degree_list[1],
                               weigthed_degree_tuple[1])
                table1.add_hline()
            else:
                print("characters for degree and weighted degree don't match!")

        subsection1.append(table1)
        doc.append(subsection1)

        subsection2 = Subsection("Weights for Edges", numbering=False)
        table2 = Tabular("|c|c|")
        table2.add_hline()
        table2.add_row("Character Pair (Edge)", "Weight")
        table2.add_hline()
        #print(dta_holder["character_relations"])
        sorted_relations = sorted(dta_holder["character_relations"],
                                  key=operator.itemgetter(4),
                                  reverse=True)
        #print(sorted_relations)
        #for relation in dta_holder["character_relations"]:
        for relation in sorted_relations[0:50]:
            if sorted_relations[4] != 0:
                table2.add_row("%s -- %s" % (relation[2][0], relation[2][1]),
                               len(relation[3]))
                table2.add_hline()

        subsection2.append(table2)
        doc.append(subsection2)
    def E_1(self):
        df_popis = read_excel('./konstrukce_input.xlsx',
                              sheet_name='Databaze_PKD')
        with doc.create(Section('Zhodnocení požární odolnosti konstrukcí')):
            SPB = self.RD.get_SPB()
            uniques = self.frame['Typ konstrukce'].unique().tolist()
            if 'E.1 PDK_Stěna' in uniques or 'E.1 PDK_Strop' in uniques:
                with doc.create(Subsection('Požárně dělící konstrukce')):
                    frame_choose = self.frame.loc[
                        self.frame['Typ konstrukce'].isin(
                            ['E.1 PDK_Stěna', 'E.1 PDK_Strop'])]
                with doc.create(Itemize()) as itemize:
                    for n in range(len(frame_choose['Typ konstrukce'])):
                        PDK_nadzem, PDK_podzem, PDK_posl, PDK_mezi = RD.get_odolnost(
                            SPB, self.frame['Typ konstrukce'][n], dict)
                        ozn = {
                            'Nadzemní podlaží': ['v NP', PDK_nadzem],
                            'Podzemní podlaží': ['v PP', PDK_podzem],
                            'Poslední nadzemní podlaží':
                            ['v posledním NP', PDK_posl],
                            'Mezi objekty': ['mezi objekty', PDK_mezi],
                        }
                        ozn_def = ozn.get(frame_choose['Pozn.'][n])[0]
                        token_need = self.token.get(
                            frame_choose['Typ konstrukce'][n])[1]
                        odolnost_need = int(
                            ozn.get(frame_choose['Pozn.'][n])[1][0])
                        druh_need = ozn.get(frame_choose['Pozn.'][n])[1][1]
                        itemize.add_item(
                            "Normový požadavek {} - {}.SPB - {} {} {}".format(
                                ozn_def, SPB, token_need, odolnost_need,
                                druh_need))
            for n in range(len(frame_choose['Typ konstrukce'])):
                doc.append(
                    NoEscape(r'\textbf{%s}: ' %
                             self.frame['Nazev konstrukce'][n]))
                popis = df_popis.loc[df_popis['Název'] ==
                                     self.frame['Specifikace'][n]]
                doplnit = ['y {} mm', 'e {} mm', 'a = {} mm', '{} D']
                adder = []
                counter = []
                for k in range(len(doplnit)):
                    if doplnit[k] in popis['Popis'].values[0]:
                        if doplnit[k] == 'y {} mm' or doplnit[k] == 'e {} mm':
                            adder.append(self.frame['b'].values[n])
                            counter.append(k)
                        if doplnit[k] == 'a = {} mm':
                            adder.append(self.frame['a / rho'].values[n])
                            counter.append(k)
                        if doplnit[k] == '{} D':
                            adder.append(self.frame['odolnost'].values[n])
                            counter.append(k)
                        else:
                            pass
                if len(adder) == 2:
                    text = popis['Popis'].values[0].format(adder[0], adder[1])
                if len(adder) == 3:
                    text = popis['Popis'].values[0].format(
                        adder[0], adder[1], adder[2])
                if len(adder) == 0:
                    text = popis['Popis'].values[0]
                doc.append(NoEscape(text))
                doc.append(NoEscape(r'\par'))

        doc.generate_pdf("E.1", clean_tex=False)
def E1_generator(soubor, cesta, data_konst, vystup_dir, data_dir):
    os.chdir(data_dir)
    data_PU = read_results('results.csv')
    info1 = read_results('raw_data_info.csv')
    podlazi = int(info1[2][0])
    info = info1[0][0]
    SPB_check = []
    n_uniques = []
    d = {'I.': 1, 'II.': 2, 'III.': 3, 'IV.': 4, 'V.': 5, 'VI.': 6, 'VII.': 7}
    e = {1: 'I.', 2: 'II.', 3: 'III.', 4: 'IV.', 5: 'V.', 6: 'VI.', 7: 'VII.'}
    check_PP = {
        'I.': 30,
        'II.': 45,
        'III.': 60,
        'IV.': 90,
        'V.': 120,
        'VI.': 180,
        'VII.': 180
    }
    check_NP = {
        'I.': 15,
        'II.': 30,
        'III.': 45,
        'IV.': 60,
        'V.': 90,
        'VI.': 120,
        'VII.': 180
    }
    for i in range(0, len(data_PU)):
        SPB_check.append(data_PU[i][6])
        n_uniques.append(data_PU[i][0])

    os.chdir(cesta)
    [Nazev_kce, Specif1, Specif2, b, a, h, Ly, Lx,
     zeb_a] = konst_data_prep('E.1 PKD_Stěna', data_konst)
    wb = openpyxl.load_workbook(soubor, data_only=True)
    Data_PKD = wb.get_sheet_by_name('Databaze_PKD')

    Name_data = []
    prep_data = []
    dim_row = Data_PKD.max_row  # determines maximum number of rows
    for row in Data_PKD.iter_rows(min_row=4,
                                  max_row=dim_row,
                                  min_col=1,
                                  max_col=1):
        for cell in row:
            Name_data.append(cell.value)
    for row in Data_PKD.iter_rows(min_row=4,
                                  max_row=dim_row,
                                  min_col=3,
                                  max_col=3):
        for cell in row:
            prep_data.append(cell.value)

    preidx = Name_data.index('Porotherm')
    Name_data_prep = Name_data[preidx:]
    Prep_data_text = prep_data[preidx:]
    Name_data = Name_data[:preidx]
    prep_data = prep_data[:preidx]

    dictionary = dict(zip(Name_data, prep_data))
    dictionary_text = dict(zip(Name_data_prep, Prep_data_text))
    with doc.create(Section('Zhodnocení požární odolnosti konstrukcí')):
        spb_val = []
        for i in range(0, len(SPB_check)):
            spb_val.append(d[SPB_check[i]])
        spb_max = max(spb_val)
        spb_max = e[spb_max]
        if spb_max == 'I.':
            if info == 'nehořlavý':
                with doc.create(Itemize()) as itemize:
                    itemize.add_item(
                        "Normový požadavek na požární stěny v NP - I.SPB - (R)EI 15 DP1"
                    )
                for i in range(0, len(n_uniques)):
                    if 'P' in n_uniques[i]:
                        itemize.add_item(
                            "Normový požadavek na požární stěny v PP - I.SPB - (R)EI 30 DP1"
                        )
                    break
                if podlazi > 1:
                    itemize.add_item(
                        "Normový požadavek na požární stěny v posledním NP - III.SPB - (R)EI 30 DP1"
                    )
        if spb_max == 'II.':
            with doc.create(Itemize()) as itemize:
                itemize.add_item(
                    "Normový požadavek na požární stěny v NP - II.SPB - (R)EI 30 DP1"
                )
        if spb_max == 'III.':
            if info == 'nehořlavý':
                with doc.create(Itemize()) as itemize:
                    itemize.add_item(
                        "Normový požadavek na požární stěny v NP - III.SPB - (R)EI 45 DP1"
                    )
                    for i in range(0, len(n_uniques)):
                        if 'P' == n_uniques[i][0]:
                            itemize.add_item(
                                "Normový požadavek na požární stěny v PP - III.SPB - (R)EI 60 DP1"
                            )
                        break
                if podlazi > 1:
                    itemize.add_item(
                        "Normový požadavek na požární stěny v posledním NP - III.SPB - (R)EI 30 DP1"
                    )
        if spb_max == 'IV.':
            with doc.create(Itemize()) as itemize:
                itemize.add_item(
                    "Normový požadavek na požární stěny v NP - IV.SPB - (R)EI 60 DP1"
                )
        if spb_max == 'V.':
            with doc.create(Itemize()) as itemize:
                itemize.add_item(
                    "Normový požadavek na požární stěny v NP - V.SPB - (R)EI 90 DP1"
                )
        if spb_max == 'VI.':
            with doc.create(Itemize()) as itemize:
                itemize.add_item(
                    "Normový požadavek na požární stěny v NP - VI.SPB - (R)EI 120 DP1"
                )
        if spb_max == 'VII.':
            with doc.create(Itemize()) as itemize:
                itemize.add_item(
                    "Normový požadavek na požární stěny v NP - VII.SPB - (R)EI 180 DP1"
                )

        save_var = []
        save_b = []
        for i in range(0, len(Specif2)):
            if Specif2[i] in dictionary:
                if Specif2[i] == 'ŽB. nenosné stěny':
                    '''TempName = Name_data.index(Specif2[i])
                    if TempName > 42:
                        doc.append(dictionary[Specif2[i]])'''
                    ''' Posouzení podle tab. 2.2 - nenosné stěny '''
                    # if 0 <= TempName < 2:
                    if b[i] < 60:
                        raise NameError('!!! Mimo rozsah tabulkek !!!')
                    if 60 <= b[i] < 70:
                        check = 30
                    if 70 <= b[i] < 80:
                        check = 45
                    if 80 <= b[i] < 100:
                        check = 60
                    if 100 <= b[i] < 120:
                        check = 90
                    if 120 <= b[i] < 150:
                        check = 120
                    if b[i] >= 150:
                        check = 180
                    token = 'železobetonovými nenosnými stěnami'
                    token_tab = '2.2'
                    token_type = 'EI'
                ''' Posouzení podle tabulky 2.3 - nosné stěny '''
                if Specif2[i] == 'ŽB. nosné stěny':
                    if b[i] < 120 and a[i] < 10:
                        raise NameError('!!! Mimo rozsah tabulkek !!!')
                    if 120 <= b[i] < 125 and a[i] < 25:
                        check = 30
                    if 125 <= b[i] < 130 and a[i] < 25:
                        check = 45
                    if (130 <= b[i] < 140 and a[i] < 25)\
                       or (b[i] > 140 and a[i] < 25):
                        check = 60
                    if 140 <= b[i] < 160 and 25 <= a[i] < 35\
                       or (b[i] > 160 and a[i] < 35):
                        check = 90
                    if 160 <= b[i] < 210 and 35 <= a[i] < 50\
                       or (b[i] > 210 and a[i] < 50):
                        check = 120
                    if b[i] >= 210 and a[i] >= 50:
                        check = 180
                    token = 'železobetonovými nosnými stěnami'
                    token_tab = '2.3'
                    token_type = 'REI'
                if Specif2[i] == 'Nenosné (všechny skupiny) – 500<p<2400':
                    top = [100, 100, 100, 140, 170, 190]
                    bottom = [70, 70, 70, 100, 140, 140]
                    interpolate = []
                    for n in range(0, len(top)):
                        intt = top[n] + (a[i] - 500) * ((bottom[n] - top[n]) /
                                                        (2400 - 500))
                        interpolate.append(intt)
                        if interpolate[n] - b[i] >= 0:
                            check_len = len(interpolate)
                            if check_len == 1:
                                check = 60
                            if check_len == 4:
                                check = 90
                            if check_len == 5:
                                check = 120
                            if check_len == 6:
                                check = 180
                            break
                        if len(interpolate) == 6:
                            interpolate.append(1)
                    token = 'z nenosných pálených cihel'
                    token_tab = '6.1.1'
                    token_type = 'EI'

                if Specif2[i] == 'Skupina 1S – 1000<p<2400':
                    interpolate = []
                    top = [90, 90, 90, 100, 140, 190]
                    bottom = [90, 90, 90, 90, 140, 140]
                    top_rho = 2400
                    bottom_rho = 1000
                    ' Vyzkoušení zda je rho v intervalu'
                    if a[i] > top_rho or a[i] < bottom_rho:
                        raise NameError('!!! Mimo rozsah tabulkek !!!')
                    for n in range(0, len(top)):
                        intt = top[n] + (a[i]-bottom_rho) *\
                               ((bottom[n]-top[n])/(top_rho-bottom_rho))
                        interpolate.append(intt)
                        myArr = np.asarray(interpolate)
                    check = cihlyPO(b, interpolate, i, myArr)
                    token = 'z pálených zdících prvků skupiny 1S'
                    token_tab = '6.1.2, číslo řádku 1.1 respektive 1.2'
                    token_type = 'REI'

                if Specif2[i] == 'Skupina 1 – 800<p<2400':
                    interpolate = []
                    top = [100, 100, 100, 170, 170, 190]
                    bottom = [90, 90, 90, 90, 140, 170]
                    top_rho = 2400
                    bottom_rho = 800
                    ' Vyzkoušení zda je rho v intervalu'
                    if a[i] > top_rho or a[i] < bottom_rho:
                        raise NameError('!!! Mimo rozsah tabulkek !!!')
                    for n in range(0, len(top)):
                        intt = top[n] + (a[i]-bottom_rho) *\
                               ((bottom[n]-top[n])/(top_rho-bottom_rho))
                        interpolate.append(intt)
                        myArr = np.asarray(interpolate)
                    check = cihlyPO(b, interpolate, i, myArr)
                    token = 'z pálených zdících prvků skupiny 1'
                    token_tab = '6.1.2, číslo řádku 2.1 respektive 2.2'
                    token_type = 'REI'

                if Specif2[i] == 'Skupina 1 – 500<p<800':
                    top = [100, 200, 200, 200, 365, 365]
                    bottom = [100, 170, 170, 170, 300, 300]
                    top_rho = 800
                    bottom_rho = 500
                    ' Vyzkoušení zda je rho v intervalu'
                    if a[i] > top_rho or a[i] < bottom_rho:
                        raise NameError('!!! Mimo rozsah tabulkek !!!')
                    for n in range(0, len(top)):
                        intt = top[n] + (a[i]-bottom_rho) *\
                               ((bottom[n]-top[n])/(top_rho-bottom_rho))
                        interpolate.append(intt)
                        myArr = np.asarray(interpolate)
                    check = cihlyPO(b, interpolate, i, myArr)
                    token = 'z pálených zdících prvků skupiny 1'
                    token_tab = '6.1.2, číslo řádku 2.3 respektive 2.4'
                    token_type = 'REI'

                if Specif2[i] == 'Skupina 2 – 800<p<2200, ct>25%':
                    interpolate = []
                    top = [100, 100, 100, 170, 240, 240]
                    bottom = [100, 100, 100, 140, 140, 240]
                    top_rho = 2200
                    bottom_rho = 800
                    ' Vyzkoušení zda je rho v intervalu'
                    if a[i] > top_rho or a[i] < bottom_rho:
                        raise NameError('!!! Mimo rozsah tabulkek !!!')
                    for n in range(0, len(top)):
                        intt = top[n] + (a[i]-bottom_rho) *\
                               ((bottom[n]-top[n])/(top_rho-bottom_rho))
                        interpolate.append(intt)
                        myArr = np.asarray(interpolate)
                    check = cihlyPO(b, interpolate, i, myArr)
                    token = 'z pálených zdících prvků skupiny 2'
                    token_tab = '6.1.2, číslo řádku 3.1 respektive 3.2'
                    token_type = 'REI'

                if Specif2[i] == 'Skupina 2 – 700<p<800, ct>25%':
                    interpolate = [100, 100, 170, 240, 300, 365]
                    top_rho = 800
                    bottom_rho = 700
                    ' Vyzkoušení zda je rho v intervalu'
                    if a[i] > top_rho or a[i] < bottom_rho:
                        raise NameError('!!! Mimo rozsah tabulkek !!!')
                    myArr = np.asarray(interpolate)
                    check = cihlyPO(b, interpolate, i, myArr)
                    token = 'z pálených zdících prvků skupiny 2'
                    token_tab = '6.1.2, číslo řádku 3.4'
                    token_type = 'REI'

                if Specif2[i] == 'Skupina 2 – 500<p<900, 16%<ct<25%':
                    interpolate = [100, 170, 170, 240, 300, 365]
                    top_rho = 900
                    bottom_rho = 500
                    ' Vyzkoušení zda je rho v intervalu'
                    if a[i] > top_rho or a[i] < bottom_rho:
                        raise NameError('!!! Mimo rozsah tabulkek !!!')
                    myArr = np.asarray(interpolate)
                    check = cihlyPO(b, interpolate, i, myArr)
                    token = 'z pálených zdících prvků skupiny 2'
                    token_tab = '6.1.2, číslo řádku 3.6'
                    token_type = 'REI'

                if Specif2[i] == 'Skupina 3 – 500<p<800':
                    interpolate = [100, 200, 240, 300, 365, 425]
                    top_rho = 1200
                    bottom_rho = 500
                    ' Vyzkoušení zda je rho v intervalu'
                    if a[i] > top_rho or a[i] < bottom_rho:
                        raise NameError('!!! Mimo rozsah tabulkek !!!')
                    myArr = np.asarray(interpolate)
                    check = cihlyPO(b, interpolate, i, myArr)
                    token = 'z pálených zdících prvků skupiny 3'
                    token_tab = '6.1.2, číslo řádku 4.2'
                    token_type = 'REI'

                if Specif2[i] == 'Skupina 4 – 500<p<800':
                    interpolate = [240, 240, 240, 300, 365, 425]
                    top_rho = 1200
                    bottom_rho = 500
                    ' Vyzkoušení zda je rho v intervalu'
                    if a[i] > top_rho or a[i] < bottom_rho:
                        raise NameError('!!! Mimo rozsah tabulkek !!!')
                    myArr = np.asarray(interpolate)
                    check = cihlyPO(b, interpolate, i, myArr)
                    token = 'z pálených zdících prvků skupiny 4'
                    token_tab = '6.1.2, číslo řádku 5.2'
                    token_type = 'REI'

                if Specif2[i] == 'Neznámé cihly':
                    interpolate = [240, 240, 240, 300, 365, 425]
                    top_rho = 1200
                    bottom_rho = 500
                    ' Vyzkoušení zda je rho v intervalu'
                    if a[i] > top_rho or a[i] < bottom_rho:
                        raise NameError('!!! Mimo rozsah tabulkek !!!')
                    myArr = np.asarray(interpolate)
                    check = cihlyPO(b, interpolate, i, myArr)
                    token = 'z pálených zdících prvků skupiny 4'
                    token_tab = '6.1.2, číslo řádku 5.2'
                    token_type = 'REI'

                if Specif2[i] == 'Vápenopískové (nenosné) 600<p<2400':
                    interpolate = []
                    top = [70, 90, 90, 100, 140, 170]
                    bottom = [50, 70, 70, 100, 140, 140]
                    top_rho = 2400
                    bottom_rho = 600
                    ' Vyzkoušení zda je rho v intervalu'
                    if a[i] > top_rho or a[i] < bottom_rho:
                        raise NameError('!!! Mimo rozsah tabulkek !!!')
                    for n in range(0, len(top)):
                        intt = top[n] + (a[i]-bottom_rho) *\
                               ((bottom[n]-top[n])/(top_rho-bottom_rho))
                        interpolate.append(intt)
                        myArr = np.asarray(interpolate)
                    check = cihlyPO(b, interpolate, i, myArr)
                    token = 'z nenosných vápenopískových cihel'
                    token_tab = '6.2.1, číslo řádku 1.1 respektive 1.2'
                    token_type = 'EI'

                if Specif2[i] == 'Vápenopískové – Skupina 1S – 1700<p<2400':
                    interpolate = []
                    top = [90, 90, 90, 100, 170, 170]
                    bottom = [90, 90, 90, 100, 140, 170]
                    top_rho = 2400
                    bottom_rho = 1700
                    ' Vyzkoušení zda je rho v intervalu'
                    if a[i] > top_rho or a[i] < bottom_rho:
                        raise NameError('!!! Mimo rozsah tabulkek !!!')
                    for n in range(0, len(top)):
                        intt = top[n] + (a[i]-bottom_rho) *\
                               ((bottom[n]-top[n])/(top_rho-bottom_rho))
                        interpolate.append(intt)
                        myArr = np.asarray(interpolate)
                    check = cihlyPO(b, interpolate, i, myArr)
                    token = 'z vápenopískových zdících prvků skupiny 1S'
                    token_tab = '6.2.2, číslo řádku 1.1 respektive 1.2'
                    token_type = 'REI'

                if Specif2[i] == 'Vápenopískové – Skupina 1 – 1400<p<2400':
                    interpolate = []
                    top = [100, 100, 100, 100, 200, 240]
                    bottom = [100, 100, 100, 100, 140, 190]
                    top_rho = 2400
                    bottom_rho = 1400
                    ' Vyzkoušení zda je rho v intervalu'
                    if a[i] > top_rho or a[i] < bottom_rho:
                        raise NameError('!!! Mimo rozsah tabulkek !!!')
                    for n in range(0, len(top)):
                        intt = top[n] + (a[i]-bottom_rho) *\
                               ((bottom[n]-top[n])/(top_rho-bottom_rho))
                        interpolate.append(intt)
                        myArr = np.asarray(interpolate)
                    check = cihlyPO(b, interpolate, i, myArr)
                    token = 'z vápenopískových zdících prvků skupiny 1'
                    token_tab = '6.2.2, číslo řádku 2.1 respektive 2.2'
                    token_type = 'REI'

                if Specif2[i] == 'Vápenopískové – Skupina 2 – 700<p<1600':
                    interpolate = []
                    top = [100, 100, 100, 100, 200, 240]
                    bottom = [100, 100, 100, 100, 140, 190]
                    top_rho = 1600
                    bottom_rho = 700
                    ' Vyzkoušení zda je rho v intervalu'
                    if a[i] > top_rho or a[i] < bottom_rho:
                        raise NameError('!!! Mimo rozsah tabulkek !!!')
                    for n in range(0, len(top)):
                        intt = top[n] + (a[i]-bottom_rho) *\
                               ((bottom[n]-top[n])/(top_rho-bottom_rho))
                        interpolate.append(intt)
                        myArr = np.asarray(interpolate)
                    check = cihlyPO(b, interpolate, i, myArr)
                    token = 'z vápenopískových zdících prvků skupiny 2'
                    token_tab = '6.2.2, číslo řádku 3.1 respektive 3.2'
                    token_type = 'REI'

                if Specif2[
                        i] == 'Beton nenosné skupina 1 pórovité kamenivo 400<p<1600':
                    interpolate = []
                    top = [50, 70, 90, 140, 140, 140]
                    bottom = [50, 50, 70, 70, 140, 140]
                    top_rho = 1600
                    bottom_rho = 400
                    ' Vyzkoušení zda je rho v intervalu'
                    if a[i] > top_rho or a[i] < bottom_rho:
                        raise NameError('!!! Mimo rozsah tabulkek !!!')
                    for n in range(0, len(top)):
                        intt = top[n] + (a[i]-bottom_rho) *\
                               ((bottom[n]-top[n])/(top_rho-bottom_rho))
                        interpolate.append(intt)
                        myArr = np.asarray(interpolate)
                    check = cihlyPO(b, interpolate, i, myArr)
                    token = 'z betonových tvárnic s pórovitým kamenivem skupiny 1'
                    token_tab = '6.3.1, číslo řádku 1.1 respektive 1.2'
                    token_type = 'EI'

                if Specif2[
                        i] == 'Beton nenosné skupina 1 hutné kamenivo 1400<p<2000':
                    interpolate = []
                    top = [50, 70, 90, 140, 140, 190]
                    bottom = [50, 50, 70, 70, 90, 100]
                    top_rho = 2400
                    bottom_rho = 1200
                    ' Vyzkoušení zda je rho v intervalu'
                    if a[i] > top_rho or a[i] < bottom_rho:
                        raise NameError('!!! Mimo rozsah tabulkek !!!')
                    for n in range(0, len(top)):
                        intt = top[n] + (a[i]-bottom_rho) *\
                               ((bottom[n]-top[n])/(top_rho-bottom_rho))
                        interpolate.append(intt)
                        myArr = np.asarray(interpolate)
                    check = cihlyPO(b, interpolate, i, myArr)
                    token = 'z betonových tvárnic s hutným kamenivem skupiny 1'
                    token_tab = '6.3.1, číslo řádku 1.3 respektive 1.4'
                    token_type = 'EI'

                if Specif2[
                        i] == 'Beton nenosné skupina 2 pórovité kamenivo 240<p<1200':
                    interpolate = []
                    top = [50, 70, 100, 100, 140, 200]
                    bottom = [50, 50, 70, 90, 140, 140]
                    top_rho = 1200
                    bottom_rho = 240
                    ' Vyzkoušení zda je rho v intervalu'
                    if a[i] > top_rho or a[i] < bottom_rho:
                        raise NameError('!!! Mimo rozsah tabulkek !!!')
                    for n in range(0, len(top)):
                        intt = top[n] + (a[i]-bottom_rho) *\
                               ((bottom[n]-top[n])/(top_rho-bottom_rho))
                        interpolate.append(intt)
                        myArr = np.asarray(interpolate)
                    check = cihlyPO(b, interpolate, i, myArr)
                    token = 'z betonových tvárnic s pórovitým kamenivem skupiny 2'
                    token_tab = '6.3.1, číslo řádku 2.1 respektive 2.2'
                    token_type = 'EI'

                if Specif2[
                        i] == 'Beton nenosné skupina 2 hutné kamenivo 720<p<1650':
                    interpolate = []
                    top = [50, 70, 100, 100, 200, 200]
                    bottom = [50, 50, 70, 70, 140, 140]
                    top_rho = 1650
                    bottom_rho = 720
                    ' Vyzkoušení zda je rho v intervalu'
                    if a[i] > top_rho or a[i] < bottom_rho:
                        raise NameError('!!! Mimo rozsah tabulkek !!!')
                    for n in range(0, len(top)):
                        intt = top[n] + (a[i]-bottom_rho) *\
                               ((bottom[n]-top[n])/(top_rho-bottom_rho))
                        interpolate.append(intt)
                        myArr = np.asarray(interpolate)
                    check = cihlyPO(b, interpolate, i, myArr)
                    token = 'z betonových tvárnic s hutným kamenivem skupiny 2'
                    token_tab = '6.3.1, číslo řádku 2.3 respektive 2.4'
                    token_type = 'EI'

                if Specif2[
                        i] == 'Beton nenosné skupina 3 hutné kamenivo 480<p<1000':
                    interpolate = [100, 150, 150, 200, 1000, 1000]
                    top_rho = 1000
                    bottom_rho = 480
                    ' Vyzkoušení zda je rho v intervalu'
                    if a[i] > top_rho or a[i] < bottom_rho:
                        raise NameError('!!! Mimo rozsah tabulkek !!!')
                    myArr = np.asarray(interpolate)
                    check = cihlyPO(b, interpolate, i, myArr)
                    token = 'z betonových tvárnic s hutným kamenivem skupiny 3'
                    token_tab = '6.3.1, číslo řádku 3.3'
                    token_type = 'EI'

                if Specif2[
                        i] == 'Beton nosné skupina 1 pórovité kamenivo 400<p<1600':
                    interpolate = []
                    top = [170, 170, 170, 170, 190, 240]
                    bottom = [140, 140, 140, 140, 170, 190]
                    top_rho = 1600
                    bottom_rho = 400
                    ' Vyzkoušení zda je rho v intervalu'
                    if a[i] > top_rho or a[i] < bottom_rho:
                        raise NameError('!!! Mimo rozsah tabulkek !!!')
                    for n in range(0, len(top)):
                        intt = top[n] + (a[i]-bottom_rho) *\
                               ((bottom[n]-top[n])/(top_rho-bottom_rho))
                        interpolate.append(intt)
                        myArr = np.asarray(interpolate)
                    check = cihlyPO(b, interpolate, i, myArr)
                    token = 'z betonových nosných tvárnic s pórovitým kamenivem skupiny 1'
                    token_tab = '6.3.2, číslo řádku 1.1 respektive 1.2'
                    token_type = 'REI'

                if Specif2[
                        i] == 'Beton nosné skupina 1 hutné kamenivo 1400<p<2000':
                    interpolate = []
                    top = [170, 170, 170, 170, 190, 240]
                    bottom = [140, 140, 140, 140, 170, 190]
                    top_rho = 2000
                    bottom_rho = 1400
                    ' Vyzkoušení zda je rho v intervalu'
                    if a[i] > top_rho or a[i] < bottom_rho:
                        raise NameError('!!! Mimo rozsah tabulkek !!!')
                    for n in range(0, len(top)):
                        intt = top[n] + (a[i]-bottom_rho) *\
                               ((bottom[n]-top[n])/(top_rho-bottom_rho))
                        interpolate.append(intt)
                        myArr = np.asarray(interpolate)
                    check = cihlyPO(b, interpolate, i, myArr)
                    token = 'z betonových nosných tvárnic s hutným kamenivem skupiny 1'
                    token_tab = '6.3.2, číslo řádku 1.3 respektive 1.4'
                    token_type = 'REI'

                if Specif2[
                        i] == 'Beton nosné skupina 2 pórovité kamenivo 240<p<1200':
                    interpolate = []
                    top = [170, 170, 170, 170, 190, 240]
                    bottom = [140, 140, 140, 140, 170, 190]
                    top_rho = 1200
                    bottom_rho = 240
                    ' Vyzkoušení zda je rho v intervalu'
                    if a[i] > top_rho or a[i] < bottom_rho:
                        raise NameError('!!! Mimo rozsah tabulkek !!!')
                    for n in range(0, len(top)):
                        intt = top[n] + (a[i]-bottom_rho) *\
                               ((bottom[n]-top[n])/(top_rho-bottom_rho))
                        interpolate.append(intt)
                        myArr = np.asarray(interpolate)
                    check = cihlyPO(b, interpolate, i, myArr)
                    token = 'z betonových nosných tvárnic s pórovitým kamenivem skupiny 2'
                    token_tab = '6.3.2, číslo řádku 2.1 respektive 2.2'
                    token_type = 'REI'

                if Specif2[
                        i] == 'Beton nosné skupina 2 hutné kamenivo 720<p<1650':
                    interpolate = []
                    top = [170, 170, 170, 170, 190, 240]
                    bottom = [140, 140, 140, 140, 170, 190]
                    top_rho = 1650
                    bottom_rho = 720
                    ' Vyzkoušení zda je rho v intervalu'
                    if a[i] > top_rho or a[i] < bottom_rho:
                        raise NameError('!!! Mimo rozsah tabulkek !!!')
                    for n in range(0, len(top)):
                        intt = top[n] + (a[i]-bottom_rho) *\
                               ((bottom[n]-top[n])/(top_rho-bottom_rho))
                        interpolate.append(intt)
                        myArr = np.asarray(interpolate)
                    check = cihlyPO(b, interpolate, i, myArr)
                    token = 'z betonových nosných tvárnic s hutným kamenivem skupiny 2'
                    token_tab = '6.3.2, číslo řádku 2.3 respektive 2.4'
                    token_type = 'REI'

                if Specif2[
                        i] == 'Beton nosné skupina 3 hutné kamenivo 480<p<1000':
                    interpolate = [140, 140, 140, 140, 200, 200]
                    top_rho = 1000
                    bottom_rho = 480
                    ' Vyzkoušení zda je rho v intervalu'
                    if a[i] > top_rho or a[i] < bottom_rho:
                        raise NameError('!!! Mimo rozsah tabulkek !!!')
                    myArr = np.asarray(interpolate)
                    check = cihlyPO(b, interpolate, i, myArr)
                    token = 'z betonových nosných tvárnic s hutným kamenivem skupiny 3'
                    token_tab = '6.3.2, číslo řádku 3.3'
                    token_type = 'REI'

                if Specif2[i] == 'Pórobeton nenosné skupina 1S a 1 350<p<500':
                    interpolate = []
                    top = [65, 70, 75, 100, 100, 150]
                    bottom = [50, 60, 60, 60, 90, 100]
                    top_rho = 500
                    bottom_rho = 350
                    ' Vyzkoušení zda je rho v intervalu'
                    if a[i] > top_rho or a[i] < bottom_rho:
                        raise NameError('!!! Mimo rozsah tabulkek !!!')
                    for n in range(0, len(top)):
                        intt = top[n] + (a[i]-bottom_rho) *\
                               ((bottom[n]-top[n])/(top_rho-bottom_rho))
                        interpolate.append(intt)
                        myArr = np.asarray(interpolate)
                    check = cihlyPO(b, interpolate, i, myArr)
                    token = 'z pórobetonových tvárnic'
                    token_tab = '6.4.1, číslo řádku 1.1 respektive 1.2'
                    token_type = 'EI'

                if Specif2[i] == 'Pórobeton nenosné skupina 1S a 1 500<p<1000':
                    interpolate = []
                    top = [60, 60, 70, 100, 100, 150]
                    bottom = [50, 60, 60, 60, 90, 100]
                    top_rho = 1000
                    bottom_rho = 500
                    ' Vyzkoušení zda je rho v intervalu'
                    if a[i] > top_rho or a[i] < bottom_rho:
                        raise NameError('!!! Mimo rozsah tabulkek !!!')
                    for n in range(0, len(top)):
                        intt = top[n] + (a[i]-bottom_rho) *\
                               ((bottom[n]-top[n])/(top_rho-bottom_rho))
                        interpolate.append(intt)
                        myArr = np.asarray(interpolate)
                    check = cihlyPO(b, interpolate, i, myArr)
                    token = 'z pórobetonových tvárnic'
                    token_tab = '6.4.1, číslo řádku 1.3 respektive 1.4'
                    token_type = 'EI'

                if Specif2[i] == 'Pórobeton nosné skupina 1S a 1 350<p<500':
                    interpolate = []
                    top = [115, 115, 140, 200, 225, 300]
                    bottom = [115, 115, 115, 200, 125, 240]
                    top_rho = 500
                    bottom_rho = 350
                    ' Vyzkoušení zda je rho v intervalu'
                    if a[i] > top_rho or a[i] < bottom_rho:
                        raise NameError('!!! Mimo rozsah tabulkek !!!')
                    for n in range(0, len(top)):
                        intt = top[n] + (a[i]-bottom_rho) *\
                               ((bottom[n]-top[n])/(top_rho-bottom_rho))
                        interpolate.append(intt)
                        myArr = np.asarray(interpolate)
                    check = cihlyPO(b, interpolate, i, myArr)
                    token = 'z nosných pórobetonových tvárnic'
                    token_tab = '6.4.2, číslo řádku 1.1 respektive 1.2'
                    token_type = 'REI'

                if Specif2[i] == 'Pórobeton nosné skupina 1S a 1 500<p<1000':
                    interpolate = []
                    top = [100, 100, 150, 170, 200, 240]
                    bottom = [100, 100, 100, 150, 170, 200]
                    top_rho = 1000
                    bottom_rho = 500
                    ' Vyzkoušení zda je rho v intervalu'
                    if a[i] > top_rho or a[i] < bottom_rho:
                        raise NameError('!!! Mimo rozsah tabulkek !!!')
                    for n in range(0, len(top)):
                        intt = top[n] + (a[i]-bottom_rho) *\
                               ((bottom[n]-top[n])/(top_rho-bottom_rho))
                        interpolate.append(intt)
                        myArr = np.asarray(interpolate)
                    check = cihlyPO(b, interpolate, i, myArr)
                    token = 'z nosných pórobetonových tvárnic'
                    token_tab = '6.4.2, číslo řádku 1.3 respektive 1.4'
                    token_type = 'REI'

            doc.append(NoEscape(r'\textbf{%s}: ' % Nazev_kce[i]))
            if Specif2[i] in dictionary_text:
                doc.append(dictionary_text[Specif2[i]])
            if 'PP' in Nazev_kce[i] or 'podzemní' in Nazev_kce[i]\
               or 'Podzemní' in Nazev_kce[i]:
                if check_PP[spb_max] > check:
                    raise NameError(
                        '!!! Konstrukce nevyhoví na požární odolnost !!!')
                else:
                    add_str = 'v podzemním podlaží'
            if 'NP' in Nazev_kce[i] or 'nadzemní' in Nazev_kce[i]\
               or 'Nadzemní' in Nazev_kce[i]:
                add_str = 'v nadzemním podlaží'
                if check_NP[spb_max] > check:
                    raise NameError(
                        '!!! Konstrukce nevyhoví na požární odolnost !!!')
                else:
                    if i != 0:
                        if b[i] in save_b and Specif2[i] in save_var:
                            doc.append(
                                'Požární stěny {} jsou stejně jako v podzemním podlaží tvořeny {} o tloušťce {} mm s vyhovující požární odolností {} {} DP1. '
                                .format(add_str, token, b[i], token_type,
                                        check))
                            doc.append(NoEscape(r'\newline \newline'))
            if i == 0 or (b[i] not in save_b and Specif2[i] not in save_var):
                if Specif2[i] == 'Neznámé cihly':
                    doc.append(
                        'Požární stěna je tvořena neznámým druhem pálených cihel. Stěna o tloušťce {} mm vykazuje dle tabulkového hodnocení tab: {} (Zoufal a spol.) i při uvažování cihel skupiny 4, tedyskupiny, která z požárního hlediska vykazuje nejhorší požární odolnost, vyhovující odolnost {} {} DP1. '
                        .format(b[i], token_tab, token_type, check))
                elif Specif2[i] in dictionary and Specif2[i] != 'Neznámé cihly':
                    doc.append(
                        'Požární stěny {} jsou tvořeny {} o tloušťce {} mm. Dle tabulkového hodnocení tab: {} (viz Zoufal a spol.) má konstrukce požární odolnost {} {} DP1, což je vyhovující. '
                        .format(add_str, token, b[i], token_tab, token_type,
                                check))
            doc.append(NoEscape(r'\newline \newline'))
            save_var.append(Specif2[i])
            save_b.append(b[i])
    os.chdir(vystup_dir)
    doc.generate_pdf("E.1", clean_tex=False)