Пример #1
0
def get_tikz_lines():
    """
    @param fs: user input
    @return: a sequence of tikz lines
    """
    arr = []
    # draw the matrix
    samples = interlacesample.get_samples()
    arr.extend(
        [
            "\\matrix{",
            get_tikz_pane(samples[0]),
            "&",
            get_tikz_pane(samples[1]),
            "&",
            get_tikz_pane(samples[2]),
            "\\\\",
            get_tikz_pane(samples[3]),
            "&",
            get_tikz_pane(samples[4]),
            "&",
            get_tikz_pane(samples[5]),
            "\\\\",
            get_tikz_pane(samples[6]),
            "&",
            get_tikz_pane(samples[7]),
            "&",
            get_tikz_pane(samples[8]),
            "\\\\};",
        ]
    )
    return arr
Пример #2
0
def get_tikz_lines():
    """
    @param fs: user input
    @return: a sequence of tikz lines
    """
    arr = []
    # define the tikzstyles for drawing the curve and the axes
    arr.extend(get_tikz_style_definitions())
    # draw the matrix
    samples = interlacesample.get_samples()
    arr.extend([
        '\\matrix{',
        get_tikz_pane(samples[0]),
        '&',
        get_tikz_pane(samples[1]),
        '&',
        get_tikz_pane(samples[2]),
        '\\\\',
        get_tikz_pane(samples[3]),
        '&',
        get_tikz_pane(samples[4]),
        '&',
        get_tikz_pane(samples[5]),
        '\\\\',
        get_tikz_pane(samples[6]),
        '&',
        get_tikz_pane(samples[7]),
        '&',
        get_tikz_pane(samples[8]),
        '\\\\};'])
    return arr
Пример #3
0
def get_tikz_lines(fs):
    """
    @param fs: user input
    @return: a sequence of tikz lines
    """
    arr = []
    # possibly import some colors from the beamer theme into the tikzpicture
    if fs.advanced_beamer_colors:
        arr.extend(["{\\usebeamercolor{palette sidebar tertiary}}", "{\\usebeamercolor{palette sidebar primary}}"])
    # determine the foreground and background colors
    if fs.black_and_white:
        bg = "white"
        fg_axis = "black"
        fg_main = "black"
    elif fs.advanced_beamer_colors:
        bg = "bg"
        fg_axis = "palette sidebar tertiary.fg"
        fg_main = "palette sidebar primary.fg"
    elif fs.basic_beamer_colors:
        bg = "bg"
        fg_axis = "fg"
        fg_main = "fg"
    else:
        raise ValueError
    # define the tikzstyles for drawing the curve and the axes
    arr.extend(get_tikz_style_definitions(bg, fg_axis, fg_main))
    # draw the matrix
    samples = interlacesample.get_samples()
    arr.extend(
        [
            "\\matrix{",
            get_tikz_pane(samples[0]),
            "&",
            get_tikz_pane(samples[1]),
            "&",
            get_tikz_pane(samples[2]),
            "\\\\",
            get_tikz_pane(samples[3]),
            "&",
            get_tikz_pane(samples[4]),
            "&",
            get_tikz_pane(samples[5]),
            "\\\\",
            get_tikz_pane(samples[6]),
            "&",
            get_tikz_pane(samples[7]),
            "&",
            get_tikz_pane(samples[8]),
            "\\\\};",
        ]
    )
    return arr
Пример #4
0
def main(args):
    for i, sample in enumerate(interlacesample.get_samples()):
        filename = os.path.join(args.outdir, 'sample-%04d.tikz' % i)
        with open(filename, 'w') as fout:
            print 'writing', filename
            arr = []
            # add the remark about the invocation of the generating script
            arr.append('% ' + ' '.join(sys.argv))
            # add the commands to define custom colors
            for name, rgb in color.wolfram_name_color_pairs:
                arr.append(tikz.define_color(name, rgb))
            # add the tikz drawing functions
            arr.append(get_tikz_pane(sample))
            # write the file
            print >> fout, '\n'.join(arr)
Пример #5
0
def main(args):
    for i, sample in enumerate(interlacesample.get_samples()):
        filename = os.path.join(args.outdir, 'sample-%04d.tikz' % i)
        with open(filename, 'w') as fout:
            print 'writing', filename
            arr = []
            # add the remark about the invocation of the generating script
            arr.append('% ' + ' '.join(sys.argv))
            # add the commands to define custom colors
            for name, rgb in color.wolfram_name_color_pairs:
                arr.append(tikz.define_color(name, rgb))
            # add the tikz drawing functions
            arr.append(get_tikz_pane(sample))
            # write the file
            print >> fout, '\n'.join(arr)
Пример #6
0
def main(args):
    for i, sample in enumerate(interlacesample.get_samples()):
        filename = os.path.join(args.outdir, "sample-%04d.tikz" % i)
        with open(filename, "w") as fout:
            print "writing", filename
            arr = []
            # add the remark about the invocation of the generating script
            arr.append("% " + " ".join(sys.argv))
            # add the commands to define custom colors
            for name, rgb in color.wolfram_name_color_pairs:
                arr.append(tikz.define_color(name, rgb))
            # add style definitions for the trees
            arr.extend(get_tikz_style_definitions())
            # add the tikz drawing functions
            arr.append(get_tikz_pane(sample, args.width, args.height))
            # write the file
            print >> fout, "\n".join(arr)
Пример #7
0
def get_tikz_lines(fs):
    """
    @param fs: user input
    @return: a sequence of tikz lines
    """
    arr = []
    # possibly import some colors from the beamer theme into the tikzpicture
    if fs.advanced_beamer_colors:
        arr.extend([
            '{\\usebeamercolor{palette sidebar tertiary}}',
            '{\\usebeamercolor{palette sidebar primary}}'
        ])
    # determine the foreground and background colors
    if fs.black_and_white:
        bg = 'white'
        fg_axis = 'black'
        fg_main = 'black'
    elif fs.advanced_beamer_colors:
        bg = 'bg'
        fg_axis = 'palette sidebar tertiary.fg'
        fg_main = 'palette sidebar primary.fg'
    elif fs.basic_beamer_colors:
        bg = 'bg'
        fg_axis = 'fg'
        fg_main = 'fg'
    else:
        raise ValueError
    # define the tikzstyles for drawing the curve and the axes
    arr.extend(get_tikz_style_definitions(bg, fg_axis, fg_main))
    # draw the matrix
    samples = interlacesample.get_samples()
    arr.extend([
        '\\matrix{',
        get_tikz_pane(samples[0]), '&',
        get_tikz_pane(samples[1]), '&',
        get_tikz_pane(samples[2]), '\\\\',
        get_tikz_pane(samples[3]), '&',
        get_tikz_pane(samples[4]), '&',
        get_tikz_pane(samples[5]), '\\\\',
        get_tikz_pane(samples[6]), '&',
        get_tikz_pane(samples[7]), '&',
        get_tikz_pane(samples[8]), '\\\\};'
    ])
    return arr
Пример #8
0
def main(args):
    for i, sample in enumerate(interlacesample.get_samples()):
        filename = os.path.join(args.outdir, "logo-%04d.tikz" % i)
        with open(filename, "w") as fout:
            print "writing", filename
            arr = []
            # add the remark about the invocation of the generating script
            arr.append("% " + " ".join(sys.argv))
            # add the commands to import beamer theme colors
            arr.extend(["{\\usebeamercolor{palette sidebar tertiary}}", "{\\usebeamercolor{palette sidebar primary}}"])
            # add the tikz style definitions
            bg = "bg"
            fg_main = "palette sidebar primary.fg"
            fg_axis = "palette sidebar tertiary.fg"
            arr.extend(get_tikz_style_definitions(bg, fg_axis, fg_main))
            # add the tikz drawing functions
            arr.append(get_tikz_pane(sample))
            # write the file
            print >> fout, "\n".join(arr)
Пример #9
0
def get_tikz_lines():
    """
    @param fs: user input
    @return: a sequence of tikz lines
    """
    arr = []
    # draw the matrix
    samples = interlacesample.get_samples()
    arr.extend([
        '\\matrix{',
        get_tikz_pane(samples[0]), '&',
        get_tikz_pane(samples[1]), '&',
        get_tikz_pane(samples[2]), '\\\\',
        get_tikz_pane(samples[3]), '&',
        get_tikz_pane(samples[4]), '&',
        get_tikz_pane(samples[5]), '\\\\',
        get_tikz_pane(samples[6]), '&',
        get_tikz_pane(samples[7]), '&',
        get_tikz_pane(samples[8]), '\\\\};'
    ])
    return arr
Пример #10
0
def main(args):
    for i, sample in enumerate(interlacesample.get_samples()):
        filename = os.path.join(args.outdir, 'logo-%04d.tikz' % i)
        with open(filename, 'w') as fout:
            print 'writing', filename
            arr = []
            # add the remark about the invocation of the generating script
            arr.append('% ' + ' '.join(sys.argv))
            # add the commands to import beamer theme colors
            arr.extend([
                '{\\usebeamercolor{palette sidebar tertiary}}',
                '{\\usebeamercolor{palette sidebar primary}}'
            ])
            # add the tikz style definitions
            bg = 'bg'
            fg_main = 'palette sidebar primary.fg'
            fg_axis = 'palette sidebar tertiary.fg'
            arr.extend(get_tikz_style_definitions(bg, fg_axis, fg_main))
            # add the tikz drawing functions
            arr.append(get_tikz_pane(sample))
            # write the file
            print >> fout, '\n'.join(arr)
Пример #11
0
def get_tikz_lines():
    """
    @param fs: user input
    @return: a sequence of tikz lines
    """
    arr = []
    # define the tikzstyles for drawing the curve and the axes
    arr.extend(get_tikz_style_definitions())
    # draw the matrix
    samples = interlacesample.get_samples()
    arr.extend([
        '\\matrix{',
        get_tikz_pane(samples[0]), '&',
        get_tikz_pane(samples[1]), '&',
        get_tikz_pane(samples[2]), '\\\\',
        get_tikz_pane(samples[3]), '&',
        get_tikz_pane(samples[4]), '&',
        get_tikz_pane(samples[5]), '\\\\',
        get_tikz_pane(samples[6]), '&',
        get_tikz_pane(samples[7]), '&',
        get_tikz_pane(samples[8]), '\\\\};'
    ])
    return arr