Commits

Marcus Autenrieth committed ee4f878

Cleaned up acronyms stuff. Minor improvements.

Comments (0)

Files changed (8)

 *.lof
 *.log
 *.out
+.*.swp
 \chapter*{Abstract}
 \blindtext
 
-\acresetall % Reset all acronyms
 % vim: set ft=tex

acrobib.py

-#!/usr/bin/env python
-# -*- coding: Latin-1 -*-
-
-"""
-The LaTeX 'acronym.sty' by default displays all acronyms specified in the
-'acronym' environment. In case you want to reuse existing acronym
-specifications and need to tailor the database to your needs, this script can
-help you.
-
-1.) Put all acronyms in a separate file like 'acrodb.tex' and '\input' it.
-2.) Write your thesis and add acronyms as needed.
-3.) When you are done writing, use this script to tailor the database to the
-    needs of your work.
-4.) Replace 'acrodb.tex' by 'acronyms.tex' in the '\input' command
-"""
-
-
-from glob import glob
-import re
-import sys
-
-
-# A list of regexes to specify used acronyms
-RE_USE = [
-    r"\\ac{([A-Za-z/1-9]*)}",
-    r"\\acf{([A-Za-z/1-9]*)}",
-    r"\\acs{([A-Za-z/1-9]*)}",
-    r"\\acp{([A-Za-z/1-9]*)}",
-    r"\\acfp{([A-Za-z/1-9]*)}",
-    r"\\acsp{([A-Za-z/1-9]*)}",
-    r"\\aclp{([A-Za-z/1-9]*)}",
-]
-
-
-# A regex for finding acronym definitions
-RE_DEF = r".*\\acro{([A-Za-z/1-9]*).*}"
-
-
-def read_used_acronyms(dbfile, outfile):
-    """ Extracts all used acronyms from all the .tex files except 'infile' and
-    'outfile', both parameters have to be filenames. Returns a 'set',
-    containing all the used acronyms.
-    """
-    acronyms = set()
-    filenames = glob("*.tex")
-    for filename in filenames:
-        if filename != dbfile and filename != outfile:
-            file = open(filename, 'r')
-            for line in file:
-                for rx in RE_USE:
-                    acros = set(re.findall(rx, line))
-                    acronyms.update(acros)
-    return acronyms
-
-
-def read_acronym_database(dbfile):
-    """ Reads in the database of acronyms and puts the acronym and it's
-    specification into a dictionary. The dict is of the form:
-       'acronym' --> 'description'
-    Afterwards that dict is returned.
-    """
-    acrodb = dict()  # dict for acronym database
-    acrofile = open(dbfile)
-    for line in acrofile:
-        match = re.match(RE_DEF, line)
-        if match:
-            acrodb[match.groups()[0]] = line
-        else:
-            line, " did not match"
-    return acrodb
-
-
-def output_tailored_db(acrodb, acronyms, outfile):
-    acroout = open(outfile, 'w')
-    acroout.write("""\\chapter{Used Acronyms}
-    \\begin{acronym}\n""")
-
-    # match and output acronyms against db
-    for acro in sorted(acronyms):
-        if acro in acrodb:
-            print ".",
-            acroout.write("\t" + acrodb[acro].strip() + "\n")
-        else:
-            print "Missing Acronym: %s" % (acro)
-
-    acroout.write("\\end{acronym}\n")
-    acroout.close()
-
-
-def usage():
-    """ acrobib.py [dbfile] [outfile]
-    When run without arguments, the following defaults are used:
-        dbfile = 'acrodb.tex'
-        outfile = 'acronyms.tex'
-    """
-
-
-def main():
-    dbfile = 'acrodb.tex'
-    outfile = 'acronyms.tex'
-    args = sys.argv
-    if len(args) > 1:
-        dbfile = args[1]
-    else:
-        print "Using database: 'acrodb.tex'"
-    if len(args) > 2:
-        outfile = args[2]
-    else:
-        print "Writing to 'acronyms.tex'"
-    acrodb = read_acronym_database(dbfile)
-    acronyms = read_used_acronyms(dbfile, outfile)
-    output_tailored_db(acrodb, acronyms, outfile)
-
-
-if __name__ == '__main__':
-    try:
-        main()
-    except e:
-        usage()
-        print "Backtrace: \n", e
-

acrodb.tex

-\chapter{Used Acronyms}
-\begin{acronym}
-% Information on how to use the acronyms can be found here: http://www.mackichan.com/index.html?techtalk/456.htm~mainFrame
-        \acro{API}{application programming interface}
-        \acro{ANF}[A\& F]{Amplify \& Forward}
-	\acro{ACK}{acknowledgment}
-	\acro{ARP}{address resolution protocol}
-        \acro{BLR}{Beaconless Routing}
-	\acro{BPSK}{binary phase shift keying}
-	\acro{CA}{collision avoidance}
-	\acro{CCA}{clear channel assessment}
-	\acro{CI}{confidence interval}
-	\acro{CL}{confidence level}
-        \acro{CNF}[C\& F]{Compress \& Forward}
-        \acro{CPU}{Central Processing Unit}
-	\acro{cRTS}{cooperative request-to-send}
-        \acro{CSMA}{carrier sense multiple access}
-        \acro{CSMA/CA}{\ac{CSMA} with \acf{CA}}
-	\acro{CTS}{clear-to-send}
-        \acro{CTP}{Collection Tree Protocol}
-	\acro{CVS}{concurrent versioning system}
-	\acro{DCF}{distributed coordination function}
-	\acro{DIFS}{\acs{DCF} inter-frame spacing}
-	\acro{DMA}{direct memory access}
-        \acro{DNF}[D\& F]{Decode \& Forward}
-	\acro{DSP}{digital signal processor}
-	\acro{EIFS}{extended inter-frame spacing}
-        \acro{EMA}{exponential moving average}
-        \acro{ETX}{expected transmissions}
-        \acro{ExOR}{Extremely Opportunistic Routing}
-	\acro{FCS}{frame checksum}
-        \acro{FER}{frame error rate}
-	\acro{FPGA}{field programmable gate array}
-	\acro{FTP}{file transfer protocol}
-        \acro{GeRaF}{Geographic Random Forwarding}
-	\acro{GP}{goodput}
-	\acro{GPS}{Global Positioning System}
-	\acro{HF}{high frequency}
-	\acro{IEEE}{Institute of Electrical and Electronics Engineers}
-	\acro{IHP}{Innovations for High Performance Microelectronics}
-	\acro{IP}{Internet Protocol}
-	\acro{ISR}{interrupt service routine}
-	\acro{JTAG}{Joint Test Action Group}
-	\acro{LAN}{local area network}
-	\acro{LED}{light emitting diode}
-	\acro{LOS}{line-of-sight}
-	\acro{LSB}{least significant bit} 
-	\acro{MAC}{medium access control}
-        \acro{MLA}{MAC Layer Architecture}
-        \acro{MLME}{MAC layer management entity}
-	\acro{MS}{milestone}
-	\acro{MSC}{message sequence chart}
-        \acro{MTU}{maximum transmission unit}
-	\acro{NAV}{network allocation vector}
-        \acro{NesC}{Networked embedded systems C}
-	\acro{NIF}{noise-and-interference floor}
-	\acro{NLOS}{non-line-of-sight}
-	\acro{OFDM}{orthogonal frequency-division multiplexing}
-        \acro{ORM}{object-relational mapping}
-	\acro{PER}{packet error rate}
-	\acro{PG1}{Project Group Mobile Communications 1}
-	\acro{PG2}{Project Group Mobile Communications 2}
-	\acro{PHY}{physical}
-        \acro{RBS}{referece brodcast synchronization scheme}
-	\acro{RF}{radio frontend}
-	\acro{RSSI}{received signal strength indicator}
-	\acro{RTS}{request-to-send}
-        \acro{SDF}{selection decode \& forward}
-	\acro{SDL}{Specification and Description Language}
-	\acro{SDR}{software-defined radio}
-	\acro{SIFS}{short inter-frame spacing}
-	\acro{SINR}{signal-to-interference-and-noise ratio}
-	\acro{SORBAS}{Signalion Software Radio Based Prototyping System}
-	\acro{SSH}{secure shell}
-	\acro{SSID}{service set identifier}
-	\acro{Sterm}{\acs{SORBAS} terminal}
-	\acro{TX}{transmission}
-        \acro{TDMA}{Time Division Multiple Access}
-        \acro{TEP}{TinyOS Enhancement Proposal}
-	\acro{UDP}{User Datagram Protocol}
-	\acro{USB}{Universal Serial Bus}
-        \acro{UPMA}{Unified radio Power Management Architecture}
-	\acro{VisualDSP}{Visual Digital Signal Processor}
-	\acro{VMware}{VMware Virtualization Software}
-	\acro{VoIP}{voice over \acs{IP}}
-	\acro{WinTerm}{SORBAS Windows Terminal}
-	\acro{WLAN}{wireless \acs{LAN}}
-        \acro{WMA}{weighted moving average}
-        \acro{WSN}{wireless sensor network}
-\end{acronym}
-
-% vim: set ft=latex
 \chapter{Used Acronyms}
-    \begin{acronym}
+\label{chap:acronyms}
+\begin{acronym}
+        \acro{API}{application programming interface}
+        \acro{ANF}[A\& F]{Amplify \& Forward}
+	\acro{ACK}{acknowledgment}
+	\acro{ARP}{address resolution protocol}
+        \acro{BLR}{Beaconless Routing}
+	\acro{BPSK}{binary phase shift keying}
+	\acro{CA}{collision avoidance}
+	\acro{CCA}{clear channel assessment}
+	\acro{CI}{confidence interval}
+	\acro{CL}{confidence level}
+        \acro{CNF}[C\& F]{Compress \& Forward}
+        \acro{CPU}{Central Processing Unit}
+	\acro{cRTS}{cooperative request-to-send}
+        \acro{CSMA}{carrier sense multiple access}
+        \acro{CSMA/CA}{\ac{CSMA} with \acf{CA}}
+	\acro{CTS}{clear-to-send}
+        \acro{CTP}{Collection Tree Protocol}
+	\acro{CVS}{concurrent versioning system}
+	\acro{DCF}{distributed coordination function}
+	\acro{DIFS}{\acs{DCF} inter-frame spacing}
+	\acro{DMA}{direct memory access}
+        \acro{DNF}[D\& F]{Decode \& Forward}
+	\acro{DSP}{digital signal processor}
+	\acro{EIFS}{extended inter-frame spacing}
+        \acro{EMA}{exponential moving average}
+        \acro{ETX}{expected transmissions}
+        \acro{ExOR}{Extremely Opportunistic Routing}
+	\acro{FCS}{frame checksum}
+        \acro{FER}{frame error rate}
+	\acro{FPGA}{field programmable gate array}
+	\acro{FTP}{file transfer protocol}
+        \acro{GeRaF}{Geographic Random Forwarding}
+	\acro{GP}{goodput}
+	\acro{GPS}{Global Positioning System}
+	\acro{HF}{high frequency}
+	\acro{IEEE}{Institute of Electrical and Electronics Engineers}
+	\acro{IHP}{Innovations for High Performance Microelectronics}
+	\acro{IP}{Internet Protocol}
+	\acro{ISR}{interrupt service routine}
+	\acro{JTAG}{Joint Test Action Group}
+	\acro{LAN}{local area network}
+	\acro{LED}{light emitting diode}
+	\acro{LOS}{line-of-sight}
+	\acro{LSB}{least significant bit} 
+	\acro{MAC}{medium access control}
+        \acro{MLA}{MAC Layer Architecture}
+        \acro{MLME}{MAC layer management entity}
+	\acro{MS}{milestone}
+	\acro{MSC}{message sequence chart}
+        \acro{MTU}{maximum transmission unit}
+	\acro{NAV}{network allocation vector}
+        \acro{NesC}{Networked embedded systems C}
+	\acro{NIF}{noise-and-interference floor}
+	\acro{NLOS}{non-line-of-sight}
+	\acro{OFDM}{orthogonal frequency-division multiplexing}
+        \acro{ORM}{object-relational mapping}
+	\acro{PER}{packet error rate}
+	\acro{PG1}{Project Group Mobile Communications 1}
+	\acro{PG2}{Project Group Mobile Communications 2}
+	\acro{PHY}{physical}
+        \acro{RBS}{referece brodcast synchronization scheme}
+	\acro{RF}{radio frontend}
+	\acro{RSSI}{received signal strength indicator}
+	\acro{RTS}{request-to-send}
+        \acro{SDF}{selection decode \& forward}
+	\acro{SDL}{Specification and Description Language}
+	\acro{SDR}{software-defined radio}
+	\acro{SIFS}{short inter-frame spacing}
+	\acro{SINR}{signal-to-interference-and-noise ratio}
+	\acro{SORBAS}{Signalion Software Radio Based Prototyping System}
+	\acro{SSH}{secure shell}
+	\acro{SSID}{service set identifier}
+	\acro{Sterm}{\acs{SORBAS} terminal}
+	\acro{TX}{transmission}
+        \acro{TDMA}{Time Division Multiple Access}
+        \acro{TEP}{TinyOS Enhancement Proposal}
+	\acro{UDP}{User Datagram Protocol}
+	\acro{USB}{Universal Serial Bus}
+        \acro{UPMA}{Unified radio Power Management Architecture}
+	\acro{VisualDSP}{Visual Digital Signal Processor}
+	\acro{VMware}{VMware Virtualization Software}
+	\acro{VoIP}{voice over \acs{IP}}
+	\acro{WinTerm}{SORBAS Windows Terminal}
+	\acro{WLAN}{wireless \acs{LAN}}
+        \acro{WMA}{weighted moving average}
+        \acro{WSN}{wireless sensor network}
 \end{acronym}
+
+% vim: set ft=latex

contribution1.tex

 \section{Filler Text}
 \Blindtext
 
+\section{A note on acornyms}
+This template uses a \LaTeX package for managing acronyms. Before usage, all
+acronyms should be entered into the database contained in
+\texttt{acronyms.tex} and can then be used. Example for acronyms are \ac{WSN},
+\ac{CNF} or Like you can see from appendix \ref{chap:acronyms} Only the used
+acronyms are shown in the final document.  \ac{IEEE}. If you want to used
+acronym commands within section-titles, use the \verb|\acs| or \verb|\acl|
+commands. You can manually reset the the arconyms marked as 'introduced', via
+the \verb|\acresetall| command. This command is already called after including
+the abstract into the main document (see \texttt{masterarbeit.tex}).
+
 
 
 % vim: set ft=tex

masterarbeit.pdf

Binary file modified.
 % -- Use this if you want some nicer fonts --
 \usepackage{mathptmx}
 \usepackage[scaled=0.9]{helvet}
-% \usepackage{courier} % I don't like courier
+% \usepackage{courier}            % I don't like courier, ascii looks better
 \usepackage{ascii}
 
-%\usepackage{latexsym}
-%\usepackage[thickspace]{SIunits}
-
 %%% Mathematik
 \usepackage{amsmath}
 \usepackage{amssymb}
 
 %%% Sonstiges
-\usepackage[below]{placeins} % Manages Floats
+\usepackage[below]{placeins}                   % Manages Floats
 %\usepackage{calc}
-\usepackage{ifthen}    % Needed for macros
-%\usepackage{url}      % Typeset clicable URL's 
-\usepackage{xspace}    % Useful for macros!
-\usepackage{acronym}   % Acronym management package
-\usepackage{blindtext} % Generates Lorem Ipsum for this template
-\usepackage{booktabs}  % Typesets optimal tables; see documentation
-%\usepackage{python}   % Python Scripting!
+\usepackage{ifthen}                            % Needed for macros
+%\usepackage{url}                              % Typeset clickable URL's 
+\usepackage{xspace}                            % Useful for macros!
+\usepackage[printonlyused]{acronym}   % Acronym management package
+\usepackage{blindtext}                         % Generates 'Lorem Ipsum' for this template
+\usepackage{booktabs}                          % Typesets optimal tables; see documentation
 
-\usepackage{tikz}      % If you want to use TikZ for some figures
-\input{img/tikzsetup}  % See img/tikzsetup.tex for further explanations
+\usepackage{tikz}                              % If you want to use TikZ for some figures
+\input{img/tikzsetup}                          % See img/tikzsetup.tex for further explanations
 
 %%% If you need code-listings
 %\usepackage{listings}
 \Maketitle
 
 \include{abstract}
+\acresetall       % Reset all acronyms
 
 \tableofcontents
 \listoffigures
 \part*{\appendixname}
 \include{appendixA}
 \include{appendixB}
-%\input{acronyms} % See acrodb.tex for info
-\input{acrodb}
+\input{acronyms}
 
 % Bibliography
 \bibliographystyle{plain}