~ubuntu-branches/ubuntu/utopic/nwchem/utopic

« back to all changes in this revision

Viewing changes to src/tools/ga-5-1/python/docs/scipy_11/publisher/build_paper.py

  • Committer: Package Import Robot
  • Author(s): Michael Banck, Daniel Leidert, Andreas Tille, Michael Banck
  • Date: 2013-07-04 12:14:55 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20130704121455-5tvsx2qabor3nrui
Tags: 6.3-1
* New upstream release.
* Fixes anisotropic properties (Closes: #696361).
* New features include:
  + Multi-reference coupled cluster (MRCC) approaches
  + Hybrid DFT calculations with short-range HF 
  + New density-functionals including Minnesota (M08, M11) and HSE hybrid
    functionals
  + X-ray absorption spectroscopy (XAS) with TDDFT
  + Analytical gradients for the COSMO solvation model
  + Transition densities from TDDFT 
  + DFT+U and Electron-Transfer (ET) methods for plane wave calculations
  + Exploitation of space group symmetry in plane wave geometry optimizations
  + Local density of states (LDOS) collective variable added to Metadynamics
  + Various new XC functionals added for plane wave calculations, including
    hybrid and range-corrected ones
  + Electric field gradients with relativistic corrections 
  + Nudged Elastic Band optimization method
  + Updated basis sets and ECPs 

[ Daniel Leidert ]
* debian/watch: Fixed.

[ Andreas Tille ]
* debian/upstream: References

[ Michael Banck ]
* debian/upstream (Name): New field.
* debian/patches/02_makefile_flags.patch: Refreshed.
* debian/patches/06_statfs_kfreebsd.patch: Likewise.
* debian/patches/07_ga_target_force_linux.patch: Likewise.
* debian/patches/05_avoid_inline_assembler.patch: Removed, no longer needed.
* debian/patches/09_backported_6.1.1_fixes.patch: Likewise.
* debian/control (Build-Depends): Added gfortran-4.7 and gcc-4.7.
* debian/patches/10_force_gcc-4.7.patch: New patch, explicitly sets
  gfortran-4.7 and gcc-4.7, fixes test suite hang with gcc-4.8 (Closes:
  #701328, #713262).
* debian/testsuite: Added tests for COSMO analytical gradients and MRCC.
* debian/rules (MRCC_METHODS): New variable, required to enable MRCC methods.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/env python
2
 
 
3
 
import docutils.core as dc
4
 
 
5
 
from writer import writer
6
 
 
7
 
import os.path
8
 
import sys
9
 
import glob
10
 
 
11
 
if len(sys.argv) != 3:
12
 
    print "Usage: build_paper.py paper_directory target_directory"
13
 
    sys.exit(-1)
14
 
 
15
 
in_path, out_path = sys.argv[1:]
16
 
for p in (in_path, out_path):
17
 
    if not os.path.isdir(p):
18
 
        print("Cannot open directory: %s" % p)
19
 
        sys.exit(-1)
20
 
 
21
 
print "Building:", in_path
22
 
 
23
 
paper_id = os.path.basename(out_path)
24
 
 
25
 
preamble = r'''
26
 
% These preamble commands are from build_paper.py
27
 
 
28
 
% PDF Standard Fonts
29
 
\usepackage{mathptmx}
30
 
\usepackage[scaled=.90]{helvet}
31
 
\usepackage{courier}
32
 
 
33
 
% Make verbatim environment smaller
34
 
\makeatletter
35
 
\g@addto@macro\@verbatim\footnotesize
36
 
\makeatother
37
 
 
38
 
% Do not indent code sections
39
 
\renewcommand{\quote}{}
40
 
 
41
 
% Provide AMS mathematical commands such as "align"
42
 
\usepackage{amsmath}
43
 
\usepackage{amsfonts}
44
 
\usepackage{bm}
45
 
 
46
 
% Define colours for hyperref
47
 
\usepackage{color}
48
 
 
49
 
\definecolor{orange}{cmyk}{0,0.4,0.8,0.2}
50
 
\definecolor{darkorange}{rgb}{.71,0.21,0.01}
51
 
\definecolor{darkblue}{rgb}{.01,0.21,0.71}
52
 
\definecolor{darkgreen}{rgb}{.1,.52,.09}
53
 
 
54
 
\usepackage{hyperref}
55
 
\hypersetup{pdftex,  % needed for pdflatex
56
 
  breaklinks=true,  % so long urls are correctly broken across lines
57
 
  colorlinks=true,
58
 
  urlcolor=blue,
59
 
  linkcolor=darkblue,
60
 
  citecolor=darkgreen,
61
 
  }
62
 
 
63
 
% Include graphics for authors who raw-inlined figures
64
 
% (then docutils won't automatically add the package)
65
 
\usepackage{graphicx}
66
 
 
67
 
\ifthenelse{\isundefined{\longtable}}{}{
68
 
  \renewenvironment{longtable}{\begin{center}\begin{tabular}}%
69
 
    {\end{tabular}\end{center}\vspace{2mm}}
70
 
}
71
 
 
72
 
% Packages required for code highlighting
73
 
\usepackage{fancyvrb}
74
 
 
75
 
'''
76
 
 
77
 
# Add the LaTeX commands required by Pygments to do syntax highlighting
78
 
 
79
 
try:
80
 
    import pygments
81
 
except ImportError:
82
 
    import warnings
83
 
    warnings.warn(RuntimeWarning('Could not import Pygments. '
84
 
                                 'Syntax highlighting will fail.'))
85
 
    pygments = None
86
 
 
87
 
if pygments:
88
 
    from pygments.formatters import LatexFormatter
89
 
    from sphinx_highlight import SphinxStyle
90
 
 
91
 
    preamble += LatexFormatter(style=SphinxStyle).get_style_defs()
92
 
 
93
 
 
94
 
settings = {'documentclass': 'IEEEtran',
95
 
            'use_verbatim_when_possible': True,
96
 
            'use_latex_citations': True,
97
 
            'latex_preamble': preamble,
98
 
            'documentoptions': 'letterpaper,compsoc,twoside'}
99
 
 
100
 
 
101
 
try:
102
 
    rst, = glob.glob(os.path.join(in_path, '*.rst'))
103
 
except ValueError:
104
 
    raise RuntimeError("Found more than one input .rst--not sure which one to use.")
105
 
 
106
 
content = open(rst, 'r').read()
107
 
content = r'''
108
 
.. role:: ref
109
 
 
110
 
.. role:: label
111
 
 
112
 
.. raw::  latex
113
 
 
114
 
  \input{page_numbers.tex}
115
 
  \newcommand*{\docutilsroleref}{\ref}
116
 
  \newcommand*{\docutilsrolelabel}{\label}
117
 
 
118
 
''' + content
119
 
 
120
 
tex = dc.publish_string(source=content, writer=writer,
121
 
                        settings_overrides=settings)
122
 
 
123
 
out = open(os.path.join(out_path, 'paper.tex'), 'w')
124
 
out.write(tex)
125
 
out.close()
126
 
 
127
 
page_nr_f = os.path.join(out_path, 'page_numbers.tex')
128
 
if not os.path.exists(page_nr_f):
129
 
    out = open(page_nr_f, 'w')
130
 
    out.close()