PDF - elementary styling
authorMarcin Koziej <marcin.koziej@nowoczesnapolska.org.pl>
Thu, 14 Feb 2013 13:16:51 +0000 (14:16 +0100)
committerMarcin Koziej <marcin.koziej@nowoczesnapolska.org.pl>
Thu, 14 Feb 2013 13:17:19 +0000 (14:17 +0100)
Wybor excercise

librarian/pdf.py
librarian/pdf/wl.cls
librarian/pypdf.py
librarian/styles/wasysym/uwasy.fd [new file with mode: 0644]
librarian/styles/wasysym/uwasyvar.fd [new file with mode: 0644]
librarian/styles/wasysym/wasysym.sty [new file with mode: 0644]

index 9308704..10afdf3 100644 (file)
@@ -175,7 +175,7 @@ def package_available(package, args='', verbose=False):
 
 def load_including_children(wldoc=None, provider=None, uri=None):
     """ Makes one big xml file with children inserted at end.
-    
+
     Either wldoc or provider and URI must be provided.
     """
 
@@ -203,7 +203,7 @@ def load_including_children(wldoc=None, provider=None, uri=None):
 
 class PDFFormat(Format):
     """ Base PDF format.
-    
+
     Available customization:
         nofootnotes: Doesn't do footnotes.
         nothemes: Doesn't do themes.
@@ -265,6 +265,9 @@ class PDFFormat(Format):
         # Copy style
         shutil.copy(get_resource('pdf/wl.cls'), temp)
         shutil.copy(self.style, os.path.join(temp, 'style.sty'))
+        for sfile in ['wasysym.sty', 'uwasyvar.fd', 'uwasy.fd']:
+            shutil.copy(get_resource(os.path.join('styles/wasysym', sfile)), temp)
+
         # Save attachments
         if self.cover:
             self.cover.for_pdf().dump_to(os.path.join(temp, 'makecover.sty'))
@@ -303,7 +306,7 @@ class PDFFormat(Format):
         """
         self.verbose = verbose
         self.save_tex = save_tex
-        
+
         if morefloats is None and package_available('morefloats', 'maxfloats=19'):
             morefloats = 'new'
         self.morefloats = morefloats
index a0b32e6..9e5e6be 100755 (executable)
@@ -414,3 +414,7 @@ Letters={Uppercase}
 \newcommand{\activitytime}[1]{Czas: #1 min \\}
 \newcommand{\activityform}[1]{Forma: #1 \\}
 \newcommand{\activitytools}[1]{#1 \\}
+
+\newcommand*\checkbox{\item[\Square]}
+\newcommand*\radio{\item[\Circle]}
+
index cb082ca..4cc4d1d 100644 (file)
@@ -31,6 +31,7 @@ from librarian import functions
 from pdf import PDFFormat
 
 
+
 def escape(really):
     def deco(f):
         def _wrap(*args, **kw):
@@ -69,8 +70,15 @@ class EduModule(Xmill):
     def __init__(self, options=None):
         super(EduModule, self).__init__(options)
         self.activity_counter = 0
+        self.exercise_counter = 0
+
+        def swap_endlines(txt):
+            if self.options['strofa']:
+                txt = txt.replace("/\n", '<ctrl ch="\"/>')
+            return txt
         self.register_text_filter(functions.substitute_entities)
         self.register_text_filter(mark_alien_characters)
+        self.register_text_filter(swap_endlines)
 
     def get_dc(self, element, dc_field, single=False):
         values = map(lambda t: t.text, element.xpath("//dc:%s" % dc_field, namespaces={'dc': DCNS.uri}))
@@ -125,9 +133,6 @@ class EduModule(Xmill):
         return u"".join(filter(None, lines)), u'</TeXML>'
 
 
-    handle_naglowek_rozdzial = escape(True)(cmd("naglowekrozdzial", True))
-    handle_naglowek_podrozdzial = escape(True)(cmd("naglowekpodrozdzial", True))
-
     @escape(1)
     def handle_powiesc(self, element):
         return u"""
@@ -135,13 +140,60 @@ class EduModule(Xmill):
     <cmd name="maketitle"/>
     """, """</env>"""
 
-    handle_autor_utworu = cmd('autorutworu', True)
-    handle_nazwa_utworu = cmd('nazwautworu', True)
-    handle_dzielo_nadrzedne = cmd('dzielonadrzedne', True)
-    handle_podtytul = cmd('podtytul', True)
-
-    handle_akap = handle_akap_dialog = handle_akap_cd = lambda s, e: ("\n", "\n")
-    handle_strofa = lambda s, e: ("\n","\n")
+    @escape(1)
+    def handle_texcommand(self, element):
+        cmd = functions.texcommand(element.tag)
+        return u'<TeXML escape="1"><cmd name="%s"><parm>' % cmd, u'</parm></cmd></TeXML>'
+
+    handle_akap = \
+    handle_akap = \
+    handle_akap_cd = \
+    handle_akap_cd = \
+    handle_akap_dialog = \
+    handle_akap_dialog = \
+    handle_autor_utworu = \
+    handle_dedykacja = \
+    handle_didaskalia = \
+    handle_didask_tekst = \
+    handle_dlugi_cytat = \
+    handle_dzielo_nadrzedne = \
+    handle_lista_osoba = \
+    handle_mat = \
+    handle_miejsce_czas = \
+    handle_motto = \
+    handle_motto_podpis = \
+    handle_naglowek_akt = \
+    handle_naglowek_czesc = \
+    handle_naglowek_listy = \
+    handle_naglowek_osoba = \
+    handle_naglowek_podrozdzial = \
+    handle_naglowek_podrozdzial = \
+    handle_naglowek_rozdzial = \
+    handle_naglowek_rozdzial = \
+    handle_naglowek_scena = \
+    handle_nazwa_utworu = \
+    handle_nota = \
+    handle_osoba = \
+    handle_pa = \
+    handle_pe = \
+    handle_podtytul = \
+    handle_poezja_cyt = \
+    handle_pr = \
+    handle_pt = \
+    handle_sekcja_asterysk = \
+    handle_sekcja_swiatlo = \
+    handle_separator_linia = \
+    handle_slowo_obce = \
+    handle_srodtytul = \
+    handle_tytul_dziela = \
+    handle_wyroznienie = \
+    handle_texcommand
+
+    _handle_strofa = cmd("strofa", True)
+
+    def handle_strofa(self, element):
+        self.options = {'strofa': True}
+        return self._handle_strofa(element)
 
     def handle_aktywnosc(self, element):
         self.activity_counter += 1
@@ -170,11 +222,16 @@ class EduModule(Xmill):
         counter = self.activity_counter
 
         return u"""
-Czas: %(czas)s min
-Forma: %(forma)s
-%(pomoce)s
 
-%(counter)d. %(opis)s
+<cmd name="activitycounter"><parm>%(counter)d.</parm></cmd>
+<cmd name="activityinfo"><parm>
+ <cmd name="activitytime"><parm>%(czas)s</parm></cmd>
+ <cmd name="activityform"><parm>%(forma)s</parm></cmd>
+ <cmd name="activitytools"><parm>%(pomoce)s</parm></cmd>
+</parm></cmd>
+
+
+%(opis)s
 
 %(wskazowki)s
 """ % locals()
@@ -192,162 +249,194 @@ Forma: %(forma)s
     def handle_forma(self, *_):
         return
 
-#     def handle_cwiczenie(self, element):
-#         exercise_handlers = {
-#             'wybor': Wybor,
-#             'uporzadkuj': Uporzadkuj,
-#             'luki': Luki,
-#             'zastap': Zastap,
-#             'przyporzadkuj': Przyporzadkuj,
-#             'prawdafalsz': PrawdaFalsz
-#             }
-
-#         typ = element.attrib['typ']
-#         handler = exercise_handlers[typ](self.options)
-#         return handler.generate(element)
-
-#     # Lists
-#     def handle_lista(self, element, attrs={}):
-#         ltype = element.attrib.get('typ', 'punkt')
-#         if ltype == 'slowniczek':
-#             surl = element.attrib.get('href', None)
-#             sxml = None
-#             if surl:
-#                 sxml = etree.fromstring(self.options['provider'].by_uri(surl).get_string())
-#             self.options = {'slowniczek': True, 'slowniczek_xml': sxml }
-#             return '<div class="slowniczek">', '</div>'
-
-#         listtag = {'num': 'ol',
-#                'punkt': 'ul',
-#                'alfa': 'ul',
-#                'czytelnia': 'ul'}[ltype]
-
-#         classes = attrs.get('class', '')
-#         if classes: del attrs['class']
-
-#         attrs_s = ' '.join(['%s="%s"' % kv for kv in attrs.items()])
-#         if attrs_s: attrs_s = ' ' + attrs_s
-
-#         return '<%s class="lista %s %s"%s>' % (listtag, ltype, classes, attrs_s), '</%s>' % listtag
-
-#     def handle_punkt(self, element):
-#         if self.options['slowniczek']:
-#             return '<dl>', '</dl>'
-#         else:
-#             return '<li>', '</li>'
-
-#     def handle_definiendum(self, element):
-#         nxt = element.getnext()
-#         definiens_s = ''
-
-#         # let's pull definiens from another document
-#         if self.options['slowniczek_xml'] and (not nxt or nxt.tag != 'definiens'):
-#             sxml = self.options['slowniczek_xml']
-#             assert element.text != ''
-#             defloc = sxml.xpath("//definiendum[text()='%s']" % element.text)
-#             if defloc:
-#                 definiens = defloc[0].getnext()
-#                 if definiens.tag == 'definiens':
-#                     subgen = EduModule(self.options)
-#                     definiens_s = subgen.generate(definiens)
-
-#         return u"<dt>", u"</dt>" + definiens_s
-
-#     def handle_definiens(self, element):
-#         return u"<dd>", u"</dd>"
-
-
-#     def handle_podpis(self, element):
-#         return u"""<div class="caption">""", u"</div>"
-
-#     def handle_tabela(self, element):
-#         has_frames = int(element.attrib.get("ramki", "0"))
-#         if has_frames: frames_c = "framed"
-#         else: frames_c = ""
-#         return u"""<table class="%s">""" % frames_c, u"</table>"
-
-#     def handle_wiersz(self, element):
-#         return u"<tr>", u"</tr>"
-
-#     def handle_kol(self, element):
-#         return u"<td>", u"</td>"
-
-#     def handle_rdf__RDF(self, _):
-#         # ustal w opcjach  rzeczy :D
-#         return
-
-#     def handle_link(self, element):
-#         if 'material' in element.attrib:
-#             formats = re.split(r"[, ]+", element.attrib['format'])
-#             fmt_links = []
-#             for f in formats:
-#                 fmt_links.append(u'<a href="%s">%s</a>' % (self.options['urlmapper'].url_for_material(element.attrib['material'], f), f.upper()))
-
-#             return u"", u' (%s)' % u' '.join(fmt_links)
-
-
-# class Exercise(EduModule):
-#     def __init__(self, *args, **kw):
-#         self.question_counter = 0
-#         super(Exercise, self).__init__(*args, **kw)
-
-#     def handle_rozw_kom(self, element):
-#         return u"""<div style="display:none" class="comment">""", u"""</div>"""
-
-#     def handle_cwiczenie(self, element):
-#         self.options = {'exercise': element.attrib['typ']}
-#         self.question_counter = 0
-#         self.piece_counter = 0
-
-#         pre = u"""
-# <div class="exercise %(typ)s" data-type="%(typ)s">
-# <form action="#" method="POST">
-# """ % element.attrib
-#         post = u"""
-# <div class="buttons">
-# <span class="message"></span>
-# <input type="button" class="check" value="sprawdź"/>
-# <input type="button" class="retry" style="display:none" value="spróbuj ponownie"/>
-# <input type="button" class="solutions" value="pokaż rozwiązanie"/>
-# <input type="button" class="reset" value="reset"/>
-# </div>
-# </form>
-# </div>
-# """
-#         # Add a single <pytanie> tag if it's not there
-#         if not element.xpath(".//pytanie"):
-#             qpre, qpost = self.handle_pytanie(element)
-#             pre = pre + qpre
-#             post = qpost + post
-#         return pre, post
-
-#     def handle_pytanie(self, element):
-#         """This will handle <cwiczenie> element, when there is no <pytanie>
-#         """
-#         add_class = ""
-#         self.question_counter += 1
-#         self.piece_counter = 0
-#         solution = element.attrib.get('rozw', None)
-#         if solution: solution_s = ' data-solution="%s"' % solution
-#         else: solution_s = ''
-
-#         handles = element.attrib.get('uchwyty', None)
-#         if handles:
-#             add_class += ' handles handles-%s' % handles
-#             self.options = {'handles': handles}
-
-#         minimum = element.attrib.get('min', None)
-#         if minimum: minimum_s = ' data-minimum="%d"' % int(minimum)
-#         else: minimum_s = ''
-
-#         return '<div class="question%s" data-no="%d" %s>' %\
-#             (add_class, self.question_counter, solution_s + minimum_s), \
-#             "</div>"
+    def handle_lista(self, element, attrs={}):
+        ltype = element.attrib.get('typ', 'punkt')
+        if ltype == 'slowniczek':
+            surl = element.attrib.get('href', None)
+            sxml = None
+            if surl:
+                sxml = etree.fromstring(self.options['provider'].by_uri(surl).get_string())
+            self.options = {'slowniczek': True, 'slowniczek_xml': sxml }
+
+        listcmd = {'num': 'enumerate',
+               'punkt': 'itemize',
+               'alfa': 'itemize',
+               'slowniczek': 'itemize',
+               'czytelnia': 'itemize'}[ltype]
+
+        return u'<env name="%s">' % listcmd, u'</env>'
+
+    def handle_punkt(self, element):
+        return '<cmd name="item"/>', ''
+
+    def handle_cwiczenie(self, element):
+        exercise_handlers = {
+            'wybor': Wybor}
+            # 'uporzadkuj': Uporzadkuj,
+            # 'luki': Luki,
+            # 'zastap': Zastap,
+            # 'przyporzadkuj': Przyporzadkuj,
+            # 'prawdafalsz': PrawdaFalsz
+
+        typ = element.attrib['typ']
+        if not typ in exercise_handlers:
+            return '(no handler)'
+        handler = exercise_handlers[typ](self.options)
+        return handler.generate(element)
+
+    # XXX this is copied from pyhtml.py, except for return and
+    # should be refactored for no code duplication
+    def handle_definiendum(self, element):
+        nxt = element.getnext()
+        definiens_s = ''
+
+        # let's pull definiens from another document
+        if self.options['slowniczek_xml'] and (not nxt or nxt.tag != 'definiens'):
+            sxml = self.options['slowniczek_xml']
+            assert element.text != ''
+            defloc = sxml.xpath("//definiendum[text()='%s']" % element.text)
+            if defloc:
+                definiens = defloc[0].getnext()
+                if definiens.tag == 'definiens':
+                    subgen = EduModule(self.options)
+                    definiens_s = subgen.generate(definiens)
+
+        return u'<cmd name="textbf"><parm>', u"</parm></cmd>: " + definiens_s
+
+    def handle_definiens(self, element):
+        return u"", u""
+
+    def handle_podpis(self, element):
+        return u"""<env name="figure">""", u"</env>"
+
+    def handle_tabela(self, element):
+        max_col = 0
+        for w in element.xpath("wiersz"):
+            ks = w.xpath("kol")
+            if max_col < len(ks):
+                max_col = len(ks)
+        self.options = {'columnts': max_col}
+        # styling:
+                #        has_frames = int(element.attrib.get("ramki", "0"))
+                #        if has_frames: frames_c = "framed"
+                #        else: frames_c = ""
+                #        return u"""<table class="%s">""" % frames_c, u"</table>"
+        return u'''
+<cmd name="begin"><parm>tabular</parm><opt>%s</opt></cmd>
+    ''' % ('l' * max_col), \
+    u'''<cmd name="end"><parm>tabular</parm></cmd>'''
+
+    @escape(1)
+    def handle_wiersz(self, element):
+        return u"", u'<ctrl ch="\\"/>'
+
+    @escape(1)
+    def handle_kol(self, element):
+        if element.getnext() is not None:
+            return u"", u'<spec cat="align">'
+        return u"", u""
+
+    handle_link = cmd('em', True)
+
+
+class Exercise(EduModule):
+    def __init__(self, *args, **kw):
+        self.question_counter = 0
+        super(Exercise, self).__init__(*args, **kw)
+
+    handle_rozw_kom = ifoption(teacher=True)(cmd('akap', True))
+
+    def handle_cwiczenie(self, element):
+        self.options = {'exercise': element.attrib['typ']}
+        self.question_counter = 0
+        self.piece_counter = 0
+
+        pre = u""
+        post = u""
+        # Add a single <pytanie> tag if it's not there
+        if not element.xpath(".//pytanie"):
+            qpre, qpost = self.handle_pytanie(element)
+            pre = pre + qpre
+            post = qpost + post
+        return pre, post
+
+    def handle_pytanie(self, element):
+        """This will handle <cwiczenie> element, when there is no <pytanie>
+        """
+        opts = {}
+        self.question_counter += 1
+        self.piece_counter = 0
+        solution = element.attrib.get('rozw', None)
+        if solution:
+            opts['solution'] = solution
+
+        handles = element.attrib.get('uchwyty', None)
+        if handles:
+            opts['handles'] = handles
+
+        minimum = element.attrib.get('min', None)
+        if minimum:
+            opts['minimum'] = minimum
+
+        if opts:
+            self.options = opts
+        return u"", u""
+
+
+class Wybor(Exercise):
+    INSTRUCTION = None
+
+    def handle_cwiczenie(self, element):
+        pre, post = super(Wybor, self).handle_cwiczenie(element)
+        is_single_choice = True
+        pytania = element.xpath(".//pytanie")
+        if not pytania:
+            pytania = [element]
+        for p in pytania:
+            solutions = re.split(r"[, ]+", p.attrib['rozw'])
+            if len(solutions) != 1:
+                is_single_choice = False
+                break
+            choices = p.xpath(".//*[@nazwa]")
+            uniq = set()
+            for n in choices: uniq.add(n.attrib['nazwa'])
+            if len(choices) != len(uniq):
+                is_single_choice = False
+                break
+
+        self.options = {'single': is_single_choice}
+        return pre, post
+
+    def handle_punkt(self, element):
+        if self.options['exercise'] and element.attrib.get('nazwa', None):
+            cmd = 'radio' if self.options['single'] else 'checkbox'
+            return u'<cmd name="%s"/>' % cmd, ''
+        else:
+            return super(Wybor, self).handle_punkt(element)
+
+
+
+
+def fix_lists(tree):
+    lists = tree.xpath(".//lista")
+    for l in lists:
+        if l.text:
+            p = l.getprevious()
+            if p is not None:
+                if p.tail is None: p.tail = ''
+                p.tail += l.text
+            else:
+                p = l.getparent()
+                if p.text is None: p.text = ''
+                p.text += l.text
+            l.text = ''
+    return tree
+
 
 class EduModulePDFFormat(PDFFormat):
     def get_texml(self):
         edumod = EduModule()
-        texml = edumod.generate(self.wldoc.edoc.getroot()).encode('utf-8')
+        texml = edumod.generate(fix_lists(self.wldoc.edoc.getroot())).encode('utf-8')
 
         open("/tmp/texml.xml", "w").write(texml)
         return texml
diff --git a/librarian/styles/wasysym/uwasy.fd b/librarian/styles/wasysym/uwasy.fd
new file mode 100644 (file)
index 0000000..3b0f531
--- /dev/null
@@ -0,0 +1,52 @@
+%%
+%% This is file `uwasy.fd',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% wasysym.dtx  (with options: `fd')
+%% 
+%% Copyright (C) 1994-2003 by Axel Kielhorn.  All rights reserved.
+%% For additional copyright information see further down in this file.
+%% 
+%% This file is to be used with the LaTeX2e system.
+%% ------------------------------------------------
+%% 
+%% This program can be redistributed and/or modified under the terms
+%% of the LaTeX Project Public License Distributed from CTAN
+%% archives in directory macros/latex/base/lppl.txt; either
+%% version 1 of the License, or any later version.
+%% 
+%% IMPORTANT NOTICE:
+%% 
+%% Error reports in case of UNCHANGED versions to
+%% Axel Kielhorn
+%% A.Kielhorn@web.de
+%% 
+%% \CharacterTable
+%%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%%   Digits        \0\1\2\3\4\5\6\7\8\9
+%%   Exclamation   \!     Double quote  \"     Hash (number) \#
+%%   Dollar        \$     Percent       \%     Ampersand     \&
+%%   Acute accent  \'     Left paren    \(     Right paren   \)
+%%   Asterisk      \*     Plus          \+     Comma         \,
+%%   Minus         \-     Point         \.     Solidus       \/
+%%   Colon         \:     Semicolon     \;     Less than     \<
+%%   Equals        \=     Greater than  \>     Question mark \?
+%%   Commercial at \@     Left bracket  \[     Backslash     \\
+%%   Right bracket \]     Circumflex    \^     Underscore    \_
+%%   Grave accent  \`     Left brace    \{     Vertical bar  \|
+%%   Right brace   \}     Tilde         \~}
+\ProvidesFile{uwasy.fd}%
+             [2003/10/30 v2.0
+              Wasy-2 symbol font definitions]
+\DeclareFontFamily{U}{wasy}{}
+\DeclareFontShape{U}{wasy}{m}{n}{ <5> <6> <7> <8> <9> gen * wasy
+      <10> <10.95> <12> <14.4> <17.28> <20.74> <24.88>wasy10  }{}
+\DeclareFontShape{U}{wasy}{b}{n}{ <-10> sub * wasy/m/n
+ <10> <10.95> <12> <14.4> <17.28> <20.74> <24.88>wasyb10 }{}
+\DeclareFontShape{U}{wasy}{bx}{n}{ <-> sub * wasy/b/n}{}
+\endinput
+%%
+%% End of file `uwasy.fd'.
diff --git a/librarian/styles/wasysym/uwasyvar.fd b/librarian/styles/wasysym/uwasyvar.fd
new file mode 100644 (file)
index 0000000..e186585
--- /dev/null
@@ -0,0 +1,57 @@
+%%
+%% This is file `uwasyvar.fd',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% wasysym.dtx  (with options: `fdvar')
+%% 
+%% Copyright (C) 1994-2003 by Axel Kielhorn.  All rights reserved.
+%% For additional copyright information see further down in this file.
+%% 
+%% This file is to be used with the LaTeX2e system.
+%% ------------------------------------------------
+%% 
+%% This program can be redistributed and/or modified under the terms
+%% of the LaTeX Project Public License Distributed from CTAN
+%% archives in directory macros/latex/base/lppl.txt; either
+%% version 1 of the License, or any later version.
+%% 
+%% IMPORTANT NOTICE:
+%% 
+%% Error reports in case of UNCHANGED versions to
+%% Axel Kielhorn
+%% A.Kielhorn@web.de
+%% 
+%% \CharacterTable
+%%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%%   Digits        \0\1\2\3\4\5\6\7\8\9
+%%   Exclamation   \!     Double quote  \"     Hash (number) \#
+%%   Dollar        \$     Percent       \%     Ampersand     \&
+%%   Acute accent  \'     Left paren    \(     Right paren   \)
+%%   Asterisk      \*     Plus          \+     Comma         \,
+%%   Minus         \-     Point         \.     Solidus       \/
+%%   Colon         \:     Semicolon     \;     Less than     \<
+%%   Equals        \=     Greater than  \>     Question mark \?
+%%   Commercial at \@     Left bracket  \[     Backslash     \\
+%%   Right bracket \]     Circumflex    \^     Underscore    \_
+%%   Grave accent  \`     Left brace    \{     Vertical bar  \|
+%%   Right brace   \}     Tilde         \~}
+\ProvidesFile{uwasy.fd}%
+             [2003/10/30 v2.0
+              Wasy-2 symbol font definitions]
+\DeclareFontFamily{U}{wasy}{}
+\DeclareFontShape{U}{wasy}{m}{n}{%
+<5-6> wasy5
+<6-7> wasy6
+<7-8> wasy7
+<8-9> wasy8
+<9-10> wasy9
+<10-> wasy10}{}
+\DeclareFontShape{U}{wasy}{b}{n}{ <-10> sub * wasy/m/n
+ <10-> wasyb10 }{}
+\DeclareFontShape{U}{wasy}{bx}{n}{ <-> sub * wasy/b/n}{}
+\endinput
+%%
+%% End of file `uwasyvar.fd'.
diff --git a/librarian/styles/wasysym/wasysym.sty b/librarian/styles/wasysym/wasysym.sty
new file mode 100644 (file)
index 0000000..742cc9c
--- /dev/null
@@ -0,0 +1,261 @@
+%%
+%% This is file `wasysym.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% wasysym.dtx  (with options: `package')
+%% 
+%% Copyright (C) 1994-2003 by Axel Kielhorn.  All rights reserved.
+%% For additional copyright information see further down in this file.
+%% 
+%% This file is to be used with the LaTeX2e system.
+%% ------------------------------------------------
+%% 
+%% This program can be redistributed and/or modified under the terms
+%% of the LaTeX Project Public License Distributed from CTAN
+%% archives in directory macros/latex/base/lppl.txt; either
+%% version 1 of the License, or any later version.
+%% 
+%% IMPORTANT NOTICE:
+%% 
+%% Error reports in case of UNCHANGED versions to
+%% Axel Kielhorn
+%% A.Kielhorn@web.de
+%% 
+%% \CharacterTable
+%%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%%   Digits        \0\1\2\3\4\5\6\7\8\9
+%%   Exclamation   \!     Double quote  \"     Hash (number) \#
+%%   Dollar        \$     Percent       \%     Ampersand     \&
+%%   Acute accent  \'     Left paren    \(     Right paren   \)
+%%   Asterisk      \*     Plus          \+     Comma         \,
+%%   Minus         \-     Point         \.     Solidus       \/
+%%   Colon         \:     Semicolon     \;     Less than     \<
+%%   Equals        \=     Greater than  \>     Question mark \?
+%%   Commercial at \@     Left bracket  \[     Backslash     \\
+%%   Right bracket \]     Circumflex    \^     Underscore    \_
+%%   Grave accent  \`     Left brace    \{     Vertical bar  \|
+%%   Right brace   \}     Tilde         \~}
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{wasysym}
+             [2003/10/30 v2.0
+               Wasy-2 symbol support package]
+\newif\ifwasy@integrals
+\newif\ifwasy@compatibility
+\DeclareOption{compat1}{%
+  \wasy@compatibilitytrue\wasy@integralsfalse}%
+\DeclareOption{integrals}{%
+  \wasy@compatibilityfalse\wasy@integralstrue}%
+\DeclareOption{nointegrals}{%
+  \wasy@compatibilityfalse\wasy@integralsfalse}%
+\ExecuteOptions{compat1}
+\ProcessOptions\relax
+\def\wasy@setup{%
+     \let\int\wasy@int
+     \let\iint\wasy@iint
+     \let\iiint\wasy@iiint
+     \let\oint\wasy@oint
+     \let\oiint\wasy@oiint
+}
+\def\wasy@amssetup{%
+     \let\intop\wasy@int
+     \let\iintop\wasy@iint
+     \let\iiintop\wasy@iiint
+     \let\ointop\wasy@oint
+     \let\oiintop\wasy@oiint
+     \def\int{\DOTSI\intop\ilimits@}%
+     \def\iint{\DOTSI\iintop\ilimits@}%
+     \def\iiint{\DOTSI\iiintop\ilimits@}%
+     \def\oint{\DOTSI\ointop\ilimits@}%
+     \def\oiint{\DOTSI\oiintop\ilimits@}%
+     \def\intkern@{\mkern-8mu}
+}
+\newcommand{\newint}{%
+  \PackageWarning{wasysym}{%
+  The command \protect\newint\space is obsolete.
+  \MessageBreak
+  Load the package with the option [integrals] instead}
+  \wasy@integralstrue}
+\newcommand{\newamsint}{%
+  \PackageWarning{wasysym}{%
+  The command \protect\newamsint\space is obsolete.
+  \MessageBreak
+  Load the package with the option [integrals] instead.}
+  \wasy@integralstrue}
+\def\wasyfamily{\fontencoding{U}\fontfamily{wasy}\selectfont}
+\DeclareTextFontCommand{\textwasy}{\wasyfamily}
+\DeclareSymbolFont{wasy}{U}{wasy}{m}{n}
+\SetSymbolFont{wasy}{bold}{U}{wasy}{b}{n}
+\def\wasy@over#1#2{{\setbox0\hbox{$#2$}\hbox to \wd0{\hss
+    $#1$\hss}\kern-\wd0\box0}}
+\def\male       {\mbox{\wasyfamily\char26}}
+\def\female     {\mbox{\wasyfamily\char25}}
+\def\currency   {{\wasyfamily\char27}}
+\def\phone      {{\wasyfamily\char7}}
+\def\recorder   {{\wasyfamily\char6}}
+\def\clock      {{\wasyfamily\char28}}
+\def\lightning  {{\wasyfamily\char18}}
+\def\pointer    {{\wasyfamily\char9}}
+\def\RIGHTarrow {{\wasyfamily\char17}}
+\def\LEFTarrow  {{\wasyfamily\char16}}
+\def\UParrow    {{\wasyfamily\char75}}
+\def\DOWNarrow  {{\wasyfamily\char76}}
+\def\AC         {\mbox{\kern0.5pt\wasyfamily\char58\kern0.5pt}}
+\def\HF         {\leavevmode
+        \lower0.9pt\hbox to 0pt{\kern0.5pt\wasyfamily\char58\hss}%
+        \raise0.9pt\hbox{\kern0.5pt\wasyfamily\char58\kern0.5pt}}
+\def\VHF        {\mbox{\wasyfamily\char64}}
+\def\Square     {\mbox{$\Box$}}
+\def\CheckedBox {\leavevmode\hbox to 0pt{\wasyfamily\char50\hss}%
+                 \hbox{\wasyfamily\char8}}
+\def\XBox       {\mbox{\wasyfamily\char52}}
+\def\hexagon    {\mbox{\wasyfamily\char55}}
+\def\pentagon   {\mbox{\wasyfamily\char68}}
+\def\octagon    {\mbox{\wasyfamily\char56}}
+\def\varhexagon {\mbox{\wasyfamily\char57}}
+\def\hexstar    {\mbox{\wasyfamily\char65}}
+\def\varhexstar {\mbox{\wasyfamily\char66}}
+\def\davidsstar {\mbox{\wasyfamily\char67}}
+\def\diameter   {\mbox{\wasyfamily\char31}}
+\def\invdiameter{\mbox{\wasyfamily\char21}}
+\def\varangle   {\mbox{\wasyfamily\char30}}
+\def\wasylozenge{\mbox{\wasyfamily\char53}}
+\def\kreuz      {\mbox{\wasyfamily\char54}}
+\def\smiley     {\mbox{\wasyfamily\char44}}
+\def\frownie    {\mbox{\wasyfamily\char47}}
+\def\blacksmiley{\mbox{\wasyfamily\char45}}
+\def\sun        {\mbox{\wasyfamily\char46}}
+\def\checked    {\mbox{\wasyfamily\char8}}
+\def\bell       {\mbox{\wasyfamily\char10}}
+\def\eighthnote {\mbox{\wasyfamily\char11}}
+\def\quarternote{\mbox{\wasyfamily\char12}}
+\def\halfnote   {\mbox{\wasyfamily\char13}}
+\def\fullnote   {\mbox{\wasyfamily\char14}}
+\def\twonotes   {\mbox{\wasyfamily\char15}}
+\def\brokenvert {\mbox{\wasyfamily\char124}}
+\def\ataribox   {\mbox{\wasyfamily\char109}}
+\def\wasytherefore{\mbox{\wasyfamily\char5}}
+\def\Circle     {\mbox{\wasyfamily\char35}}
+\def\CIRCLE     {\mbox{\wasyfamily\char32}}
+\def\Leftcircle {\mbox{\wasyfamily\char73}}
+\def\LEFTCIRCLE {\mbox{\wasyfamily\char71}}
+\def\Rightcircle{\mbox{\wasyfamily\char74}}
+\def\RIGHTCIRCLE{\mbox{\wasyfamily\char72}}
+\def\LEFTcircle {\leavevmode%
+                 \hbox to 0pt{\wasyfamily\char71\hss}%
+                 \hbox{\wasyfamily\char35}}
+\def\RIGHTcircle{\leavevmode%
+                 \hbox to 0pt{\wasyfamily\char72\hss}%
+                 \hbox{\wasyfamily\char35}}
+\def\vernal     {\mbox{\wasyfamily\char23}}
+\def\ascnode    {\mbox{\wasyfamily\char19}}
+\def\descnode   {\mbox{\wasyfamily\char20}}
+\let\fullmoon   \Circle
+\let\newmoon    \CIRCLE
+\def\leftmoon   {\mbox{\wasyfamily\char36}}
+\def\rightmoon  {\mbox{\wasyfamily\char37}}
+\def\astrosun   {\mbox{$\odot$}}
+\def\mercury    {\mbox{\wasyfamily\char39}}
+\def\venus      {\leavevmode\raise0.2ex\hbox{\wasyfamily\char25}}
+\def\earth      {\leavevmode\lower0.3ex\hbox{\wasyfamily\char38}}
+\def\mars       {\leavevmode\lower0.2ex\hbox{\wasyfamily\char26}}
+\def\jupiter    {\mbox{\wasyfamily\char88}}
+\def\saturn     {\mbox{\wasyfamily\char89}}
+\def\uranus     {\mbox{\wasyfamily\char90}}
+\def\neptune    {\mbox{\wasyfamily\char91}}
+\def\pluto      {\mbox{\wasyfamily\char92}}
+\let\aries      \vernal
+\def\taurus     {\mbox{\wasyfamily\char93}}
+\def\gemini     {\mbox{\wasyfamily\char94}}
+\def\cancer     {\mbox{\wasyfamily\char95}}
+\let\leo        \ascnode
+\def\virgo      {\mbox{\wasyfamily\char96}}
+\def\libra      {\mbox{\wasyfamily\char97}}
+\def\scorpio    {\mbox{\wasyfamily\char98}}
+\def\sagittarius{\mbox{\wasyfamily\char99}}
+\def\capricornus{\mbox{\wasyfamily\char100}}
+\def\aquarius   {\mbox{\wasyfamily\char101}}
+\def\pisces     {\mbox{\wasyfamily\char102}}
+\def\conjunction{{\wasyfamily\char86}}
+\def\opposition {{\wasyfamily\char87}}
+\def\APLstar    {\mbox{\wasyfamily\char69}}
+\def\APLlog     {\mbox{\wasyfamily\char22}}
+\def\APLbox     {\mbox{\wasyfamily\char126}}
+\def\APLup      {\mbox{\wasyfamily\char0}}
+\def\APLdown    {\mbox{\wasyfamily\char70}}
+\def\APLinput   {\mbox{\wasyfamily\char125}}
+\def\APLcomment {\mbox{\wasyfamily\char127}}
+\def\APLinv     {{\leavevmode\hbox to 0pt{$\div$\hss}\APLbox}}
+\def\APLuparrowbox{\mbox{\wasyfamily\char110}}
+\def\APLdownarrowbox{\mbox{\wasyfamily\char111}}
+\def\APLleftarrowbox{\mbox{\wasyfamily\char112}}
+\def\APLrightarrowbox{\mbox{\wasyfamily\char113}}
+\def\notbackslash{\wasy@over{\backslash}{-}}
+\def\notslash   {\wasy@over{/}{-}}
+\def\APLminus   {\leavevmode\raise0.7ex\hbox{$-$}}
+\def\APLnot#1{\wasy@over{\sim}{#1}}
+\def\APLcirc#1{\wasy@over{\circ}{#1}}
+\def\APLvert#1{\wasy@over{\vert}{#1}}
+\def\Bowtie     {\mbox{\wasyfamily\char49}}
+\def\leftturn   {\mbox{\wasyfamily\char34}}
+\def\rightturn  {\mbox{\wasyfamily\char33}}
+\def\photon     {\mbox{\wasyfamily\char58\char58\char58\char58}}
+\def\gluon      {\mbox{\wasyfamily\char81\char80\char80\char80%
+    \char80\char80\char80\char82}}
+\def\cent       {\mbox{\wasyfamily\char103}}
+\def\permil     {\mbox{\wasyfamily\char104}}
+\def\agemO      {{\wasyfamily\char48}}
+\def\thorn      {{\wasyfamily\char105}}
+\def\Thorn      {{\wasyfamily\char106}}
+\DeclareTextCommand{\dh}{OT1}{{\wasyfamily\char107}}
+\DeclareTextCommand{\DH}{OT1}{\leavevmode{\rm\setbox0\hbox{D}%
+    \hbox to\wd0{\kern 0.04em\char32\hss D}}}
+\def\openo      {{\wasyfamily\char108}}
+\def\inve       {{\wasyfamily\char85}}
+  \let\mho\undefined
+  \let\sqsupset\undefined \let\Join\undefined
+  \let\lhd\undefined      \let\Box\undefined
+  \let\unlhd\undefined    \let\Diamond\undefined
+  \let\rhd\undefined      \let\leadsto\undefined
+  \let\unrhd\undefined    \let\sqsubset\undefined
+  \DeclareMathSymbol\mho     {\mathord}{wasy}{"30}
+  \DeclareMathSymbol\Join    {\mathrel}{wasy}{"31}
+  \DeclareMathSymbol\Box     {\mathord}{wasy}{"32}
+  \DeclareMathSymbol\Diamond {\mathord}{wasy}{"33}
+  \DeclareMathSymbol\leadsto {\mathrel}{wasy}{"3B}
+  \DeclareMathSymbol\sqsubset{\mathrel}{wasy}{"3C}
+  \DeclareMathSymbol\sqsupset{\mathrel}{wasy}{"3D}
+  \DeclareMathSymbol\lhd     {\mathbin}{wasy}{"01}
+  \DeclareMathSymbol\unlhd   {\mathbin}{wasy}{"02}
+  \DeclareMathSymbol\LHD     {\mathbin}{wasy}{"10}
+  \DeclareMathSymbol\rhd     {\mathbin}{wasy}{"03}
+  \DeclareMathSymbol\unrhd   {\mathbin}{wasy}{"04}
+  \DeclareMathSymbol\RHD     {\mathbin}{wasy}{"11}
+  \DeclareMathSymbol\apprle  {\mathrel}{wasy}{"3E}
+  \DeclareMathSymbol\apprge  {\mathrel}{wasy}{"3F}
+  \DeclareMathSymbol\wasypropto   {\mathrel}{wasy}{"1D}
+  \DeclareMathSymbol\invneg  {\mathrel}{wasy}{"18}
+  \DeclareMathSymbol\ocircle {\mathbin}{wasy}{"23}
+  \DeclareMathSymbol\logof   {\mathrel}{wasy}{"16}
+  \DeclareMathSymbol\wasy@int  {\mathop}{wasy}{"72}
+  \DeclareMathSymbol\wasy@iint {\mathop}{wasy}{"73}
+  \DeclareMathSymbol\wasy@iiint{\mathop}{wasy}{"74}
+  \DeclareMathSymbol\wasy@oint {\mathop}{wasy}{"75}
+  \DeclareMathSymbol\wasy@oiint{\mathop}{wasy}{"76}
+\ifwasy@compatibility
+  \let\varint\wasy@int
+  \let\iint\wasy@iint
+  \let\iiint\wasy@iiint
+  \let\varoint\wasy@oint
+  \let\oiint\wasy@oiint
+\fi
+\AtBeginDocument{%
+  \ifwasy@integrals
+    \@ifpackageloaded{amsmath}{\wasy@amssetup}{\wasy@setup}
+  \fi
+}
+\endinput
+%%
+%% End of file `wasysym.sty'.