From 2974d9b2800318a345c8a71826471ab293f6d8c8 Mon Sep 17 00:00:00 2001 From: rddaz2013 Date: Fri, 13 Nov 2015 19:00:20 +0100 Subject: [PATCH 01/10] UpdatePython2.7 --- ch-intro/index.rst | 3 ++ extensions/natbib/__init__.py | 20 ++++----- extensions/natbib/latex_codec.py | 11 ++++- extensions/numfig.py | 9 ++++- extensions/oldPy.py | 69 ++++++++++++++++++++++++++++++++ 5 files changed, 100 insertions(+), 12 deletions(-) create mode 100644 extensions/oldPy.py diff --git a/ch-intro/index.rst b/ch-intro/index.rst index d701ea4..62c98aa 100644 --- a/ch-intro/index.rst +++ b/ch-intro/index.rst @@ -87,7 +87,10 @@ The following changes and additions have been made from vanilla Sphinx: * A singletext output that builds into a single text file, similar to singlehtml * A subfigure environment +Nov. 2015 adapting for Python 2.7 + Documents Using sphinxtr ======================== * `Jeff Terrace's PhD Thesis `_ + diff --git a/extensions/natbib/__init__.py b/extensions/natbib/__init__.py index 11601ce..78b7fa1 100644 --- a/extensions/natbib/__init__.py +++ b/extensions/natbib/__init__.py @@ -1,23 +1,23 @@ +import collections +import os +import re + +import pybtex.backends.plaintext +import pybtex.style.names.lastfirst +import pybtex.style.names.plain from docutils import nodes, transforms from docutils.parsers.rst import directives - +from oldPy import OrderedSet +from pybtex.database.input import bibtex from sphinx import addnodes from sphinx.domains import Domain, ObjType from sphinx.locale import l_, _ from sphinx.roles import XRefRole from sphinx.util.compat import Directive -from pybtex.database.input import bibtex -import pybtex.style.names.plain -import pybtex.style.names.lastfirst -import pybtex.backends.plaintext - -import collections import latex_codec -import os -import re -from backports import OrderedSet +#from backports import OrderedSet # fix pybtex bug in some versions try: diff --git a/extensions/natbib/latex_codec.py b/extensions/natbib/latex_codec.py index 571b47c..5537905 100644 --- a/extensions/natbib/latex_codec.py +++ b/extensions/natbib/latex_codec.py @@ -18,9 +18,18 @@ """ from __future__ import generators + import codecs import re -from backports import Set + +import oldPy + +try: + from sets import Set +except ImportError: + Set = set + +#from backports import Set def register(): """Enable encodings of the form 'latex+x' where x describes another encoding. diff --git a/extensions/numfig.py b/extensions/numfig.py index 5a6d990..f2f1100 100644 --- a/extensions/numfig.py +++ b/extensions/numfig.py @@ -1,8 +1,15 @@ +from collections import OrderedDict + from docutils import nodes from sphinx.roles import XRefRole + import figtable import subfig -from backports import OrderedDict, OrderedSet +from oldPy import OrderedSet + + +#from collections import OrderedDict, OrderedSet +#from backports import OrderedDict, OrderedSet # Element classes diff --git a/extensions/oldPy.py b/extensions/oldPy.py new file mode 100644 index 0000000..5fa6d2f --- /dev/null +++ b/extensions/oldPy.py @@ -0,0 +1,69 @@ +__author__ = 'rened' + +import collections + +class OrderedSet(collections.MutableSet): + + def __init__(self, iterable=None): + self.end = end = [] + end += [None, end, end] # sentinel node for doubly linked list + self.map = {} # key --> [key, prev, next] + if iterable is not None: + self |= iterable + + def __len__(self): + return len(self.map) + + def __contains__(self, key): + return key in self.map + + def add(self, key): + if key not in self.map: + end = self.end + curr = end[1] + curr[2] = end[1] = self.map[key] = [key, curr, end] + + def discard(self, key): + if key in self.map: + key, prev, next = self.map.pop(key) + prev[2] = next + next[1] = prev + + def __iter__(self): + end = self.end + curr = end[2] + while curr is not end: + yield curr[0] + curr = curr[2] + + def __reversed__(self): + end = self.end + curr = end[1] + while curr is not end: + yield curr[0] + curr = curr[1] + + def pop(self, last=True): + if not self: + raise KeyError('set is empty') + key = self.end[1][0] if last else self.end[2][0] + self.discard(key) + return key + + def __repr__(self): + if not self: + return '%s()' % (self.__class__.__name__,) + return '%s(%r)' % (self.__class__.__name__, list(self)) + + def __eq__(self, other): + if isinstance(other, OrderedSet): + return len(self) == len(other) and list(self) == list(other) + return set(self) == set(other) + + +if __name__ == '__main__': + s = OrderedSet('abracadaba') + t = OrderedSet('simsalabim') + print(s | t) + print(s & t) + print(s - t) From 1fd56030ffdc764857826b6504942cd4c25723d7 Mon Sep 17 00:00:00 2001 From: rddaz2013 Date: Fri, 13 Nov 2015 20:12:40 +0100 Subject: [PATCH 02/10] Update index.rst --- ch-intro/index.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ch-intro/index.rst b/ch-intro/index.rst index 62c98aa..4834c3d 100644 --- a/ch-intro/index.rst +++ b/ch-intro/index.rst @@ -86,8 +86,7 @@ The following changes and additions have been made from vanilla Sphinx: * Numbered section references * A singletext output that builds into a single text file, similar to singlehtml * A subfigure environment - -Nov. 2015 adapting for Python 2.7 +* Nov. 2015 adapting for Python 2.7 Documents Using sphinxtr ======================== From a8b7a37030b686d6071eca065b26fc89670b5829 Mon Sep 17 00:00:00 2001 From: rddaz2013 Date: Fri, 13 Nov 2015 21:00:53 +0100 Subject: [PATCH 03/10] new previous_spanning_row --- extensions/latex_mods.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/extensions/latex_mods.py b/extensions/latex_mods.py index 391dd99..e7e32ca 100644 --- a/extensions/latex_mods.py +++ b/extensions/latex_mods.py @@ -1,17 +1,16 @@ # -*- coding: utf-8 -*- import os -from docutils.io import FileOutput -from docutils.frontend import OptionParser -from docutils import nodes - import sphinx.builders.latex -from sphinx.util.smartypants import educate_quotes_latex -from sphinx.writers.latex import LaTeXWriter +import sphinx.writers.latex +from docutils import nodes +from docutils.frontend import OptionParser +from docutils.io import FileOutput from sphinx.util.console import bold from sphinx.util.osutil import copyfile +from sphinx.util.smartypants import educate_quotes_latex from sphinx.util.texescape import tex_escape_map -import sphinx.writers.latex +from sphinx.writers.latex import LaTeXWriter # remove usepackage for sphinx here, we add it later in the preamble in conf.py sphinx.writers.latex.HEADER = sphinx.writers.latex.HEADER.replace('\usepackage{sphinx}', '') @@ -23,6 +22,9 @@ class DocTranslator(BaseTranslator): def __init__(self, *args, **kwargs): BaseTranslator.__init__(self, *args, **kwargs) self.verbatim = None + self.previous_spanning_row = 0 + self.previous_spanning_column = 0 + def visit_caption(self, node): caption_idx = node.parent.index(node) if caption_idx > 0: From 379d515668b1f4c9596fdd176df0ed27a086b9a8 Mon Sep 17 00:00:00 2001 From: Rene Dworschak Date: Thu, 19 Jan 2017 19:26:24 +0100 Subject: [PATCH 04/10] 2016 - Last Version for Python2.7 --- Abverz.rst | 16 ++ ch-intro/index.rst | 13 +- conf.py | 123 ++++++++------- extensions/__init__.py | 0 extensions/backports.zip | Bin 0 -> 5162 bytes extensions/latex_mods.py | 2 +- extensions/numfig.py | 274 +++++++++++++++------------------ extensions/numfig_old.py | 186 +++++++++++++++++++++++ extensions/numimg.py | 140 +++++++++++++++++ extensions/port_dicts.py | 316 +++++++++++++++++++++++++++++++++++++++ img/Kopfzeile_neu.png | Bin 0 -> 4739 bytes tex/preamble._tex | 11 +- tex/puthesis.cls | 116 +++++++------- tex/sphinx.sty | 2 +- 14 files changed, 906 insertions(+), 293 deletions(-) create mode 100644 Abverz.rst create mode 100644 extensions/__init__.py create mode 100644 extensions/backports.zip create mode 100644 extensions/numfig_old.py create mode 100644 extensions/numimg.py create mode 100644 extensions/port_dicts.py create mode 100644 img/Kopfzeile_neu.png mode change 100755 => 100644 tex/puthesis.cls diff --git a/Abverz.rst b/Abverz.rst new file mode 100644 index 0000000..e382c0e --- /dev/null +++ b/Abverz.rst @@ -0,0 +1,16 @@ +:orphan: + +.. only:: html or text + + Stichwortverzeichniss + ===================== + +Kurze Übersicht über die im Bericht verwendeten Abkürzungen. + +.. topic:: Your Topic Title + + Subsequent indented lines comprise + the body of the topic, and are + interpreted as body elements. + + diff --git a/ch-intro/index.rst b/ch-intro/index.rst index 4834c3d..ea4b430 100644 --- a/ch-intro/index.rst +++ b/ch-intro/index.rst @@ -17,10 +17,7 @@ support all of the needs of a thesis writer. Many of the patches are not appropriate for contributing directly to the upstream Sphinx repository, so this is instead a separate project. -This sphinxtr output is available in several formats at: -http://jterrace.github.com/sphinxtr. - -The source code for sphinxtr can be found at: +The orginal source code for sphinxtr can be found at: https://github.com/jterrace/sphinxtr. Installation @@ -75,6 +72,9 @@ Changes The following changes and additions have been made from vanilla Sphinx: +* 2017 Start on the python3.5/sphinx 1.4.3 version +* 2016 working Version(this version) + * A cross-format bibtex bibliography based on sphinx-natbib * Tables that can go inside figures * Changed table formatting to look pretty, like booktabs @@ -88,8 +88,3 @@ The following changes and additions have been made from vanilla Sphinx: * A subfigure environment * Nov. 2015 adapting for Python 2.7 -Documents Using sphinxtr -======================== - -* `Jeff Terrace's PhD Thesis `_ - diff --git a/conf.py b/conf.py index 1a0856c..2aa689a 100644 --- a/conf.py +++ b/conf.py @@ -1,4 +1,5 @@ -import sys, os +import os +import sys # directory relative to this conf file CURDIR = os.path.abspath(os.path.dirname(__file__)) @@ -6,28 +7,26 @@ sys.path.append(os.path.join(os.path.abspath(os.path.dirname(__file__)), 'extensions')) # import the custom html and latex builders/translators/writers -import html_mods -import latex_mods # If your documentation needs a minimal Sphinx version, state it here. -#needs_sphinx = '1.0' +# needs_sphinx = '1.0' # import order is important here extensions = [ - 'fix_equation_ref', - 'sphinx.ext.mathjax', - 'sphinx.ext.ifconfig', - 'subfig', - 'numfig', - 'numsec', - 'natbib', - 'figtable', - 'singlehtml_toc', - 'singletext', - ] + 'fix_equation_ref', + 'sphinx.ext.mathjax', + 'sphinx.ext.ifconfig', + 'subfig', + 'numfig', + 'numsec', + 'natbib', + 'figtable', + 'singlehtml_toc', + 'singletext', 'sphinxcontrib.exceltable' +] # Add any paths that contain templates here, relative to this directory. -templates_path = ['templates'] +templates_path = [ 'templates' ] # The suffix of source filenames. source_suffix = '.rst' @@ -36,11 +35,11 @@ source_encoding = 'utf-8-sig' # General information about the project. -project = u'The Sphinx Thesis Resource (sphinxtr)' -author = u'Jeff Terrace' -copyright = u'by %s, 2012.' % author -version = '0.1' -release = '0.1' +project = u'Bericht' +author = u'Me' +copyright = u'by %s, 2015.' % author +version = '0.2' +release = '0.2' # Turns on numbered figures for HTML output number_figures = True @@ -58,11 +57,11 @@ # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. exclude_patterns = [ - '_build', - 'tex', - 'epilog.rst', - 'README.rst', - ] + '_build', + 'tex', + 'epilog.rst', + 'README.rst', +] # The master toctree document. # Ideally, we wouldn't have to do this, but sphinx seems to have trouble with @@ -76,12 +75,11 @@ # A string of reStructuredText that will be included at the end of # every source file that is read. -rst_epilog = open(os.path.join(CURDIR, 'epilog.rst'),'r').read().decode('utf8') +rst_epilog = open(os.path.join(CURDIR, 'epilog.rst'), 'r').read().decode('utf8') # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' - # -- Options for HTML output --------------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for @@ -91,52 +89,52 @@ # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. -#html_theme_options = {} +# html_theme_options = {} # Add any paths that contain custom themes here, relative to this directory. -#html_theme_path = [] +# html_theme_path = [] # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". html_title = "%s" % project # A shorter title for the navigation bar. Default is the same as html_title. -html_short_title = "Someone's PhD Thesis" +html_short_title = "Report" # The name of an image file (relative to this directory) to place at the top # of the sidebar. -#html_logo = None +# html_logo = None # The name of an image file (within the static path) to use as favicon of the # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 # pixels large. -#html_favicon = None +# html_favicon = None # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['static'] +html_static_path = [ 'static' ] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. -#html_last_updated_fmt = '%b %d, %Y' +# html_last_updated_fmt = '%b %d, %Y' # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. -#html_use_smartypants = True +# html_use_smartypants = True # Custom sidebar templates, maps document names to template names. -template_files = ['localtoc.html', 'relations.html', 'sourcelink.html'] +template_files = [ 'localtoc.html', 'relations.html', 'sourcelink.html' ] if not tags.has('singlehtml'): # only include search box for regular html, not single page html template_files.append('searchbox.html') html_sidebars = { - '**': template_files, + '**': template_files, } # Additional templates that should be rendered to pages, maps page names to # template names. -#html_additional_pages = {} +# html_additional_pages = {} # If false, no module index is generated. html_domain_indices = False @@ -145,24 +143,24 @@ html_use_index = False # If true, the index is split into individual pages for each letter. -#html_split_index = False +# html_split_index = False # If true, links to the reST sources are added to the pages. -#html_show_sourcelink = True +# html_show_sourcelink = True # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. -#html_show_sphinx = True +# html_show_sphinx = True # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. -#html_show_copyright = True +# html_show_copyright = True # If true, an OpenSearch description file will be output, and all pages will # contain a tag referring to it. The value of this option must be the # base URL from which the finished HTML is served. -#html_use_opensearch = '' +# html_use_opensearch = '' # This is the file name suffix for HTML files (e.g. ".xhtml"). -#html_file_suffix = None +# html_file_suffix = None # supresses the last dot in section numbers # changes "1. Introduction" -> "1 Introduction" @@ -191,8 +189,8 @@ latex_elements = { # The paper size ('letterpaper' or 'a4paper'). - 'papersize': 'letterpaper', - + 'papersize': 'a4paper', + # * gets passed to \documentclass # * default options are single sided, double spaced # you can change them with these options: @@ -200,31 +198,31 @@ # * singlespace # * you might want to omit the list of tables (lot) # if you use figtable without the :nofig: option - 'classoptions': ',english,lof,lot', - + 'classoptions': ',ngerman,lof,lot', + # The font size ('10pt', '11pt' or '12pt'). - 'pointsize': '12pt', - + 'pointsize': '10pt', + # Additional stuff for the LaTeX preamble. 'preamble': ADDITIONAL_PREAMBLE, - + # Additional footer 'footer': ADDITIONAL_FOOTER, - + # disable font inclusion 'fontpkg': '', 'fontenc': '', - + # disable fancychp 'fncychap': '', - + # get rid of the sphinx wrapper class file 'wrapperclass': 'puthesis', - + # override maketitle 'maketitle': '\makefrontmatter', 'tableofcontents': '', - + # disable index printing 'printindex': '', } @@ -241,7 +239,7 @@ ] latex_docclass = { - 'manual': 'puthesis', + 'manual': '', } latex_additional_files = [ @@ -253,24 +251,25 @@ 'tex/refstyle.bst', 'refs.bib', 'tex/ccicons.sty', + 'img/Kopfzeile_neu.png' ] # The name of an image file (relative to this directory) to place at the top of # the title page. -#latex_logo = None +# latex_logo = None # For "manual" documents, if this is true, then toplevel headings are parts, # not chapters. latex_use_parts = False # If true, show page references after internal links. -#latex_show_pagerefs = False +# latex_show_pagerefs = False # If true, show URL addresses after external links. -#latex_show_urls = False +# latex_show_urls = False # Documents to append as an appendix to all manuals. -#latex_appendices = [] +# latex_appendices = [] # If false, no module index is generated. latex_domain_indices = False diff --git a/extensions/__init__.py b/extensions/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/extensions/backports.zip b/extensions/backports.zip new file mode 100644 index 0000000000000000000000000000000000000000..9bd6685a18759e8d685ecebe3ab5be5572b28e5d GIT binary patch literal 5162 zcmZ{oWl$VUmxTv+cL*9RIAO2=5!`ivFu2R$I!JH}GY}-fU4j#WI|O$IcMSu9;1C8v zfX%yGTi>@^yWKxdb#*`0e{P*y=W45AU{V4A09?RbMyyh9yD19`AplUv3jq8TfR&{+ z#NEx)+e^URzmeY5jiL2?y*s>?Ou22;Gr7sHOouVRo_D6*KNE=$p_Ck;9*=rvx>zPCFm3?0+&MaP=?H zcMYrT#yHN3O}%4{K*OFeKD%t>{6mcd0{855Vw>N%dc}A$0>gI2-4-aU{Lwue$5AX4 z1e+PwrBtV6LDa?6NlmGG2vT0Wt$#A8t!`bPl@NiIuq#$ zKgzCiYXL)UP!rdzi(%N`Md;&e&3;$z>OuyWa9Ragmm^|JPE;jj(~@sK zt{)S{ouau%Ot3a81m zl8Tz@OQ<7-ajYQ9wA$q%IsRb+xYCXnQ82~;nj$z%$gH7XYnh%qB=y5mJ@qMj?=rOD z%;R@;#i+d3B*DD}Jh_LTOrkIhxplPGJ>WtE&#gDm8{?t5zwA96K=QNo&4qYfd)tdf2mjfJnn-minLc2Pn@sAwx6dyLjys?<$Z5zlPr>d;wuq3O8wvjvpqBr z7e~-&%m;vHFBc}G!rH*t$b~5umJ{5V?)>`tOf^v$X~bkNa2dBn%EmwzQcX;FK=qPz zxTA?L7o`B3h0!$g%fpEKI|2C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zYzYpL3H~GKY>p$=R ti&XvVaR1$G|DF23T<{+X@Sp!J6aR~{)>gy9{^tVY?=JnTE)@Tq{sa6Imt6n= literal 0 HcmV?d00001 diff --git a/extensions/latex_mods.py b/extensions/latex_mods.py index e7e32ca..9dc4e0c 100644 --- a/extensions/latex_mods.py +++ b/extensions/latex_mods.py @@ -206,7 +206,7 @@ def write(self, *ignored): sphinx.writers.latex.BEGIN_DOC = '' # output these as include files - for docname in ['abstract', 'dedication', 'acknowledgements']: + for docname in ['abstract', 'dedication', 'Abverz']: destination = FileOutput( destination_path=os.path.join(self.outdir, '%s.inc' % docname), encoding='utf-8') diff --git a/extensions/numfig.py b/extensions/numfig.py index f2f1100..e957d61 100644 --- a/extensions/numfig.py +++ b/extensions/numfig.py @@ -1,181 +1,147 @@ -from collections import OrderedDict +## +## @file numfig.py +## +## @brief For numbering figures in Sphinx +## +## @version $Id$ +## +## Started from https://bitbucket.org/arjones6/sphinx-numfig/wiki/Home +## +## Copyright © 2005-2012, Tech-X Corporation, Boulder, CO +## Free for any use whatsoever. +## from docutils import nodes +from docutils.nodes \ + import figure, caption, Text, reference, raw, SkipNode from sphinx.roles import XRefRole import figtable import subfig -from oldPy import OrderedSet -#from collections import OrderedDict, OrderedSet -#from backports import OrderedDict, OrderedSet - +# # Element classes +# +class page_ref(reference): + pass -class page_ref(nodes.reference): - pass - -class num_ref(nodes.reference): - pass - +class num_ref(reference): + pass +# # Visit/depart functions - +# +# Why is SkipNode raised? +# def skip_page_ref(self, node): - raise nodes.SkipNode + raise SkipNode + +def skip_num_ref(self, node): + raise SkipNode def latex_visit_page_ref(self, node): - self.body.append("\\pageref{%s:%s}" % (node['refdoc'], node['reftarget'])) - raise nodes.SkipNode + self.body.append("\\pageref{%s:%s}" % (node['refdoc'], node['reftarget'])) + raise SkipNode def latex_visit_num_ref(self, node): - fields = node['reftarget'].split('#') - - if len(fields) > 1: - label, target = fields - else: - label = None - target = fields[0] - - if target not in self.builder.env.docnames_by_figname: - raise nodes.SkipNode - targetdoc = self.builder.env.docnames_by_figname[target] - - ref_link = '%s:%s' % (targetdoc, target) - - if label is None: - latex = '\\ref{%s}' % ref_link - else: - latex = "\\hyperref[%s]{%s \\ref*{%s}}" % (ref_link, label, ref_link) - + fields = node['reftarget'].split('#') + if len(fields) > 1: + label, target = fields + ref_link = '%s:%s' % (node['refdoc'], target) + latex = "\\hyperref[%s]{%s \\ref*{%s}}" % (ref_link, label, ref_link) self.body.append(latex) - raise nodes.SkipNode - - -def doctree_read(app, doctree): - # first generate figure numbers for each figure - env = app.builder.env - - docname_figs = getattr(env, 'docname_figs', {}) - docnames_by_figname = getattr(env, 'docnames_by_figname', {}) - - for figure_info in doctree.traverse(lambda n: isinstance(n, nodes.figure) or \ - isinstance(n, subfig.subfigend) or \ - isinstance(n, figtable.figtable)): - - for id in figure_info['ids']: - docnames_by_figname[id] = env.docname - - fig_docname = docnames_by_figname[id] - if fig_docname not in docname_figs: - docname_figs[fig_docname] = OrderedDict() - - if isinstance(figure_info.parent, subfig.subfig): - mainid = figure_info.parent['mainfigid'] - else: - mainid = id - - if mainid not in docname_figs[fig_docname]: - docname_figs[fig_docname][mainid] = OrderedSet() - - if isinstance(figure_info.parent, subfig.subfig): - docname_figs[fig_docname][mainid].add(id) - - env.docnames_by_figname = docnames_by_figname - env.docname_figs = docname_figs - -def doctree_resolved(app, doctree, docname): - # replace numfig nodes with links - if app.builder.name in ('html', 'singlehtml', 'epub'): - env = app.builder.env - - docname_figs = getattr(env, 'docname_figs', {}) - docnames_by_figname = env.docnames_by_figname - - figids = getattr(env, 'figids', {}) - - secnums = [] - fignames_by_secnum = {} - for figdocname, figurelist in env.docname_figs.iteritems(): - if figdocname not in env.toc_secnumbers: - continue - secnum = env.toc_secnumbers[figdocname][''] - secnums.append(secnum) - fignames_by_secnum[secnum] = figurelist - - last_secnum = 0 - secnums = sorted(secnums) - figid = 1 - for secnum in secnums: - if secnum[0] != last_secnum: - figid = 1 - for figname, subfigs in fignames_by_secnum[secnum].iteritems(): - figids[figname] = str(secnum[0]) + '.' + str(figid) - for i, subfigname in enumerate(subfigs): - subfigid = figids[figname] + chr(ord('a') + i) - figids[subfigname] = subfigid - figid += 1 - last_secnum = secnum[0] - - env.figids = figids - - for figure_info in doctree.traverse(lambda n: isinstance(n, nodes.figure) or \ + else: + self.body.append('\\ref{%s:%s}' % (node['refdoc'], fields[0])) + raise SkipNode + +def latex_depart_num_ref(self, node): + pass + +def html_visit_num_ref(self, node): + fields = node['reftarget'].split('#') + if len(fields) > 1: + label, target = fields + target_file = '' + if node['refdoc']==target_file: +# Target file and curent file are the same + link = "%s.html#%s" %(node['refdoc'], target.lower()) + else: + link = "%s.html#%s" %(target_file, target.lower()) + html = '%s' %(link, label) + self.body.append(html) + else: + self.body.append('%s' % (node['refdoc'], fields[0])) + +def html_depart_num_ref(self, node): + pass + +def compute_numfig_fignums(app, doctree): +# Generate figure numbers for each figure + env = app.builder.env + i = getattr(env, 'i', 1) + figids = getattr(env, 'figids', {}) + figid_docname_map = getattr(env, 'figid_docname_map', {}) + for figure_info in doctree.traverse(lambda n: isinstance(n, figure) or \ isinstance(n, subfig.subfigend) or \ isinstance(n, figtable.figtable)): - id = figure_info['ids'][0] - fignum = figids[id] - for cap in figure_info.traverse(nodes.caption): - cap.insert(1, nodes.Text(" %s" % cap[0])) - if fignum[-1] in map(str, range(10)): - boldcaption = "%s %s:" % (app.config.figure_caption_prefix, fignum) - else: - boldcaption = "(%s)" % fignum[-1] - cap[0] = nodes.strong('', boldcaption) - - for ref_info in doctree.traverse(num_ref): - if '#' in ref_info['reftarget']: - label, target = ref_info['reftarget'].split('#') - labelfmt = label + " %s" - else: - labelfmt = '%s' - target = ref_info['reftarget'] - - if target not in docnames_by_figname: - app.warn('Target figure not found: %s' % target) - link = "#%s" % target - linktext = target - else: - target_doc = docnames_by_figname[target] - - if app.builder.name == 'singlehtml': - link = "#%s" % target - else: - link = "%s#%s" % (app.builder.get_relative_uri(docname, target_doc), - target) - - linktext = labelfmt % figids[target] - - html = '%s' % (link, linktext) - ref_info.replace_self(nodes.raw(html, html, format='html')) + if app.builder.name != 'latex' and app.config.numfig_number_figures: + for cap in figure_info.traverse(caption): + cap[0] = nodes.strong('',Text("%s %d: %s" % \ + (app.config.numfig_figure_caption_prefix, i, cap[0]))) + for id in figure_info['ids']: + figids[id] = i + figid_docname_map[id] = env.docname + i += 1 + env.figid_docname_map = figid_docname_map + env.i = i + env.figids = figids + +def insert_numfig_links(app, doctree, docname): +# Replace numfig nodes with links + figids = app.builder.env.figids + if app.builder.name != 'latex': + for ref_info in doctree.traverse(num_ref): + + if '#' in ref_info['reftarget']: + label, target = ref_info['reftarget'].split('#') + labelfmt = label + " %d" + else: + labelfmt = '%d' + target = ref_info['reftarget'] + + if target not in figids: + continue + + if app.builder.name == 'html': + target_doc = app.builder.env.figid_docname_map[target] + link = "%s#%s" % (app.builder.get_relative_uri(docname, target_doc), + target) + html = '%s' % (link, labelfmt %(figids[target])) + ref_info.replace_self(raw(html, html, format='html')) + else: + ref_info.replace_self(Text(labelfmt % (figids[target]))) def setup(app): - app.add_config_value('number_figures', True, True) - app.add_config_value('figure_caption_prefix', "Figure", True) - app.add_node(page_ref, - text=(skip_page_ref, None), - html=(skip_page_ref, None), - singlehtml=(skip_page_ref, None), - latex=(latex_visit_page_ref, None)) +# Are these used? + app.add_config_value('numfig_number_figures', True, True) + app.add_config_value('numfig_figure_caption_prefix', "Figure", True) + + app.add_node(page_ref, + text=(skip_page_ref, None), + html=(skip_page_ref, None), + latex=(latex_visit_page_ref, None)) + + app.add_role('page', XRefRole(nodeclass=page_ref)) - app.add_role('page', XRefRole(nodeclass=page_ref)) + app.add_node(num_ref, + text=(skip_num_ref, None), + html=(html_visit_num_ref, html_depart_num_ref), + latex=(latex_visit_num_ref, latex_depart_num_ref)) - app.add_node(num_ref, - latex=(latex_visit_num_ref, None), - text=(skip_page_ref, None)) + app.add_role('num', XRefRole(nodeclass=num_ref)) - app.add_role('num', XRefRole(nodeclass=num_ref)) + app.connect('doctree-read', compute_numfig_fignums) + app.connect('doctree-resolved', insert_numfig_links) - app.connect('doctree-read', doctree_read) - app.connect('doctree-resolved', doctree_resolved) diff --git a/extensions/numfig_old.py b/extensions/numfig_old.py new file mode 100644 index 0000000..4d16d46 --- /dev/null +++ b/extensions/numfig_old.py @@ -0,0 +1,186 @@ +from docutils import nodes +from sphinx.roles import XRefRole + +import figtable +import subfig +from port_dicts import OrderedDict, OrderedSet + + +# Element classes + +class page_ref(nodes.reference): + pass + +class num_ref(nodes.reference): + pass + + +# Visit/depart functions + +def skip_page_ref(self, node): + raise nodes.SkipNode + +def latex_visit_page_ref(self, node): + self.body.append("\\pageref{%s:%s}" % (node['refdoc'], node['reftarget'])) + raise nodes.SkipNode + +def latex_visit_num_ref(self, node): + fields = node['reftarget'].split('#') + + if len(fields) > 1: + label, target = fields + else: + label = None + target = fields[0] + + if target not in self.builder.env.docnames_by_figname: + raise nodes.SkipNode + targetdoc = self.builder.env.docnames_by_figname[target] + + ref_link = '%s:%s' % (targetdoc, target) + + if label is None: + latex = '\\ref{%s}' % ref_link + else: + latex = "\\hyperref[%s]{%s \\ref*{%s}}" % (ref_link, label, ref_link) + + self.body.append(latex) + raise nodes.SkipNode + + +def doctree_read(app, doctree): + # first generate figure numbers for each figure + env = app.builder.env + + docname_figs = getattr(env, 'docname_figs', {}) + docnames_by_figname = getattr(env, 'docnames_by_figname', {}) + + for figure_info in doctree.traverse(lambda n: isinstance(n, nodes.figure) or \ + isinstance(n, subfig.subfigend) or \ + isinstance(n, figtable.figtable)): + + for id in figure_info['ids']: + docnames_by_figname[id] = env.docname + fig_docname = docnames_by_figname[id] + if fig_docname not in docname_figs: + docname_figs[fig_docname] = OrderedDict() + + if isinstance(figure_info.parent, subfig.subfig): + mainid = figure_info.parent['mainfigid'] + else: + mainid = id + + if mainid not in docname_figs[fig_docname]: + docname_figs[fig_docname][mainid] = OrderedSet() + + if isinstance(figure_info.parent, subfig.subfig): + docname_figs[fig_docname][mainid].add(id) + + env.docnames_by_figname = docnames_by_figname + env.docname_figs = docname_figs + +def doctree_resolved(app, doctree, docname): + # replace numfig nodes with links + if app.builder.name in ('html', 'singlehtml', 'epub'): + env = app.builder.env + + docname_figs = getattr(env, 'docname_figs', {}) + docnames_by_figname = env.docnames_by_figname + + figids = getattr(env, 'figids', {}) + + secnums = [] + fignames_by_secnum = {} + for figdocname, figurelist in env.docname_figs.iteritems(): + if figdocname not in env.toc_secnumbers: + continue + secnum = env.toc_secnumbers[figdocname][''] + secnums.append(secnum) + #d['test2'] = d.pop('test') + newkeys= ['id1','id2','id3','id4','id5'] + for nkey in newkeys: + dummy = 'C'+str(secnum[0])+nkey + if nkey in figurelist.keys(): + print dummy + figurelist[dummy] = figurelist.pop(nkey) + #print figurelist.keys(),secnum + fignames_by_secnum[secnum] = figurelist + #print figurelist,secnum + + last_secnum = 0 + secnums = sorted(secnums) + figid = 1 + for secnum in secnums: + if secnum[0] != last_secnum: + figid = 1 + for figname, subfigs in fignames_by_secnum[secnum].iteritems(): + figids[figname] = str(secnum[0]) + '.' + str(figid) + #print figids[figname],figname + for i, subfigname in enumerate(subfigs): + subfigid = figids[figname] + chr(ord('a') + i) + figids[subfigname] = subfigid + figid += 1 + last_secnum = secnum[0] + + env.figids = figids + + for figure_info in doctree.traverse(lambda n: isinstance(n, nodes.figure) or \ + isinstance(n, subfig.subfigend) or \ + isinstance(n, figtable.figtable)): + #figure_info['ids'] + id = figure_info['ids'][0] + fignum = figids[id] + for cap in figure_info.traverse(nodes.caption): + cap.insert(1, nodes.Text(" %s" % cap[0])) + if fignum[-1] in map(str, range(10)): + boldcaption = "%s %s:" % (app.config.figure_caption_prefix, fignum) + else: + boldcaption = "(%s)" % fignum[-1] + cap[0] = nodes.strong('', boldcaption) + + for ref_info in doctree.traverse(num_ref): + if '#' in ref_info['reftarget']: + label, target = ref_info['reftarget'].split('#') + labelfmt = label + " %s" + else: + labelfmt = '%s' + target = ref_info['reftarget'] + + if target not in docnames_by_figname: + app.warn('Target figure not found: %s' % target) + link = "#%s" % target + linktext = target + else: + target_doc = docnames_by_figname[target] + + if app.builder.name == 'singlehtml': + link = "#%s" % target + else: + link = "%s#%s" % (app.builder.get_relative_uri(docname, target_doc), + target) + + linktext = labelfmt % figids[target] + + html = '%s' % (link, linktext) + ref_info.replace_self(nodes.raw(html, html, format='html')) + +def setup(app): + app.add_config_value('number_figures', True, True) + app.add_config_value('figure_caption_prefix', "Figure", True) + + app.add_node(page_ref, + text=(skip_page_ref, None), + html=(skip_page_ref, None), + singlehtml=(skip_page_ref, None), + latex=(latex_visit_page_ref, None)) + + app.add_role('page', XRefRole(nodeclass=page_ref)) + + app.add_node(num_ref, + latex=(latex_visit_num_ref, None), + text=(skip_page_ref, None)) + + app.add_role('num', XRefRole(nodeclass=num_ref)) + + app.connect('doctree-read', doctree_read) + app.connect('doctree-resolved', doctree_resolved) diff --git a/extensions/numimg.py b/extensions/numimg.py new file mode 100644 index 0000000..f7292fb --- /dev/null +++ b/extensions/numimg.py @@ -0,0 +1,140 @@ +## +## @file numimg.py +## +## @brief For numbering images in Sphinx +## +## @version $Id$ +## +## Started from https://bitbucket.org/arjones6/sphinx-numimg/wiki/Home +## +## Copyright © 2005-2012, Tech-X Corporation, Boulder, CO +## Free for any use whatsoever. +## + +from docutils.nodes \ + import image, caption, Text, reference, raw, SkipNode +from sphinx.roles import XRefRole + +# +# Element classes +# +class page_ref(reference): + pass + +class num_ref(reference): + pass + +# +# Visit/depart functions +# +# Why is SkipNode raised? +# +def skip_page_ref(self, node): + raise SkipNode + +def skip_num_ref(self, node): + raise SkipNode + +def latex_visit_page_ref(self, node): + self.body.append("\\pageref{%s:%s}" % (node['refdoc'], node['reftarget'])) + raise SkipNode + +def latex_visit_num_ref(self, node): + fields = node['reftarget'].split('#') + if len(fields) > 1: + label, target = fields + ref_link = '%s:%s' % (node['refdoc'], target) + latex = "\\hyperref[%s]{%s \\ref*{%s}}" % (ref_link, label, ref_link) + self.body.append(latex) + else: + self.body.append('\\ref{%s:%s}' % (node['refdoc'], fields[0])) + raise SkipNode + +def latex_depart_num_ref(self, node): + pass + +def html_visit_num_ref(self, node): + fields = node['reftarget'].split('#') + if len(fields) > 1: + label, target = fields + target_file = '' + if node['refdoc']==target_file: +# Target file and curent file are the same + link = "%s.html#%s" %(node['refdoc'], target.lower()) + else: + link = "%s.html#%s" %(target_file, target.lower()) + html = '%s' %(link, label) + self.body.append(html) + else: + self.body.append('%s' % (node['refdoc'], fields[0])) + +def html_depart_num_ref(self, node): + pass + +def compute_numimg_imgnums(app, doctree): +# Generate image numbers for each image + env = app.builder.env + i = getattr(env, 'i', 1) + numids = getattr(env, 'numids', {}) + numid_docname_map = getattr(env, 'numid_docname_map', {}) + for image_info in doctree.traverse(image): + if app.builder.name != 'latex' and app.config.numimg_number_images: + for cap in image_info.traverse(caption): + cap[0] = Text("%s %d: %s" % \ + (app.config.numimg_image_caption_prefix, i, cap[0])) + for id in image_info['ids']: + numids[id] = i + numid_docname_map[id] = env.docname + i += 1 + env.numid_docname_map = numid_docname_map + env.i = i + env.numids = numids + +def insert_numimg_links(app, doctree, docname): +# Replace numimg nodes with links + numids = app.builder.env.numids + if app.builder.name != 'latex': + for ref_info in doctree.traverse(num_ref): + + if '#' in ref_info['reftarget']: + label, target = ref_info['reftarget'].split('#') + labelfmt = label + " %d" + else: + labelfmt = '%d' + target = ref_info['reftarget'] + + if target not in numids: + continue + + if app.builder.name == 'html': + target_doc = app.builder.env.numid_docname_map[target] + link = "%s#%s" % (app.builder.get_relative_uri(docname, target_doc), + target) + html = '%s' % (link, labelfmt %(numids[target])) + ref_info.replace_self(raw(html, html, format='html')) + else: + ref_info.replace_self(Text(labelfmt % (numids[target]))) + +def setup(app): + +# Are these used? + app.add_config_value('numimg_number_images', True, True) + app.add_config_value('numimg_image_caption_prefix', "Image", True) + + app.add_node(page_ref, + text=(skip_page_ref, None), + html=(skip_page_ref, None), + latex=(latex_visit_page_ref, None)) + + app.add_role('page', XRefRole(nodeclass=page_ref)) + + app.add_node(num_ref, + text=(skip_num_ref, None), + html=(html_visit_num_ref, html_depart_num_ref), + latex=(latex_visit_num_ref, latex_depart_num_ref)) + + app.add_role('num', XRefRole(nodeclass=num_ref)) + + app.connect('doctree-read', compute_numimg_imgnums) + app.connect('doctree-resolved', insert_numimg_links) + diff --git a/extensions/port_dicts.py b/extensions/port_dicts.py new file mode 100644 index 0000000..48ff53e --- /dev/null +++ b/extensions/port_dicts.py @@ -0,0 +1,316 @@ +import collections + +Set = set + +try: + from collections import OrderedDict +except ImportError: + class OrderedDict(dict): + 'Dictionary that remembers insertion order' + # An inherited dict maps keys to values. + # The inherited dict provides __getitem__, __len__, __contains__, and get. + # The remaining methods are order-aware. + # Big-O running times for all methods are the same as for regular dictionaries. + + # The internal self.__map dictionary maps keys to links in a doubly linked list. + # The circular doubly linked list starts and ends with a sentinel element. + # The sentinel element never gets deleted (this simplifies the algorithm). + # Each link is stored as a list of length three: [PREV, NEXT, KEY]. + + def __init__(self, *args, **kwds): + '''Initialize an ordered dictionary. Signature is the same as for + regular dictionaries, but keyword arguments are not recommended + because their insertion order is arbitrary. + + ''' + if len(args) > 1: + raise TypeError('expected at most 1 arguments, got %d' % len(args)) + try: + self.__root + except AttributeError: + self.__root = root = [] # sentinel node + root[:] = [root, root, None] + self.__map = {} + self.__update(*args, **kwds) + + def __setitem__(self, key, value, dict_setitem=dict.__setitem__): + 'od.__setitem__(i, y) <==> od[i]=y' + # Setting a new item creates a new link which goes at the end of the linked + # list, and the inherited dictionary is updated with the new key/value pair. + if key not in self: + root = self.__root + last = root[0] + last[1] = root[0] = self.__map[key] = [last, root, key] + dict_setitem(self, key, value) + + def __delitem__(self, key, dict_delitem=dict.__delitem__): + 'od.__delitem__(y) <==> del od[y]' + # Deleting an existing item uses self.__map to find the link which is + # then removed by updating the links in the predecessor and successor nodes. + dict_delitem(self, key) + link_prev, link_next, key = self.__map.pop(key) + link_prev[1] = link_next + link_next[0] = link_prev + + def __iter__(self): + 'od.__iter__() <==> iter(od)' + root = self.__root + curr = root[1] + while curr is not root: + yield curr[2] + curr = curr[1] + + def __reversed__(self): + 'od.__reversed__() <==> reversed(od)' + root = self.__root + curr = root[0] + while curr is not root: + yield curr[2] + curr = curr[0] + + def clear(self): + 'od.clear() -> None. Remove all items from od.' + try: + for node in self.__map.itervalues(): + del node[:] + root = self.__root + root[:] = [root, root, None] + self.__map.clear() + except AttributeError: + pass + dict.clear(self) + + def popitem(self, last=True): + '''od.popitem() -> (k, v), return and remove a (key, value) pair. + Pairs are returned in LIFO order if last is true or FIFO order if false. + + ''' + if not self: + raise KeyError('dictionary is empty') + root = self.__root + if last: + link = root[0] + link_prev = link[0] + link_prev[1] = root + root[0] = link_prev + else: + link = root[1] + link_next = link[1] + root[1] = link_next + link_next[0] = root + key = link[2] + del self.__map[key] + value = dict.pop(self, key) + return key, value + + # -- the following methods do not depend on the internal structure -- + + def keys(self): + 'od.keys() -> list of keys in od' + return list(self) + + def values(self): + 'od.values() -> list of values in od' + return [self[key] for key in self] + + def items(self): + 'od.items() -> list of (key, value) pairs in od' + return [(key, self[key]) for key in self] + + def iterkeys(self): + 'od.iterkeys() -> an iterator over the keys in od' + return iter(self) + + def itervalues(self): + 'od.itervalues -> an iterator over the values in od' + for k in self: + yield self[k] + + def iteritems(self): + 'od.iteritems -> an iterator over the (key, value) items in od' + for k in self: + yield (k, self[k]) + + def update(*args, **kwds): + '''od.update(E, **F) -> None. Update od from dict/iterable E and F. + + If E is a dict instance, does: for k in E: od[k] = E[k] + If E has a .keys() method, does: for k in E.keys(): od[k] = E[k] + Or if E is an iterable of items, does: for k, v in E: od[k] = v + In either case, this is followed by: for k, v in F.items(): od[k] = v + + ''' + if len(args) > 2: + raise TypeError('update() takes at most 2 positional ' + 'arguments (%d given)' % (len(args),)) + elif not args: + raise TypeError('update() takes at least 1 argument (0 given)') + self = args[0] + # Make progressively weaker assumptions about "other" + other = () + if len(args) == 2: + other = args[1] + if isinstance(other, dict): + for key in other: + self[key] = other[key] + elif hasattr(other, 'keys'): + for key in other.keys(): + self[key] = other[key] + else: + for key, value in other: + self[key] = value + for key, value in kwds.items(): + self[key] = value + + __update = update # let subclasses override update without breaking __init__ + + __marker = object() + + def pop(self, key, default=__marker): + '''od.pop(k[,d]) -> v, remove specified key and return the corresponding value. + If key is not found, d is returned if given, otherwise KeyError is raised. + + ''' + if key in self: + result = self[key] + del self[key] + return result + if default is self.__marker: + raise KeyError(key) + return default + + def setdefault(self, key, default=None): + 'od.setdefault(k[,d]) -> od.get(k,d), also set od[k]=d if k not in od' + if key in self: + return self[key] + self[key] = default + return default + + def __repr__(self, _repr_running={}): + 'od.__repr__() <==> repr(od)' + call_key = id(self), _get_ident() + if call_key in _repr_running: + return '...' + _repr_running[call_key] = 1 + try: + if not self: + return '%s()' % (self.__class__.__name__,) + return '%s(%r)' % (self.__class__.__name__, self.items()) + finally: + del _repr_running[call_key] + + def __reduce__(self): + 'Return state information for pickling' + items = [[k, self[k]] for k in self] + inst_dict = vars(self).copy() + for k in vars(OrderedDict()): + inst_dict.pop(k, None) + if inst_dict: + return (self.__class__, (items,), inst_dict) + return self.__class__, (items,) + + def copy(self): + 'od.copy() -> a shallow copy of od' + return self.__class__(self) + + @classmethod + def fromkeys(cls, iterable, value=None): + '''OD.fromkeys(S[, v]) -> New ordered dictionary with keys from S + and values equal to v (which defaults to None). + + ''' + d = cls() + for key in iterable: + d[key] = value + return d + + def __eq__(self, other): + '''od.__eq__(y) <==> od==y. Comparison to another OD is order-sensitive + while comparison to a regular mapping is order-insensitive. + + ''' + if isinstance(other, OrderedDict): + return len(self)==len(other) and self.items() == other.items() + return dict.__eq__(self, other) + + def __ne__(self, other): + return not self == other + + # -- the following methods are only used in Python 2.7 -- + + def viewkeys(self): + "od.viewkeys() -> a set-like object providing a view on od's keys" + return KeysView(self) + + def viewvalues(self): + "od.viewvalues() -> an object providing a view on od's values" + return ValuesView(self) + + def viewitems(self): + "od.viewitems() -> a set-like object providing a view on od's items" + return ItemsView(self) + +KEY, PREV, NEXT = range(3) + +class OrderedSet(collections.MutableSet): + """ + From: http://code.activestate.com/recipes/576694/ + """ + def __init__(self, iterable=None): + self.end = end = [] + end += [None, end, end] # sentinel node for doubly linked list + self.map = {} # key --> [key, prev, next] + if iterable is not None: + self |= iterable + + def __len__(self): + return len(self.map) + + def __contains__(self, key): + return key in self.map + + def add(self, key): + if key not in self.map: + end = self.end + curr = end[PREV] + curr[NEXT] = end[PREV] = self.map[key] = [key, curr, end] + + def discard(self, key): + if key in self.map: + key, prev, next = self.map.pop(key) + prev[NEXT] = next + next[PREV] = prev + + def __iter__(self): + end = self.end + curr = end[NEXT] + while curr is not end: + yield curr[KEY] + curr = curr[NEXT] + + def __reversed__(self): + end = self.end + curr = end[PREV] + while curr is not end: + yield curr[KEY] + curr = curr[PREV] + + def pop(self, last=True): + if not self: + raise KeyError('set is empty') + key = next(reversed(self)) if last else next(iter(self)) + self.discard(key) + return key + + def __repr__(self): + if not self: + return '%s()' % (self.__class__.__name__,) + return '%s(%r)' % (self.__class__.__name__, list(self)) + + def __eq__(self, other): + if isinstance(other, OrderedSet): + return len(self) == len(other) and list(self) == list(other) + return set(self) == set(other) + + def __del__(self): + self.clear() # remove circular references diff --git a/img/Kopfzeile_neu.png b/img/Kopfzeile_neu.png new file mode 100644 index 0000000000000000000000000000000000000000..822491edb993b072fc183a2ce23adfa8c94cee7c GIT binary patch literal 4739 zcmV-}5`686P)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!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`FfK3{HIa z1ilf8gk!j#YxUXcD()@b!|j{5`wsRitKg?;9{^KIpCyER@f5{@j41N|0RT*Tpbn^k RjS2t&002ovPDHLkV1k=~?l=Gd literal 0 HcmV?d00001 diff --git a/tex/preamble._tex b/tex/preamble._tex index 85a43e7..97507a7 100644 --- a/tex/preamble._tex +++ b/tex/preamble._tex @@ -1,7 +1,8 @@ -\submitted{November 2012} -\copyrightyear{2012} -\adviser{Professor John P. Smith} -\department{Computer Science} +\submitted{Dezember 2016} +\copyrightyear{2016} +\adviser{M. Gosewinkel} + +\department{Technisches Labor der Inburex GmbH} \newcommand{\proquestmode}{} @@ -10,7 +11,7 @@ } \acknowledgements{ -\input{acknowledgements.inc} +\input{Abverz.inc} } \dedication{ diff --git a/tex/puthesis.cls b/tex/puthesis.cls old mode 100755 new mode 100644 index c5e0f50..8c6d340 --- a/tex/puthesis.cls +++ b/tex/puthesis.cls @@ -1,9 +1,17 @@ \NeedsTeXFormat{LaTeX2e} \ProvidesClass{puthesis} - [2008/05/02 v1.4 Princeton University Thesis class] + [2015/11/02 v1.4 Inburex Phitec Report class] \RequirePackage{setspace} \RequirePackage{ccicons} \RequirePackage{ifthen} +\RequirePackage{float} +\RequirePackage{fancyhdr} +\usepackage{lastpage} +\usepackage{etoolbox} +\patchcmd{\chapter}{\thispagestyle{plain}}{\thispagestyle{fancy}}{}{} +%%% +\usepackage[scaled]{helvet} +\renewcommand*{\familydefault}{\sfdefault} \newcounter{subyear} \setcounter{subyear}{\number\year} \def\submitted#1{\gdef\@submitted{#1}} @@ -16,7 +24,7 @@ \def\adviser#1{\gdef\@adviser{#1}} \long\def\@abstract{\@latex@error{No \noexpand\abstract given}\@ehc} \newcommand*{\frontmatter}{ - \pagenumbering{roman} + %%%\pagenumbering{roman} } \newcommand*{\mainmatter}{\pagenumbering{arabic}} \newcommand*{\makelot}{} @@ -52,80 +60,66 @@ %% However, that is not compatible with package 'hyperref'. \tableofcontents needs %% to be declared from within the document itself. \newcommand*{\makefrontmatter}{ +\pagestyle{fancy} +%%% Kopf und Fusszeilen +\fancyhead[R]{ } +\fancyhead[L]{ } +\fancyhead[C]{\includegraphics[width=0.98\textwidth]{Kopfzeile_neu.png}} +\fancyfoot[C]{Laborbericht TL/10716/16} +\fancyfoot[R]{\thepage\ von \pageref{LastPage}} +\fancypagestyle{meinstyle}{\renewcommand{\headrulewidth}{0pt}\fancyfoot[C]{}\fancyfoot[R]{}} \bodyspacing -\frontmatter\maketitlepage\makecopyrightpage\makeabstract -\makeacknowledgements\makededication\maketoc -\makelot\clearpage\makelof\clearpage\makelos -\clearpage\mainmatter +\let\ps@plain\ps@fancy +\fancyfoot[C]{}\fancyfoot[R]{} +\frontmatter\maketitlepage\makeabstract +\maketoc\clearpage\makelof\clearpage\makelos +\fancyfoot[C]{Laborbericht TL/10716/16} +\fancyfoot[R]{\thepage\ von \pageref{LastPage}} +\clearpage +\mainmatter } \def\@submitted{\@submittedmonth~\@submittedyear} -\def\@dept{Mathematics} -\def\@deptpref{Department of} +\def\@dept{Labor} +\def\@deptpref{Abteilung} \def\departmentprefix#1{\gdef\@deptpref{#1}} \def\department#1{\gdef\@dept{#1}} \long\def\acknowledgements#1{\gdef\@acknowledgements{#1}} \def\dedication#1{\gdef\@dedication{#1}} + \newcommand{\maketitlepage}{{ - \thispagestyle{empty} + \thispagestyle{meinstyle} \sc - \vspace*{0in} - \begin{center} - \LARGE \@title - \end{center} - \vspace{.6in} - \extravspace{.6in} - \begin{center} - \@author - \end{center} - \vspace{.6in} - \extravspace{.6in} - \begin{center} - A Dissertation \\ - Presented to the Faculty \\ - of Princeton University \\ - in Candidacy for the Degree \\ - of Doctor of Philosophy - \end{center} - \vspace{.3in} - \extravspace{.3in} - \begin{center} - Recommended for Acceptance \\ - by the \@deptpref \\ - \@dept \\ - Adviser: \@adviser - \end{center} - \vspace{.3in} - \extravspace{.3in} - \begin{center} - \@submitted - \end{center} - \clearpage + \vspace*{1.5in} + Leere Seite + }} \newcommand*{\makecopyrightpage}{ - \thispagestyle{empty} + \thispagestyle{meinstyle} \vspace*{0in} \begin{center} - \copyright\ Copyright by \@author, \@copyrightyear. All rights reserved. \\ - \vspace{1in} - \begin{minipage}[c]{0.2\linewidth} - \hfill {\Huge \ccLogo~\ccAttribution} - \end{minipage} + \copyright\ Verfasst von \@author, \@copyrightyear. \\ \hspace{0.1cm} \begin{minipage}[c]{0.7\linewidth} - This work is licensed under a Creative Commons Attribution-3.0 United States License. \\ - \url{http://creativecommons.org/licenses/by/3.0/us/} + Inburexlogo \\ \end{minipage} \end{center} \clearpage} \newcommand*{\makeabstract}{ + \thispagestyle{meinstyle} \newpage - \addcontentsline{toc}{section}{Abstract} + \thispagestyle{meinstyle} + \addcontentsline{toc}{section}{Titelseite} \begin{center} - \Large \textbf{Abstract} + \Large \textbf{Hinweis} \end{center} \@abstract + \\ + \\ + \\ + \\ \clearpage } + \def\makeacknowledgements{ \ifx\@acknowledgements\undefined \else @@ -137,7 +131,7 @@ \addcontentsline{toc}{section}{Acknowledgements} \begin{center} - \Large \textbf{Acknowledgements} + \Large \textbf{Abk\"urzungsverzeichnis} \end{center} \@acknowledgements \clearpage @@ -159,18 +153,18 @@ \phantomsection \else \fi - \addcontentsline{toc}{section}{List of Tables}\listoftables}} -\DeclareOption{lof}{\renewcommand*{\makelof}{ + \addcontentsline{toc}{section}{Tabellenverzeichnis}\listoftables}} +\DeclareOption{lof}{\renewcommand*{\makelof}{\thispagestyle{meinstyle} \ifdefined\phantomsection % makes hyperref recognize this section properly for pdf links \phantomsection \else \fi - \addcontentsline{toc}{section}{List of Figures}\listoffigures}} + \addcontentsline{toc}{section}{Grafikverzeichnis}\listoffigures}} \DeclareOption{los}{ \renewcommand*{\makelos}{ \RequirePackage{losymbol} - \section*{List of Symbols\@mkboth {LIST OF SYMBOLS}{LIST OF SYMBOLS}} + \section*{List of Symbols\@mkboth {Symbolverzeichnis}{LIST OF SYMBOLS}} \@starttoc{los} \ifdefined\phantomsection % makes hyperref recognize this section properly for pdf links @@ -205,14 +199,14 @@ {\PassOptionsToClass{twoside}{report}} %% Not necessary to specify the point size - we inherit it from above -%% \LoadClass[12pt]{report} +%% \LoadClass[11pt]{report} \LoadClass{report} \ifthenelse{\boolean{@myopt@oneside}} { -\setlength{\oddsidemargin}{.5in} %{.4375in} -\setlength{\evensidemargin}{.5in} %{.4375in} +\setlength{\oddsidemargin}{.3in} %{.4375in} +\setlength{\evensidemargin}{.3in} %{.4375in} }{ -\setlength{\oddsidemargin}{.5in} %{.4375in} +\setlength{\oddsidemargin}{.3in} %{.4375in} \setlength{\evensidemargin}{0in} %{.4375in} } \setlength{\topmargin}{-.5in} %{-.5625in} @@ -226,7 +220,7 @@ %%% try to avoid overfull lines by limiting how far it is okay to exceed the margins %%% http://www.tex.ac.uk/cgi-bin/texfaq2html?label=overfull -\setlength{\emergencystretch}{2em} +\setlength{\emergencystretch}{3em} \long\def\abstract#1{\gdef\@abstract{#1}} %% 'begincmd' no longer used -- insert \makefrontmatter in the document instead. See above. diff --git a/tex/sphinx.sty b/tex/sphinx.sty index 9ba74cb..1f65390 100644 --- a/tex/sphinx.sty +++ b/tex/sphinx.sty @@ -13,7 +13,7 @@ \ProvidesPackage{sphinx}[2010/01/15 LaTeX package (Sphinx markup)] \RequirePackage{textcomp} -%\RequirePackage{fancyhdr} +\RequirePackage{fancyhdr} \RequirePackage{fancybox} %\RequirePackage{titlesec} \RequirePackage{tabulary} From 0e1c547cf24a31c283b36ef35539e0b80b7a9de8 Mon Sep 17 00:00:00 2001 From: Rene Dworschak Date: Thu, 19 Jan 2017 19:38:12 +0100 Subject: [PATCH 05/10] sphinx 1.3.1 --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index a16f1bc..26d481e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,8 @@ before_install: # - sudo apt-get install texlive install: - - "pip install -r requirements.txt --use-mirrors" + - pip install pybtex + - pip install sphinx==1.3.1 script: - make html && make html From 177a76ec4d108a4c4063e8c75b5fad49e780d043 Mon Sep 17 00:00:00 2001 From: Rene Dworschak Date: Thu, 19 Jan 2017 19:39:20 +0100 Subject: [PATCH 06/10] only branch --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index 26d481e..d946b67 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,10 @@ python: - 2.6 - 2.7 +branches: + only: + - UpdatePython27 + before_install: - sudo apt-get remove chromium firefox mongodb-10gen - sudo apt-get install texlive From e32957a9fbd0661558f0e35aa92b19985e8121cb Mon Sep 17 00:00:00 2001 From: Rene Dworschak Date: Thu, 19 Jan 2017 19:46:05 +0100 Subject: [PATCH 07/10] pip install update no more python 2.6 --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index d946b67..c19bec5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,8 @@ language: python python: - - 2.6 - 2.7 + branches: only: @@ -18,6 +18,7 @@ before_install: install: - pip install pybtex - pip install sphinx==1.3.1 + - pip install sphinxcontrib-exceltable script: - make html && make html From 05770556ac45f4c437e2dc5fd58ba3e346b2d3a3 Mon Sep 17 00:00:00 2001 From: Rene Dworschak Date: Thu, 19 Jan 2017 19:54:50 +0100 Subject: [PATCH 08/10] pip part 2 --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index c19bec5..86d29de 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,6 +16,7 @@ before_install: # - sudo apt-get install texlive install: + - pip install docutils=0.12 - pip install pybtex - pip install sphinx==1.3.1 - pip install sphinxcontrib-exceltable From a6f481acc9454a5d07034defaf2dec87a3109d1b Mon Sep 17 00:00:00 2001 From: Rene Dworschak Date: Thu, 19 Jan 2017 19:57:22 +0100 Subject: [PATCH 09/10] Update .travis.yml --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 86d29de..900fcd1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,7 +16,7 @@ before_install: # - sudo apt-get install texlive install: - - pip install docutils=0.12 + - pip install docutils==0.12 - pip install pybtex - pip install sphinx==1.3.1 - pip install sphinxcontrib-exceltable From ab9da49e345721acf17bdea12ee5bf6822b539bc Mon Sep 17 00:00:00 2001 From: Rene Dworschak Date: Thu, 19 Jan 2017 21:53:52 +0100 Subject: [PATCH 10/10] 2016 - Last Version for Python2.7 --- extensions/numfig.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/extensions/numfig.py b/extensions/numfig.py index e957d61..02d15d6 100644 --- a/extensions/numfig.py +++ b/extensions/numfig.py @@ -41,8 +41,21 @@ def skip_num_ref(self, node): raise SkipNode def latex_visit_page_ref(self, node): - self.body.append("\\pageref{%s:%s}" % (node['refdoc'], node['reftarget'])) - raise SkipNode + fields = node['reftarget'].split('#') + + if len(fields) > 1: + label, target = fields + else: + label = None + target = fields[0] + + if target not in self.builder.env.docnames_by_figname: + raise nodes.SkipNode + targetdoc = self.builder.env.docnames_by_figname[target] + + ref_link = '%s:%s' % (targetdoc, target) + self.body.append("\\pageref{%s}" % ref_link) + raise nodes.SkipNode def latex_visit_num_ref(self, node): fields = node['reftarget'].split('#')