texlive[42122] Master: revquantum (21sep16)

commits+karl at tug.org commits+karl at tug.org
Wed Sep 21 22:56:17 CEST 2016


Revision: 42122
          http://tug.org/svn/texlive?view=revision&revision=42122
Author:   karl
Date:     2016-09-21 22:56:17 +0200 (Wed, 21 Sep 2016)
Log Message:
-----------
revquantum (21sep16)

Modified Paths:
--------------
    trunk/Master/tlpkg/bin/tlpkg-ctan-check
    trunk/Master/tlpkg/tlpsrc/collection-science.tlpsrc

Added Paths:
-----------
    trunk/Master/texmf-dist/doc/latex/revquantum/
    trunk/Master/texmf-dist/doc/latex/revquantum/README.md
    trunk/Master/texmf-dist/doc/latex/revquantum/build.py
    trunk/Master/texmf-dist/doc/latex/revquantum/revquantum.pdf
    trunk/Master/texmf-dist/source/latex/revquantum/
    trunk/Master/texmf-dist/source/latex/revquantum/revquantum.dtx
    trunk/Master/texmf-dist/source/latex/revquantum/revquantum.ins
    trunk/Master/texmf-dist/tex/latex/revquantum/
    trunk/Master/texmf-dist/tex/latex/revquantum/revquantum.sty
    trunk/Master/tlpkg/tlpsrc/revquantum.tlpsrc

Added: trunk/Master/texmf-dist/doc/latex/revquantum/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/revquantum/README.md	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/revquantum/README.md	2016-09-21 20:56:17 UTC (rev 42122)
@@ -0,0 +1,70 @@
+# revquantum #
+
+This package attempts to solve, or at least mitigate, standard problems with
+writing quantum information papers in ``{revtex4-1}``. In particular:
+
+- Includes titles in BibTeX.
+- Allows for use of nicer-looking fonts via ``{mathpazo}``.
+- Configures ``{hyperref}`` to make nicer-looking links and to correctly use ``\autoref``.
+- Sets up ``{listings}`` for common scientific languages and legacy environments (Python, Mathematica and MATLAB).
+- Provides notation for quantum information and makes defining new notation easier.
+- Reduces boilerplate for author affiliations by providing a (rudimentary) database for a few departments.
+
+A major goal of this package is to reduce the amount of useless crap that needs to be copied and pasted between documents. In particular, a complete document can be written in just a few lines:
+
+```latex
+\documentclass[pra,aps,twocolumn,superscriptaddress,10pt]{revtex4-1}
+\usepackage[pretty,uselistings]{revquantum}
+
+\begin{document}
+
+\title{Example \textsf{revquantum} Document}
+
+\author{Christopher Granade}
+\email{cgranade at cgranade.com}
+\affilUSydPhys \affilEQUS
+
+\date{\today}
+
+\begin{abstract}
+    \TODO
+\end{abstract}
+
+\maketitle
+
+\bibliography{example}
+\appendix
+
+\end{document} 
+```
+
+## Installing ##
+
+Installing LaTeX packages outside of CTAN is a pain, and this is no exception. I'll submit there at some point to remove that difficulty. In the meantime, I think the following works on Unix-like systems. If not, let me know or pull request with better instructions.
+
+```bash
+$ latex revquantum.ins # Makes the actual .sty from the .dtx file.
+$ pdflatex revquantum.dtx # Makes documentation, such as it is.
+$ mkdir texdir/tex/latex/revquantum # Replace texdir with where you actually installed TeX (e.g. ~/texmf).
+$ cp revquantum.sty texdir/tex/latex/revquantum # As with above, replace texdir.
+$ texhash
+```
+
+Directions for Windows/MikTeX can be found thanks to [this useful StackOverflow answer](http://tex.stackexchange.com/questions/2063/how-can-i-manually-install-a-package-on-miktex-windows).
+
+## Using ##
+
+I'll write more complete documentation later (hopefully), but for now:
+
+- ``{braket}`` is automatically imported, defining ``\ket``, ``\bra`` and ``\braket``.
+- The notation commands ``\ii`` and ``\dd`` typeset roman "i" and "d" characters, respectively. More generally, ``\newrm{foo}`` creates a new command ``\foo`` that typesets ``foo`` in math-roman. ``{revquantum}`` comes with ``\e``, ``\TVD`` and ``\T`` predefined using ``\newrm``.
+- Similarly, ``\newoperator`` defines new commands which typeset using ``\operatorname``. By default, this is used to define ``\Tr``, ``\Cov``, ``\supp``, ``\diag`` and ``\rank``.
+- The commands ``\defeq``, ``\expect`` and ``\id`` define the common notation ``:=``, double-struck E and double-struck 1 (respectively).
+- ``\newaffil{NAME}{DESCRIPTION}`` defines a new affiliation command ``\affilNAME``.
+- The ``\todo`` command typesets its argument in purple and raises a warning when built. If ``{revquantum}`` is loaded with the ``[final]`` option, this warning is escalated to an error. Similarly, ``\TODO`` takes no argument but inserts the placeholder "TODO" and ``\todolist`` typesets an ``{itemize}`` environment in ``\todo``.
+
+## Known Issues ##
+
+- The BibTeX thing is an unforgivable hack. Thankfully, I'm not asking for anyone's forgiveness.
+- ``\autoref`` chokes on appendices, giving nonsense like "Section A". This should be fixable, though.
+- The use of the "UW" prefix for the University of Waterloo was probably a bad idea, and will likely change so as to not preclude other universities whose names start with "W".


Property changes on: trunk/Master/texmf-dist/doc/latex/revquantum/README.md
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/revquantum/build.py
===================================================================
--- trunk/Master/texmf-dist/doc/latex/revquantum/build.py	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/revquantum/build.py	2016-09-21 20:56:17 UTC (rev 42122)
@@ -0,0 +1,295 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+from __future__ import print_function, unicode_literals
+
+PACKAGE_NAME = 'revquantum'
+TEX_DIR = None
+
+import errno
+import sys
+import os
+import tempfile
+import shutil
+import zipfile
+from subprocess import Popen, PIPE
+
+from io import StringIO
+
+def print_usage():
+    print("""
+Usage:
+------
+
+python build.py tds
+    Builds a *.tds.zip file for this package.
+
+python build.py install
+    Installs this package into the main TeX directory.
+    May require administrator privileges.
+""")
+    sys.exit(1)
+
+def is_writable(dir_name):
+    # Technique adapted from:
+    #     http://stackoverflow.com/a/25868839/267841
+    # We modify by not raising on other OSErrors, as
+    # we don't care *why* a directory isn't writable,
+    # so much as that we need to know that it isn't.
+    # We also note that tempfile raises an IOError
+    # on Windows if it can't write, so we catch that,
+    # too.
+    try:
+        with tempfile.TemporaryFile(dir=dir_name):
+            pass
+    except (OSError, IOError) as ex:
+        return False
+    
+    return True
+
+def mkdir_p(path):
+    # Copied from http://stackoverflow.com/a/600612/267841,
+    # in keeping with the CC-BY-SA 3.0 license on StackOverflow
+    # user contributions.
+    if os.path.isdir(path):
+        return
+    try:
+        os.makedirs(path)
+    except OSError as exc:  # Python > 2.5
+        if exc.errno == errno.EEXIST and os.path.isdir(path):
+            pass
+        else:
+            raise
+    except WindowsError as exc:
+        if exc.errno == 183 and os.path.isdir(path):
+            pass
+        else:
+            raise
+
+def try_until(condition, *fns):
+    for fn in fns:
+        retval = fn()
+        if condition(retval):
+            return retval
+
+    # This is likely a terrible error for any poor user,
+    # so we should probably catch it. Probably.
+    raise RuntimeError("No candidates found matching the given condition.")
+
+def is_miktek():
+    # Assume MikTeX if and only if Windows.
+    # This is a bad assumption, but we can encapsulate
+    # it here and generalize later.
+    return os.name == 'nt'
+
+def find_tex_root():
+    proc = Popen(['kpsewhich', 'article.cls'], stdout=PIPE)
+    stdout, stderr = proc.communicate()
+
+    head, tail = os.path.split(stdout.strip())
+
+    # Note that kpsewhich returns with / characters, even
+    # under Windows, so we must use str.split to override
+    # os.path's behavior.
+    head_parts = head.split('/')
+
+    # If we're on Windows, then that destroyed the drive
+    # part of the pathspec.
+    if os.name == 'nt':
+        head_parts = [head_parts[0] + '\\'] + head_parts[1:]
+
+    # Remove "tex/latex/base" from head_parts, since that's where
+    # article.cls should live.
+    tex_root = os.path.join(*head_parts[:-3])
+
+    return tex_root
+
+def find_tex_user():
+    if is_miktek():
+        # Use MikTeX's initexmf utility to find the user install
+        # dir.
+        #     http://tex.stackexchange.com/a/69484/615
+        initexmf = Popen(['initexmf', '--report'], stdout=PIPE)
+        stdout, stderr = initexmf.communicate()
+
+        for line in stdout.split('\n'):
+            try:
+                key, value = line.split(':', 1)
+                if key.strip().lower() == 'userinstall':
+                    return value.strip()
+            except:
+                continue
+
+        raise RuntimeError("MikTeX did not report a UserInstall directory.")
+
+    else:
+        return os.path.expanduser('~/texmf')
+
+def find_tex():
+    global TEX_DIR
+
+    if TEX_DIR is None:
+        TEX_DIR = try_until(is_writable, 
+            find_tex_root,
+            find_tex_user
+        )
+
+    return TEX_DIR
+
+def copy_to_tex(what, tex_path=['tex', 'latex']):
+    tex_root = find_tex()
+    where = os.path.join(tex_root, *tex_path)
+    full_path = os.path.join(where, what)
+
+    # Check if the directory exists, make it if it doesn't.
+    mkdir_p(where)
+
+    print("Installing: {} ---> {}".format(what, full_path))
+    shutil.copyfile(what, full_path)
+
+def write_to_zip(zip_file, filename, arcname=None, normalize_crlf=None):
+    """
+    normalize_crlf = None: automatically detect from filename.
+    """
+
+    if normalize_crlf is None:
+        root, ext = os.path.splitext(filename)
+        if ext in ('.dtx', '.ins', '.txt', '.md', '.py', '.tex'):
+            normalize_crlf = True
+        else:
+            normalize_crlf = False
+
+    if arcname is None:
+        arcname = filename
+
+    if not normalize_crlf:
+        print("\tPacking: {} ---> {}".format(filename, arcname))
+        zip_file.write(filename, arcname=arcname)
+    else:
+        print("\tPacking: {} ---> {} (normalized line endings)".format(filename, arcname))
+        contents = StringIO(newline='\n')
+        with open(filename, 'r') as f:
+            for line in f:
+                contents.write(line.decode('utf-8'))
+        zip_file.writestr(
+            arcname,
+            contents.getvalue()
+        )
+
+def yes_proc(args, yes="yes"):
+    proc = Popen(args, stdin=PIPE)
+    while proc.returncode is None:
+        proc.communicate(yes)
+        proc.poll()
+
+    return proc.returncode == 0
+
+class LaTeXStyleBuilder(object):
+    """
+    Builds a DocStrip-formatted LaTeX style by running
+    the LaTeX processor on the appropriate *.dtx file.
+    """
+    style_name = None
+    manifest = {}
+    ctan_manifest = {}
+
+    def __init__(self, style_name):
+        self.style_name = style_name
+
+        self.manifest = {
+            '{}.{}'.format(style_name, ext):
+                path + [style_name]
+            for ext, path in
+            {
+                'sty': ['tex', 'latex'],
+                'pdf': ['doc', 'latex']
+            }.items()
+        }
+
+        self.ctan_manifest = [
+            '{}.dtx'.format(style_name),
+            '{}.ins'.format(style_name),
+            '{}.pdf'.format(style_name),
+            'build.py',
+            'README.md'
+        ]
+
+    def build_sty(self):
+        print("Building: {}.sty".format(self.style_name))
+        if not yes_proc(['latex', '{}.ins'.format(self.style_name)]):
+            raise RuntimeError
+        print("\n\n\n")
+        return self
+
+    def build_doc_pdf(self):
+        print("Building: {}.pdf".format(self.style_name))
+        if not yes_proc(['pdflatex', '{}.dtx'.format(self.style_name)]):
+            raise RuntimeError
+        print("\n\n\n")
+        return self
+
+    def build_tds_zip(self):
+        print("Building: {}.tds.zip".format(self.style_name))
+        tds_zip = zipfile.ZipFile('{}.tds.zip'.format(self.style_name), 'w')
+
+        for what, where in self.manifest.items():
+            assert os.path.isfile(what)
+            write_to_zip(tds_zip, what, arcname=os.path.join(*where + [what]))
+
+        print("\n\n\n")
+        return self
+
+    def build_ctan_zip(self):
+        print("Building: {}.zip".format(self.style_name))
+        ctan_zip = zipfile.ZipFile('{}.zip'.format(self.style_name), 'w')
+
+        for what in self.ctan_manifest:
+            assert os.path.isfile(what)
+            write_to_zip(ctan_zip, what, arcname=os.path.join(self.style_name, what))
+
+        print("\n\n\n")
+        return self
+
+    def install(self):
+        for what, where in self.manifest.items():
+            assert os.path.isfile(what)
+            copy_to_tex(what, where)
+
+        # Make sure to run texhash if we're not using MikTeX.
+        if not is_miktek():
+            print("Rehashing...")
+            texhash = Popen(['texhash'])
+            texhash.wait()
+
+        return self
+
+if __name__ == "__main__":
+    print("""
+WARNING: This installer is still in alpha, and is provided
+         as a convenience only. That said, this installer
+         may cause you to say unkind words in frustration
+         instead of providing the intended convenience.
+""")
+
+    if len(sys.argv) < 2:
+        print_usage()
+
+    else:
+        subcommand = sys.argv[1]
+        if subcommand not in ('tds', 'install', 'ctan'):
+            print("No such command {}, try either 'tds', 'install' or 'ctan'.")
+            print_usage()
+
+        builder = LaTeXStyleBuilder(PACKAGE_NAME)
+        builder.build_sty().build_doc_pdf()
+
+        if subcommand == 'tds':
+            builder.build_tds_zip()
+
+        elif subcommand == 'install':
+            builder.install()
+
+        elif subcommand == 'ctan':
+            builder.build_ctan_zip()
+
+        else:
+            assert False


Property changes on: trunk/Master/texmf-dist/doc/latex/revquantum/build.py
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/revquantum/revquantum.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/revquantum/revquantum.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/revquantum/revquantum.pdf	2016-09-21 20:55:21 UTC (rev 42121)
+++ trunk/Master/texmf-dist/doc/latex/revquantum/revquantum.pdf	2016-09-21 20:56:17 UTC (rev 42122)

Property changes on: trunk/Master/texmf-dist/doc/latex/revquantum/revquantum.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/source/latex/revquantum/revquantum.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/revquantum/revquantum.dtx	                        (rev 0)
+++ trunk/Master/texmf-dist/source/latex/revquantum/revquantum.dtx	2016-09-21 20:56:17 UTC (rev 42122)
@@ -0,0 +1,951 @@
+% \iffalse meta-comment
+%
+% Copyright (C) 2016 by Christopher Granade <cgranade at cgranade.com>
+% ---------------------------------------------------------------------------
+% This work may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+%   http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status `maintained'.
+%
+% The Current Maintainer of this work is Christopher Granade (cgranade at cgranade.com).
+%
+% This work consists of the files revquantum.dtx and revquantum.ins
+% and the derived filebase revquantum.sty.
+%
+% \fi
+%
+% \iffalse
+%<*driver>
+\ProvidesFile{revquantum.dtx}
+%</driver>
+%<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
+%<package>\ProvidesPackage{revquantum}
+%<*package>
+    [2016/09/21 v0.10 Build script fixes for CTAN submission.]
+%</package>
+%
+%<*driver>
+\documentclass{ltxdoc}
+\usepackage[pretty]{revquantum}[2015/12/29]
+\usepackage{xcolor}
+\EnableCrossrefs
+\CodelineIndex
+\RecordChanges
+\begin{document}
+  \DocInput{revquantum.dtx}
+  \PrintChanges
+  \PrintIndex
+\end{document}
+%</driver>
+% \fi
+%
+% \CheckSum{0}
+%
+% \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         \~}
+%
+% \changes{v0.10}{2016/09/21}{Build script fixes for CTAN submission.}
+% \changes{v0.09}{2016/09/20}{wlog fix, updates to affil database.}
+% \changes{v0.08}{2016/04/11}{Significant reworking to robustly configure colors and fonts in listings.}
+% \changes{v0.07}{2016/04/07}{Added citeneed macro, fixed TODO spacing.}
+% \changes{v0.06}{2016/04/04}{Fix for hyperref bug.}
+% \changes{v0.05}{2016/04/04}{BibTeX hack for missing babel languages.}
+% \changes{v0.04}{2015/12/30}{Added Color Universal Design color names, checks for incompatible packages.}
+% \changes{v0.03}{2015/11/26}{Integration of stmaryrd, better docs.}
+% \changes{v0.02}{2015/11/04}{Initial public version.}
+%
+% \DoNotIndex{\newcommand,\newenvironment}
+%
+% \providecommand*{\url}{\texttt}
+% \newcommand{\DescribeColor}[1]{%
+%     \DescribeMacro{#1}%
+%     {\color{#1} \textbullet}
+%
+% }
+%
+% \GetFileInfo{revquantum.dtx}
+% \title{The \textsf{revquantum} package}
+% \author{Christopher Granade \\ \url{cgranade at cgranade.com}}
+% \date{\fileversion~from \filedate}
+%
+% \maketitle
+%
+% \section{Introduction}
+%
+% The \textsf{revquantum} package provides a number of useful hacks to solve
+% common annoyances with the \textsf{revtex4-1} package, and to define notation
+% in common use within quantum information. In doing so, \textsf{revquantum}
+% imports and configures a number of commonly-available and used packages, and
+% where reasonable, provides fallbacks.
+%
+% The \textsf{revquantum} package also warns when users try to load packages which
+% are known to be incompatible with \textsf{revtex4-1}. In particular, loading the following
+% packages will cause warnings:
+%
+% \begin{itemize}
+%     \item \textsf{subcaption}
+% \end{itemize}
+%
+% Yes, this is a short list. It will get longer.
+%
+% \section{Usage}
+%
+% \textbf{NB:} \textsf{revquantum} must be loaded first unless |nobibtexhacks|
+% is passed.
+%
+% \subsection{Package Options}
+%
+% The \textsf{revquantum} package provides several options to configure its behavior.
+% These can be used in the traditional way, as optional arguments to |\usepackage|.
+% For instance, this document was prepared using |\usepackage[pretty]{revquantum}|.
+%
+% \DescribeMacro{[final]}
+%
+% Removes support for TODO commands (see below), causing them to escalate from
+% warnings to errors.
+%
+% \DescribeMacro{[pretty]}
+%
+% Uses the \textsf{mathpazo} package to typeset the document
+% more nicely than the default for \textsf{revtex4-1} drafts.
+%
+% \DescribeMacro{[uselistings]}
+%
+% Includes the \textsf{listings} package and configures it for
+% literate and math-escape notation in Python, Mathematica and MATLAB.
+%
+% \DescribeMacro{[nobibtexhacks]}
+%
+% Prevents \textsf{revquantum} from patching the \BibTeX support provided
+% by \textsf{revtex4-1} to include titles.
+%
+% \DescribeMacro{[strict]}
+%
+% Causes package incompatibility warnings to become errors.
+%
+% \subsection{New Commands}
+%
+% \subsubsection{TODO Annotations}
+%
+% \DescribeMacro{\todo} \marg{annotation}
+%
+% Marks an incompleted task in a different color in the document, and raises
+% a warning in the LaTeX log.
+%
+% \DescribeMacro{\TODO}
+% \TODO
+%
+% \DescribeMacro{\todolist} \marg{contents}
+%
+% Typesets \emph{contents} as a TODO annotation, wrapped in an |{enumerate}|
+% environment.
+%
+% \subsubsection{Mathematical Notation}
+%
+% This package also provides commands for notation common in quantum information.
+%
+% \DescribeMacro{\ii}
+% \DescribeMacro{\dd}
+%
+% These commands typeset the imaginary unit $\ii$ and differential element $\dd$,
+% respectively, in math roman.
+%
+% \DescribeMacro{\defeq}
+%
+% This command uses |\mathrel| to properly format the colon-equals operator
+% as a relation operator.
+%
+% \DescribeMacro{\expect}
+% Typesets the expectation operator $\expect$.
+%
+% \DescribeMacro{\id}
+%
+% \todo{The current implementation of id is to call openone, provided by revtex4-1,
+% and thus not available when used from documentation.}
+%
+% \DescribeMacro{\llbracket}
+% \DescribeMacro{\rrbracket}
+%
+% Typesets the double-square brackets commonly used to denote stabilizer code
+% properties, as in $\llbracket n, k, d \rrbracket$. These commands are provided
+% by |{stmaryrd}|, and are given a reasonable fallback if that package is not
+% available.
+%
+%
+%
+% \subsubsection{Affiliation Database}
+%
+% The \textsf{revquantum} package provides commands for quickly typesetting
+% affiliations, with an eye towards reducing copy-paste errors when authors have
+% a nontrivial set of shared affiliations.
+%
+% \DescribeMacro{\newaffil} \marg{shorthand} \marg{description}
+%
+% The workhorse of the affiliation database is the |\newaffil| command,
+% which defines a new command that expands to call the \textsf{revtex4-1}
+% |\affiliation| command. For instance, |\newaffil{UFooBar}{Bar, UFoo}|
+% defines a new command |\affilUFooBar| that expands to
+% |\affiliation{Bar, UFoo}|.
+%
+% So far, the following affiliation commands are provided:
+%
+% \DescribeMacro{\affilTODO} Special, marks that an affiliation is not
+% provided.
+%
+%
+% \DescribeMacro{\affilEQuSUSyd} Centre for Engineered Quantum Systems, University of Sydney.
+%
+% \DescribeMacro{\affilEQuSMacq} Centre for Engineered Quantum Systems, Macquarie University.
+%
+% \DescribeMacro{\affilUSydPhys} School of Physics, University of Sydney.
+%
+% \DescribeMacro{\affilIQC} Institute for Quantum Computing, University of Waterloo.
+%
+% \DescribeMacro{\affilUWPhys} Department of Physics, University of Waterloo.
+%
+% \DescribeMacro{\affilUWAMath} Department of Applied Mathematics, University of Waterloo.
+%
+% \DescribeMacro{\affilUWChem} Department of Chemistry, University of Waterloo.
+%
+% \DescribeMacro{\affilPI} Perimeter Institute for Theoretical Physics.
+%
+% \DescribeMacro{\affilCIFAR} Canadian Institute for Advanced Research.
+%
+% \DescribeMacro{\affilCQuIC} Center for Quantum Information and Control, University of New Mexico.
+%
+% \DescribeMacro{\affilIBMTJW} IBM T. J. Watson Research Center.
+%
+%
+% \subsubsection{Internal-Use Commands}
+%
+% \DescribeMacro{\booloption}
+% \DescribeMacro{\newnew}
+%
+% These commands are used internally by \textsf{revquantum} to define
+% new boolean package options, and to declare new kinds of |\newcommand|
+% commands. For example, |\newnew| is used to define |\newoperator|,
+% which in turn defines new commands for named mathematical operators (e.g. $\Tr$).
+%
+% \DescribeMacro{\sectionautorefname}
+% \DescribeMacro{\algorithmautorefname}
+% \DescribeMacro{\equationautorefname}
+% \DescribeMacro{\lemmaautorefname}
+%
+% These commands configure \textsf{hyperref}'s \texttt{autoref} command
+% for use with \textsf{revtex4-1}, so that \texttt{autoref} correctly
+% describes Section, Algorithm, and Lemma, and also follows the standard
+% notation for equation references.
+%
+% \DescribeMacro{\boolean{@xetex}}
+%
+% This boolean variable uses \textsf{iftex} to check if XeTeX is installed.
+% If \textsf{iftex} is not available, then we assume plain LaTeX.
+%
+% \subsection{New Colors}
+%
+% The \textsf{revquantum} package also provides a color palette
+% that is safe for colorblind readers and for printing, the
+% \href{http://jfly.iam.u-tokyo.ac.jp/color/}{Color Universal
+% Design} palette of Okabe and Ito.
+%
+% \DescribeColor{cud-black}         
+% \DescribeColor{cud-orange}        
+% \DescribeColor{cud-sky-blue}      
+% \DescribeColor{cud-bluish-green}  
+% \DescribeColor{cud-yellow}        
+% \DescribeColor{cud-blue}          
+% \DescribeColor{cud-vermillion}    
+% \DescribeColor{cud-reddish-purple}
+%
+% These colors are defined as \textsf{xcolor} color names, such that they
+% can be used in all packages which depend on \textsf{xcolor}. In particular,
+% CUD colors can be directly used from \textsf{tikz}. To use with \textsf{tikz},
+% however, \textsf{revquantum} must be loaded \emph{after} \textsf{tikz}.
+%
+% \StopEventually{}
+%
+% \section{Implementation}
+%
+% \iffalse
+%<*package>
+% \fi
+%
+
+
+
+%    \begin{macrocode}
+
+\usepackage{ifthen}
+
+%    \end{macrocode}
+
+% \subsection{XeTeX Detection} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% We make a new boolean variable to track if XeTeX is being used.
+
+%    \begin{macrocode}
+
+\newboolean{@xetex}
+\setboolean{@xetex}{false}
+\IfFileExists{iftex.sty}{
+    \wlog{[INFO] iftex loaded}
+    \usepackage{iftex}
+}{
+    \newif\ifXeTeX
+    \XeTeXfalse
+}
+\ifXeTeX
+    \wlog{[INFO] Using XeTeX}
+    \setboolean{@xetex}{true}
+\else
+    \setboolean{@xetex}{false}
+\fi
+
+%    \end{macrocode}
+
+
+% \subsection{Notation} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+%
+% \begin{macro}{\newnew}
+%    \begin{macrocode}
+\newcommand{\newnew}[2]{
+    \expandafter\newcommand\csname new#1\endcsname[1]{
+      \expandafter\newcommand\csname ##1\endcsname{#2{##1}}
+    }
+}
+%    \end{macrocode}
+% \end{macro}
+%
+%    \begin{macrocode}
+\newnew{operator}{\operatorname}
+\newnew{rm}{\mathrm}
+
+\newoperator{Tr}
+\newoperator{Cov}
+\newoperator{supp}
+\newoperator{diag}
+\newoperator{rank}
+
+%    \end{macrocode}
+%
+% \begin{macro}{\ii}
+%    \begin{macrocode}
+\newcommand{\ii}{\mathrm{i}} % Outside what newnew currently supports.
+%    \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\dd}
+%    \begin{macrocode}
+\newcommand{\dd}{\mathrm{d}} % Outside what newnew currently supports.
+%    \end{macrocode}
+% \end{macro}
+%
+%    \begin{macrocode}
+
+\newrm{e}
+\newrm{TVD}
+\newrm{T}
+
+%    \end{macrocode}
+%
+% \begin{macro}{\defeq}
+%    \begin{macrocode}
+\newcommand{\defeq}{\mathrel{:=}}
+%    \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\expect}
+%    \begin{macrocode}
+\newcommand{\expect}{\mathbb{E}}
+%    \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\id}
+%    \begin{macrocode}
+\newcommand{\id}{\openone}
+%    \end{macrocode}
+% \end{macro}
+%
+%    \begin{macrocode}
+
+%    \end{macrocode}
+
+% We want to only conditionally use |{stmaryrd}| if it's available, and
+% otherwise, hack up a few commands from that package.
+%
+%    \begin{macrocode}
+    \IfFileExists{stmaryrd.sty}{
+        \RequirePackage{stmaryrd}
+    }{
+        \PackageWarning{revquantum}{
+            The stmaryrd package is not available,
+            so some commands (e.g.: double-brackets) will look wrong.
+        }
+        \newcommand{\llbracket}{[\!\!\hspace{1.5pt}[}
+        \newcommand{\rrbracket}{]\!\!\hspace{1.5pt}]}
+    }
+%    \end{macrocode}
+
+
+% \subsection{Options Handling} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% We will need to define a few options to make the package nicer to use. We do
+% so by making a new command, |\booloption| \marg{boolname} \marg{optionname}
+% \marg{default}.
+% \begin{macro}{\booloption}
+%    \begin{macrocode}
+\newcommand{\booloption}[3]{
+    \newboolean{#1}
+    \setboolean{#1}{#3}
+    \ifthenelse{\equal{#3}{true}}{
+%    \end{macrocode}
+% Default is true, so we need a "no" option to
+% turn off the new boolean.
+%    \begin{macrocode}
+        \DeclareOption{no#2}{\setboolean{#1}{false}}
+    }{
+%    \end{macrocode}
+% Default is false, so we need an option to turn
+% on the new boolean.
+%    \begin{macrocode}
+        \DeclareOption{#2}{\setboolean{#1}{true}}
+    }
+}
+%    \end{macrocode}
+% \end{macro}
+
+% We then use this new command to define the options for \textsf{revquantum},
+% |final|, |pretty|, |uselistings|, |nobibtexhacks|, and |strict|.
+
+%    \begin{macrocode}
+
+\booloption{@final}{final}{false}
+\booloption{@pretty}{pretty}{false}
+\booloption{@uselistings}{uselistings}{false}
+\booloption{@bibtexhacks}{bibtexhacks}{true}
+\booloption{@strict}{strict}{false}
+
+\ProcessOptions\relax
+
+%    \end{macrocode}
+
+% For the |strict| option, we do one last thing and define a new macro that
+% either raises a warning or an option depending on whether |strict| has been
+% set as an option.
+
+% \begin{macro}{\rq at quasiwarn}
+%    \begin{macrocode}
+\ifthenelse{\boolean{@strict}}{
+    \newcommand{\rq at quasiwarn}{
+        \PackageError{revquantum}
+    }
+}{
+    \newcommand{\rq at quasiwarn}{
+        \PackageWarning{revquantum}
+    }
+}
+%    \end{macrocode}
+% \end{macro}
+
+% \subsection{Unforgivable BibTeX Hacks} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% These hacks include the title of each reference in the BibTeX output by
+% redefining the part of \textsf{revtex4-1} on the fly which is responsible
+% for writing out the bibdata. Note that these hacks \emph{must} come before
+% importing packages, or else \textsf{revtex4-1} will have already written out
+% its control notes.
+
+%    \begin{macrocode}
+
+\ifthenelse{\boolean{@bibtexhacks}}{\def\@bibdataout at aps{%
+ \immediate\write\@bibdataout{%
+  @CONTROL{%
+   apsrev41Control,author="08",editor="1",pages="0",title="0",year="1",eprint="1"%
+  }%
+ }%
+ \if at filesw
+  \immediate\write\@auxout{\string\citation{apsrev41Control}}%
+ \fi
+}}{}
+
+%    \end{macrocode}
+
+% \subsection{Imports} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% Here, we import a few other useful packages and configure them according to
+% the options passed by the user. In handling the fonts specified by
+% |[pretty]|, we must be careful to do so in a way that is supported by
+% XeTeX.
+% Note that we only load \textsf{color} if
+% neither \textsf{tikz} nor \textsf{xcolor} have already been imported, and if
+% we are not using \textsf{listings}. In the latter case, we will load
+% \textsf{xcolor} instead so that we can make \textsf{listings} play nicer with
+% our own custom palette.
+% Also of
+% note is that we do not import \textsf{hyperref} yet, as it must go last to avoid duplicating
+% reference names.
+
+%    \begin{macrocode}
+
+\RequirePackage{amsmath}
+\RequirePackage{amsfonts}
+\RequirePackage{amsthm}
+\RequirePackage{amssymb}
+\RequirePackage{amsbsy}
+\@ifpackageloaded{tikz}{}{%
+    \@ifpackageloaded{xcolor}{}{%
+        \ifthenelse{\boolean{@uselistings}}{}{%
+            \RequirePackage[usenames,dvipsnames]{color}%
+        }%
+    }%
+    \AtBeginDocument{%
+        \@ifpackageloaded{tikz}{%
+            \rq at quasiwarn{tikz loaded, but after revquantum. This may not work.}%
+        }%
+    }%
+}
+\RequirePackage{braket}
+\RequirePackage{graphicx}
+\RequirePackage[english]{babel}
+\ifthenelse{\boolean{@pretty}}{
+    \ifthenelse{\boolean{@xetex}}{
+        % http://tex.stackexchange.com/a/50593
+        \usepackage{fontspec}
+        \usepackage{mathpazo}
+        \setmainfont
+         [ BoldFont       = texgyrepagella-bold.otf ,
+           ItalicFont     = texgyrepagella-italic.otf ,
+           BoldItalicFont = texgyrepagella-bolditalic.otf ]
+         {texgyrepagella-regular.otf}
+    }{
+        \RequirePackage{mathpazo}
+    }
+}{}
+\ifthenelse{\boolean{@uselistings}}{
+    \RequirePackage{xcolor}
+    \RequirePackage{listings}
+    \RequirePackage{textcomp} % Make sure we have a ` for writing Mathematica.
+}{}
+\ifthenelse{\boolean{@bibtexhacks}}{
+    \RequirePackage{letltxmacro}
+}{}
+%    \end{macrocode}
+
+% \subsubsection{Theorem Environments}
+
+%    \begin{macrocode}
+
+\newtheorem{theorem}{Theorem}
+\newtheorem{lemma}{Lemma}
+
+%    \end{macrocode}
+
+% \subsubsection{\textsf{algorithm} and \textsf{algpseudocode} Setup}
+
+%    \begin{macrocode}
+
+\RequirePackage{algorithm}
+\RequirePackage{algpseudocode}
+    \renewcommand{\algorithmicrequire}{\textbf{Input:}}
+    \renewcommand{\algorithmicensure}{\textbf{Output:}}
+    \newcommand{\inlinecomment}[1]{\Comment {\footnotesize #1} \normalsize}
+    \newcommand{\linecomment}[1]{\State \(\triangleright\) {\footnotesize #1} \normalsize}
+
+%    \end{macrocode}
+
+% \subsubsection{\textsf{listings} Setup}
+
+% Here, we provide special support for scientific languages like Python and Mathematica,
+% as well as for legacy environments. This support consists of configuring escapes,
+% quoting, providing additional keywords, etc.
+
+%    \begin{macrocode}
+
+\ifthenelse{\boolean{@uselistings}}{
+    \definecolor{comment-color}{gray}{0.5}
+
+    \lstset{
+        basicstyle=\footnotesize,
+        commentstyle=\color{comment-color},
+        frame=lines,
+        gobble=4,
+        numbers=left,
+        numberstyle=\tiny, stepnumber=5,
+        numbersep=5pt,
+        keywordstyle=\color{cud-bluish-green!85!black}\bfseries,
+        keywordstyle={[2]\color{cud-sky-blue!75!black}},
+        emphstyle=\color{cud-vermillion}
+    }
+
+    \ifthenelse{\boolean{@xetex}}{
+        \RequirePackage{sourcecodepro}
+        \lstset{basicstyle=\footnotesize\sourcecodepro}
+    }{}
+
+    \lstdefinestyle{matlab}{
+        language=MATLAB,
+        mathescape=true
+    }
+
+    \lstdefinestyle{python}{
+        language=Python,
+        mathescape=true,
+        showstringspaces=false,
+        morekeywords={as,async,await}
+    }
+
+    \lstdefinestyle{mathematica}{
+        language=Mathematica,
+        upquote=true, % Needed to deal with the context symbol `.'
+        literate=
+            {->}{$\to$}1
+            {!=}{$\neq$}1
+            {\\[DoubleStruckOne]}{${\id}$}1
+            {\\[Sigma]}{$\sigma$}1
+            {(x)}{$\otimes$}1 % CG: I have the distinct impression this will break. Badly.
+    }
+}{}
+
+%    \end{macrocode}
+
+% \subsection{Import Warnings} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% The following command will cause a warning to be emitted if the package
+% named by its argument is loaded. To make robust against the order in which
+% packages are loaded, all such logic happens at |\begin{document}|. This
+% code is adapted from the solution provided by Martin Scharrer at
+% \url{http://tex.stackexchange.com/a/16200/615}.
+
+% \begin{macro}{\rq at warnpackage}
+%    \begin{macrocode}
+\newcommand{\rq at warnpackage}[1]{
+    \AtBeginDocument{%
+        \@ifpackageloaded{#1}{%
+            \rq at quasiwarn{The #1 package is known to be incompatible with revtex4-1. You may encounter problems using this package.}%
+        }{}
+    }
+}
+%    \end{macrocode}
+% \end{macro}
+
+% With this command in place, we can now issue specific warnings for individual
+% ``bad'' packages.
+
+%    \begin{macrocode}
+\rq at warnpackage{subcaption}
+%    \end{macrocode}
+
+
+% \subsection{Slightly More Forgivable BibTeX Hacks} %%%%%%%%%%%%%%%%%%%%%%%%%
+
+% Next, we include \href{http://tex.stackexchange.com/a/199299/615}{a solution
+% suggested by egreg} for a rather annoying |{revtex4-1}| bug. In particular,
+% we will set up |language={en}| as an alias for |language={english}|, so that
+% |{revtex4-1}| will no longer raise |{babel}| errors for the undefined language.
+
+% \begin{macro}{\ORIGselectlanguage}
+%    \begin{macrocode}
+
+\LetLtxMacro{\ORIGselectlanguage}{\selectlanguage}
+\DeclareRobustCommand{\selectlanguage}[1]{%
+  \@ifundefined{alias@\string#1}
+    {\ORIGselectlanguage{#1}}
+    {\begingroup\edef\x{\endgroup
+       \noexpand\ORIGselectlanguage{\@nameuse{alias@#1}}}\x}%
+}
+
+%    \end{macrocode}
+% \end{macro}
+
+% \begin{macro}{\definelanguagealias}
+%    \begin{macrocode}
+
+\newcommand{\definelanguagealias}[2]{%
+  \@namedef{alias@#1}{#2}%
+}
+
+%    \end{macrocode}
+% \end{macro}
+
+%    \begin{macrocode}
+
+\definelanguagealias{en}{english}
+\definelanguagealias{EN}{english}
+\definelanguagealias{English}{english}
+
+%    \end{macrocode}
+
+
+% \subsection{TODO Support} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% These commands provide a way of marking items as needing to be done before
+% the final version (denoted by the |final| package option).
+
+% \begin{macro}{\todo}
+%    \begin{macrocode}
+
+\ifthenelse{\boolean{@final}}{
+    \newcommand{\todo}[1]{%
+        \PackageError{revquantum}{Unaddressed TODO}%
+        \rq at todo{#1}%
+    }
+}{
+    \newcommand{\todo}[1]{%
+        \PackageWarning{revquantum}{Unaddressed TODO}%
+        \rq at todo{#1}%
+    }
+}
+
+%    \end{macrocode}
+% \end{macro}
+%
+% We also define a |\citeneed| command for the special case of a missing citation.
+% As per Steve Flammia's suggestion, this is formatted in analogy to the infamous
+% Wikipedia annotation.
+%
+% \begin{macro}{\citeneed}
+%     \begin{macrocode}
+\ifthenelse{\boolean{@final}}{
+    \newcommand{\citeneed}{%
+        \PackageError{revquantum}{citation needed}%
+        \rq at todo{[citation needed]}%
+    }
+}{
+    \newcommand{\citeneed}{%
+        \PackageWarning{revquantum}{citation needed}%
+        \rq at todo{[citation needed]}%
+    }
+}
+%    \end{macrocode}
+% \end{macro}
+%
+% Both of these macros are based on the |\rq at todo| macro, which performs the
+% formatting for TODOs.
+%
+% \begin{macro}{\rq at todo}
+%    \begin{macrocode}
+\newcommand{\rq at todo}[1]{%
+    {\color{magenta} #1}%
+}
+%    \end{macrocode}
+% \end{macro}
+%
+% We also provide a few other special cases below.
+%
+% \begin{macro}{\TODO}
+%    \begin{macrocode}
+\newcommand{\TODO}{\todo{TODO}}
+%    \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\todolist}
+%    \begin{macrocode}
+\newcommand{\todolist}[1]{\todo{
+    \begin{itemize}
+        #1
+    \end{itemize}
+}}
+
+%    \end{macrocode}
+% \end{macro}
+
+% \subsection{Color Universal Design} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%    \begin{macrocode}
+\definecolor{cud-black}         {RGB}{0,0,0}
+\definecolor{cud-orange}        {RGB}{230,159,0}
+\definecolor{cud-sky-blue}      {RGB}{86,180,233}
+\definecolor{cud-bluish-green}  {RGB}{0,158,115}
+\definecolor{cud-yellow}        {RGB}{240,228,66}
+\definecolor{cud-blue}          {RGB}{0,114,178}
+\definecolor{cud-vermillion}    {RGB}{213,94,0}
+\definecolor{cud-reddish-purple}{RGB}{204,121,167}
+%    \end{macrocode}
+
+% \subsection{Affiliation Database} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% \begin{macro}{\newaffil}
+%    \begin{macrocode}
+\newcommand{\newaffil}[2]{
+    \expandafter\newcommand\csname affil#1\endcsname{
+        \affiliation{
+            #2
+        }
+    }
+}
+%    \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{General Affiliations}
+%
+%    \begin{macrocode}
+
+\newaffil{TODO}{\TODO}
+
+%    \end{macrocode}
+%
+% \subsubsection{Australia}
+%
+%    \begin{macrocode}
+
+\newaffil{EQuSUSyd}{
+    Centre for Engineered Quantum Systems,
+    University of Sydney,
+    Sydney, NSW, Australia
+}
+\newaffil{EQuSMacq}{
+    Centre for Engineered Quantum Systems,
+    Macquarie University,
+    Sydney, NSW, Australia
+}
+\newaffil{USydPhys}{
+    School of Physics,
+    University of Sydney,
+    Sydney, NSW, Australia
+}
+
+%    \end{macrocode}
+%
+% \subsubsection{Canada}
+%
+%    \begin{macrocode}
+
+\newaffil{IQC}{
+    Institute for Quantum Computing,
+    University of Waterloo,
+    Waterloo, ON, Canada
+}
+\newaffil{UWPhys}{
+    Department of Physics,
+    University of Waterloo,
+    Waterloo, ON, Canada
+}
+\newaffil{UWAMath}{
+    Department of Applied Mathematics,
+    University of Waterloo,
+    Waterloo, ON, Canada
+}
+\newaffil{UWChem}{
+    Department of Chemistry,
+    University of Waterloo,
+    Waterloo, ON, Canada
+}
+\newaffil{PI}{
+    Perimeter Institute for Theoretical Physics,
+    31 Caroline St. N,
+    Waterloo, Ontario, Canada N2L 2Y5
+}
+\newaffil{CIFAR}{
+    Canadian Institute for Advanced Research,
+    Toronto, ON, Canada
+}
+
+%    \end{macrocode}
+%
+% \subsubsection{United States}
+%
+%    \begin{macrocode}
+
+\newaffil{CQuIC}{
+    Center for Quantum Information and Control,
+    University of New Mexico,
+    Albuquerque, NM 87131-0001, USA
+}
+\newaffil{IBMTJW}{
+    IBM T. J. Watson Research Center,
+    Yorktown Heights, New York 10598, USA
+}
+
+
+%    \end{macrocode}
+
+
+% \subsection{\textsf{hyperref} Setup} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% Finally, we load \textsf{hyperref} separately so that it can go last.
+
+% Get rid of \textsf{hyperref}'s ugly boxes.
+%From:http://tex.stackexchange.com/a/51349
+%    \begin{macrocode}
+
+\RequirePackage[breaklinks=true]{hyperref}
+
+\hypersetup{
+  colorlinks   = true, %Colours links instead of ugly boxes
+  urlcolor     = blue, %Colour for external hyperlinks
+  linkcolor    = blue, %Colour of internal links
+  citecolor    = red %Colour of citations
+}
+
+%    \end{macrocode}
+
+
+% \subsubsection{\textsf{autoref} Setup}
+% We must declare our \textsf{autoref} configuration at the beginning
+% of the document to keep other packages from clobbering it.
+
+% \begin{macro}{\sectionautorefname}
+%    \begin{macrocode}
+\AtBeginDocument{%
+    \def\sectionautorefname{Section}%
+}
+%    \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\algorithmautorefname}
+%    \begin{macrocode}
+\AtBeginDocument{%
+    \def\algorithmautorefname{Algorithm}%
+}
+%    \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\equationautorefname}
+% See http://tex.stackexchange.com/a/66150.
+%    \begin{macrocode}
+\AtBeginDocument{%
+    \def\equationautorefname~#1\null{(#1)\null}%
+}
+%    \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\lemmaautorefname}
+%    \begin{macrocode}
+\AtBeginDocument{%
+    \newcommand{\lemmaautorefname}{Lemma}%
+}
+%    \end{macrocode}
+% \end{macro}
+%
+% \iffalse
+%</package>
+% \fi
+%
+% \Finale
+\endinput


Property changes on: trunk/Master/texmf-dist/source/latex/revquantum/revquantum.dtx
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/source/latex/revquantum/revquantum.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/revquantum/revquantum.ins	                        (rev 0)
+++ trunk/Master/texmf-dist/source/latex/revquantum/revquantum.ins	2016-09-21 20:56:17 UTC (rev 42122)
@@ -0,0 +1,55 @@
+%%
+%% Copyright (C) 2015 by Christopher Granade <cgranade at cgranade.com>.
+%%
+%% This file may be distributed and/or modified under the conditions of
+%% the LaTeX Project Public License, either version 1.3 of this license
+%% or (at your option) any later version.  The latest version of this
+%% license is in:
+%% 
+%%    http://www.latex-project.org/lppl.txt
+%% 
+%% and version 1.3 or later is part of all distributions of LaTeX version
+%% 2005/12/01 or later.
+%%
+
+\input docstrip.tex
+\keepsilent
+
+\usedir{tex/latex/revquantum}
+
+\preamble
+
+This is a generated file.
+
+Copyright (C) 2015 by Christopher Granade <cgranade at cgranade.com>.
+
+This file may be distributed and/or modified under the conditions of
+the LaTeX Project Public License, either version 1.3 of this license
+or (at your option) any later version.  The latest version of this
+license is in:
+
+   http://www.latex-project.org/lppl.txt
+
+and version 1.3 or later is part of all distributions of LaTeX version
+2005/12/01 or later.
+
+\endpreamble
+
+\generate{\file{revquantum.sty}{\from{revquantum.dtx}{package}}}
+
+\obeyspaces
+\Msg{*************************************************************}
+\Msg{*                                                           *}
+\Msg{* To finish the installation you have to move the following *}
+\Msg{* file into a directory searched by TeX:                    *}
+\Msg{*                                                           *}
+\Msg{*     revquantum.sty                                        *}
+\Msg{*                                                           *}
+\Msg{* To produce the documentation run the file revquantum.dtx  *}
+\Msg{* through LaTeX.                                            *}
+\Msg{*                                                           *}
+\Msg{* Happy TeXing!                                             *}
+\Msg{*                                                           *}
+\Msg{*************************************************************}
+
+\endbatchfile

Added: trunk/Master/texmf-dist/tex/latex/revquantum/revquantum.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/revquantum/revquantum.sty	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/revquantum/revquantum.sty	2016-09-21 20:56:17 UTC (rev 42122)
@@ -0,0 +1,429 @@
+%%
+%% This is file `revquantum.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% revquantum.dtx  (with options: `package')
+%% 
+%% This is a generated file.
+%% 
+%% Copyright (C) 2015 by Christopher Granade <cgranade at cgranade.com>.
+%% 
+%% This file may be distributed and/or modified under the conditions of
+%% the LaTeX Project Public License, either version 1.3 of this license
+%% or (at your option) any later version.  The latest version of this
+%% license is in:
+%% 
+%%    http://www.latex-project.org/lppl.txt
+%% 
+%% and version 1.3 or later is part of all distributions of LaTeX version
+%% 2005/12/01 or later.
+%% 
+\NeedsTeXFormat{LaTeX2e}[1999/12/01]
+\ProvidesPackage{revquantum}
+    [2016/09/21 v0.10 Build script fixes for CTAN submission.]
+
+
+\usepackage{ifthen}
+
+
+
+
+
+\newboolean{@xetex}
+\setboolean{@xetex}{false}
+\IfFileExists{iftex.sty}{
+    \wlog{[INFO] iftex loaded}
+    \usepackage{iftex}
+}{
+    \newif\ifXeTeX
+    \XeTeXfalse
+}
+\ifXeTeX
+    \wlog{[INFO] Using XeTeX}
+    \setboolean{@xetex}{true}
+\else
+    \setboolean{@xetex}{false}
+\fi
+
+
+\newcommand{\newnew}[2]{
+    \expandafter\newcommand\csname new#1\endcsname[1]{
+      \expandafter\newcommand\csname ##1\endcsname{#2{##1}}
+    }
+}
+\newnew{operator}{\operatorname}
+\newnew{rm}{\mathrm}
+
+\newoperator{Tr}
+\newoperator{Cov}
+\newoperator{supp}
+\newoperator{diag}
+\newoperator{rank}
+
+\newcommand{\ii}{\mathrm{i}} % Outside what newnew currently supports.
+\newcommand{\dd}{\mathrm{d}} % Outside what newnew currently supports.
+
+\newrm{e}
+\newrm{TVD}
+\newrm{T}
+
+\newcommand{\defeq}{\mathrel{:=}}
+\newcommand{\expect}{\mathbb{E}}
+\newcommand{\id}{\openone}
+
+
+    \IfFileExists{stmaryrd.sty}{
+        \RequirePackage{stmaryrd}
+    }{
+        \PackageWarning{revquantum}{
+            The stmaryrd package is not available,
+            so some commands (e.g.: double-brackets) will look wrong.
+        }
+        \newcommand{\llbracket}{[\!\!\hspace{1.5pt}[}
+        \newcommand{\rrbracket}{]\!\!\hspace{1.5pt}]}
+    }
+
+
+\newcommand{\booloption}[3]{
+    \newboolean{#1}
+    \setboolean{#1}{#3}
+    \ifthenelse{\equal{#3}{true}}{
+        \DeclareOption{no#2}{\setboolean{#1}{false}}
+    }{
+        \DeclareOption{#2}{\setboolean{#1}{true}}
+    }
+}
+
+
+
+\booloption{@final}{final}{false}
+\booloption{@pretty}{pretty}{false}
+\booloption{@uselistings}{uselistings}{false}
+\booloption{@bibtexhacks}{bibtexhacks}{true}
+\booloption{@strict}{strict}{false}
+
+\ProcessOptions\relax
+
+
+
+\ifthenelse{\boolean{@strict}}{
+    \newcommand{\rq at quasiwarn}{
+        \PackageError{revquantum}
+    }
+}{
+    \newcommand{\rq at quasiwarn}{
+        \PackageWarning{revquantum}
+    }
+}
+
+
+
+
+\ifthenelse{\boolean{@bibtexhacks}}{\def\@bibdataout at aps{%
+ \immediate\write\@bibdataout{%
+  @CONTROL{%
+   apsrev41Control,author="08",editor="1",pages="0",title="0",year="1",eprint="1"%
+  }%
+ }%
+ \if at filesw
+  \immediate\write\@auxout{\string\citation{apsrev41Control}}%
+ \fi
+}}{}
+
+
+
+
+
+\RequirePackage{amsmath}
+\RequirePackage{amsfonts}
+\RequirePackage{amsthm}
+\RequirePackage{amssymb}
+\RequirePackage{amsbsy}
+\@ifpackageloaded{tikz}{}{%
+    \@ifpackageloaded{xcolor}{}{%
+        \ifthenelse{\boolean{@uselistings}}{}{%
+            \RequirePackage[usenames,dvipsnames]{color}%
+        }%
+    }%
+    \AtBeginDocument{%
+        \@ifpackageloaded{tikz}{%
+            \rq at quasiwarn{tikz loaded, but after revquantum. This may not work.}%
+        }%
+    }%
+}
+\RequirePackage{braket}
+\RequirePackage{graphicx}
+\RequirePackage[english]{babel}
+\ifthenelse{\boolean{@pretty}}{
+    \ifthenelse{\boolean{@xetex}}{
+        % http://tex.stackexchange.com/a/50593
+        \usepackage{fontspec}
+        \usepackage{mathpazo}
+        \setmainfont
+         [ BoldFont       = texgyrepagella-bold.otf ,
+           ItalicFont     = texgyrepagella-italic.otf ,
+           BoldItalicFont = texgyrepagella-bolditalic.otf ]
+         {texgyrepagella-regular.otf}
+    }{
+        \RequirePackage{mathpazo}
+    }
+}{}
+\ifthenelse{\boolean{@uselistings}}{
+    \RequirePackage{xcolor}
+    \RequirePackage{listings}
+    \RequirePackage{textcomp} % Make sure we have a ` for writing Mathematica.
+}{}
+\ifthenelse{\boolean{@bibtexhacks}}{
+    \RequirePackage{letltxmacro}
+}{}
+
+
+
+\newtheorem{theorem}{Theorem}
+\newtheorem{lemma}{Lemma}
+
+
+
+
+\RequirePackage{algorithm}
+\RequirePackage{algpseudocode}
+    \renewcommand{\algorithmicrequire}{\textbf{Input:}}
+    \renewcommand{\algorithmicensure}{\textbf{Output:}}
+    \newcommand{\inlinecomment}[1]{\Comment {\footnotesize #1} \normalsize}
+    \newcommand{\linecomment}[1]{\State \(\triangleright\) {\footnotesize #1} \normalsize}
+
+
+
+
+
+\ifthenelse{\boolean{@uselistings}}{
+    \definecolor{comment-color}{gray}{0.5}
+
+    \lstset{
+        basicstyle=\footnotesize,
+        commentstyle=\color{comment-color},
+        frame=lines,
+        gobble=4,
+        numbers=left,
+        numberstyle=\tiny, stepnumber=5,
+        numbersep=5pt,
+        keywordstyle=\color{cud-bluish-green!85!black}\bfseries,
+        keywordstyle={[2]\color{cud-sky-blue!75!black}},
+        emphstyle=\color{cud-vermillion}
+    }
+
+    \ifthenelse{\boolean{@xetex}}{
+        \RequirePackage{sourcecodepro}
+        \lstset{basicstyle=\footnotesize\sourcecodepro}
+    }{}
+
+    \lstdefinestyle{matlab}{
+        language=MATLAB,
+        mathescape=true
+    }
+
+    \lstdefinestyle{python}{
+        language=Python,
+        mathescape=true,
+        showstringspaces=false,
+        morekeywords={as,async,await}
+    }
+
+    \lstdefinestyle{mathematica}{
+        language=Mathematica,
+        upquote=true, % Needed to deal with the context symbol `.'
+        literate=
+            {->}{$\to$}1
+            {!=}{$\neq$}1
+            {\\[DoubleStruckOne]}{${\id}$}1
+            {\\[Sigma]}{$\sigma$}1
+            {(x)}{$\otimes$}1 % CG: I have the distinct impression this will break. Badly.
+    }
+}{}
+
+
+
+
+\newcommand{\rq at warnpackage}[1]{
+    \AtBeginDocument{%
+        \@ifpackageloaded{#1}{%
+            \rq at quasiwarn{The #1 package is known to be incompatible with revtex4-1. You may encounter problems using this package.}%
+        }{}
+    }
+}
+
+
+\rq at warnpackage{subcaption}
+
+
+
+
+\LetLtxMacro{\ORIGselectlanguage}{\selectlanguage}
+\DeclareRobustCommand{\selectlanguage}[1]{%
+  \@ifundefined{alias@\string#1}
+    {\ORIGselectlanguage{#1}}
+    {\begingroup\edef\x{\endgroup
+       \noexpand\ORIGselectlanguage{\@nameuse{alias@#1}}}\x}%
+}
+
+
+
+\newcommand{\definelanguagealias}[2]{%
+  \@namedef{alias@#1}{#2}%
+}
+
+
+
+\definelanguagealias{en}{english}
+\definelanguagealias{EN}{english}
+\definelanguagealias{English}{english}
+
+
+
+
+
+\ifthenelse{\boolean{@final}}{
+    \newcommand{\todo}[1]{%
+        \PackageError{revquantum}{Unaddressed TODO}%
+        \rq at todo{#1}%
+    }
+}{
+    \newcommand{\todo}[1]{%
+        \PackageWarning{revquantum}{Unaddressed TODO}%
+        \rq at todo{#1}%
+    }
+}
+
+\ifthenelse{\boolean{@final}}{
+    \newcommand{\citeneed}{%
+        \PackageError{revquantum}{citation needed}%
+        \rq at todo{[citation needed]}%
+    }
+}{
+    \newcommand{\citeneed}{%
+        \PackageWarning{revquantum}{citation needed}%
+        \rq at todo{[citation needed]}%
+    }
+}
+\newcommand{\rq at todo}[1]{%
+    {\color{magenta} #1}%
+}
+\newcommand{\TODO}{\todo{TODO}}
+\newcommand{\todolist}[1]{\todo{
+    \begin{itemize}
+        #1
+    \end{itemize}
+}}
+
+
+
+\definecolor{cud-black}         {RGB}{0,0,0}
+\definecolor{cud-orange}        {RGB}{230,159,0}
+\definecolor{cud-sky-blue}      {RGB}{86,180,233}
+\definecolor{cud-bluish-green}  {RGB}{0,158,115}
+\definecolor{cud-yellow}        {RGB}{240,228,66}
+\definecolor{cud-blue}          {RGB}{0,114,178}
+\definecolor{cud-vermillion}    {RGB}{213,94,0}
+\definecolor{cud-reddish-purple}{RGB}{204,121,167}
+
+\newcommand{\newaffil}[2]{
+    \expandafter\newcommand\csname affil#1\endcsname{
+        \affiliation{
+            #2
+        }
+    }
+}
+
+\newaffil{TODO}{\TODO}
+
+
+\newaffil{EQuSUSyd}{
+    Centre for Engineered Quantum Systems,
+    University of Sydney,
+    Sydney, NSW, Australia
+}
+\newaffil{EQuSMacq}{
+    Centre for Engineered Quantum Systems,
+    Macquarie University,
+    Sydney, NSW, Australia
+}
+\newaffil{USydPhys}{
+    School of Physics,
+    University of Sydney,
+    Sydney, NSW, Australia
+}
+
+
+\newaffil{IQC}{
+    Institute for Quantum Computing,
+    University of Waterloo,
+    Waterloo, ON, Canada
+}
+\newaffil{UWPhys}{
+    Department of Physics,
+    University of Waterloo,
+    Waterloo, ON, Canada
+}
+\newaffil{UWAMath}{
+    Department of Applied Mathematics,
+    University of Waterloo,
+    Waterloo, ON, Canada
+}
+\newaffil{UWChem}{
+    Department of Chemistry,
+    University of Waterloo,
+    Waterloo, ON, Canada
+}
+\newaffil{PI}{
+    Perimeter Institute for Theoretical Physics,
+    31 Caroline St. N,
+    Waterloo, Ontario, Canada N2L 2Y5
+}
+\newaffil{CIFAR}{
+    Canadian Institute for Advanced Research,
+    Toronto, ON, Canada
+}
+
+
+\newaffil{CQuIC}{
+    Center for Quantum Information and Control,
+    University of New Mexico,
+    Albuquerque, NM 87131-0001, USA
+}
+\newaffil{IBMTJW}{
+    IBM T. J. Watson Research Center,
+    Yorktown Heights, New York 10598, USA
+}
+
+
+
+
+
+\RequirePackage[breaklinks=true]{hyperref}
+
+\hypersetup{
+  colorlinks   = true, %Colours links instead of ugly boxes
+  urlcolor     = blue, %Colour for external hyperlinks
+  linkcolor    = blue, %Colour of internal links
+  citecolor    = red %Colour of citations
+}
+
+
+
+\AtBeginDocument{%
+    \def\sectionautorefname{Section}%
+}
+\AtBeginDocument{%
+    \def\algorithmautorefname{Algorithm}%
+}
+\AtBeginDocument{%
+    \def\equationautorefname~#1\null{(#1)\null}%
+}
+\AtBeginDocument{%
+    \newcommand{\lemmaautorefname}{Lemma}%
+}
+\endinput
+%%
+%% End of file `revquantum.sty'.


Property changes on: trunk/Master/texmf-dist/tex/latex/revquantum/revquantum.sty
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/tlpkg/bin/tlpkg-ctan-check
===================================================================
--- trunk/Master/tlpkg/bin/tlpkg-ctan-check	2016-09-21 20:55:21 UTC (rev 42121)
+++ trunk/Master/tlpkg/bin/tlpkg-ctan-check	2016-09-21 20:56:17 UTC (rev 42122)
@@ -506,7 +506,7 @@
     refcheck refenums reflectgraphics refman refstyle
     regcount regexpatch register regstats
     reledmac relenc relsize reotex repeatindex repere repltext resphilosophica
-    resumecls resumemac reverxii revtex
+    resumecls resumemac reverxii revquantum revtex
     ribbonproofs rjlparshap rlepsf rmathbr rmpage
     roboto robustcommand robustindex
     romanbar romanbarpagenumber romande romanneg romannum

Modified: trunk/Master/tlpkg/tlpsrc/collection-science.tlpsrc
===================================================================
--- trunk/Master/tlpkg/tlpsrc/collection-science.tlpsrc	2016-09-21 20:55:21 UTC (rev 42121)
+++ trunk/Master/tlpkg/tlpsrc/collection-science.tlpsrc	2016-09-21 20:56:17 UTC (rev 42122)
@@ -61,6 +61,7 @@
 depend physics
 depend pseudocode
 depend pygmentex
+depend revquantum
 depend sasnrdisplay
 depend sciposter
 depend sclang-prettifier

Added: trunk/Master/tlpkg/tlpsrc/revquantum.tlpsrc
===================================================================


More information about the tex-live-commits mailing list