You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

sphinxhowto.cls 2.8 kB

5 years ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. %
  2. % sphinxhowto.cls for Sphinx (http://sphinx-doc.org/)
  3. %
  4. \NeedsTeXFormat{LaTeX2e}[1995/12/01]
  5. \ProvidesClass{sphinxhowto}[2017/03/26 v1.6 Document class (Sphinx HOWTO)]
  6. % 'oneside' option overriding the 'twoside' default
  7. \newif\if@oneside
  8. \DeclareOption{oneside}{\@onesidetrue}
  9. % Pass remaining document options to the parent class.
  10. \DeclareOption*{\PassOptionsToClass{\CurrentOption}{\sphinxdocclass}}
  11. \ProcessOptions\relax
  12. % Default to two-side document
  13. \if@oneside
  14. % nothing to do (oneside is the default)
  15. \else
  16. \PassOptionsToClass{twoside}{\sphinxdocclass}
  17. \fi
  18. \LoadClass{\sphinxdocclass}
  19. % Set some sane defaults for section numbering depth and TOC depth. You can
  20. % reset these counters in your preamble.
  21. %
  22. \setcounter{secnumdepth}{2}
  23. \setcounter{tocdepth}{2}% i.e. section and subsection
  24. % Change the title page to look a bit better, and fit in with the fncychap
  25. % ``Bjarne'' style a bit better.
  26. %
  27. \renewcommand{\maketitle}{%
  28. \noindent\rule{\textwidth}{1pt}\par
  29. \begingroup % for PDF information dictionary
  30. \def\endgraf{ }\def\and{\& }%
  31. \pdfstringdefDisableCommands{\def\\{, }}% overwrite hyperref setup
  32. \hypersetup{pdfauthor={\@author}, pdftitle={\@title}}%
  33. \endgroup
  34. \begin{flushright}
  35. \sphinxlogo
  36. \py@HeaderFamily
  37. {\Huge \@title }\par
  38. {\itshape\large \py@release \releaseinfo}\par
  39. \vspace{25pt}
  40. {\Large
  41. \begin{tabular}[t]{c}
  42. \@author
  43. \end{tabular}}\par
  44. \vspace{25pt}
  45. \@date \par
  46. \py@authoraddress \par
  47. \end{flushright}
  48. \@thanks
  49. \setcounter{footnote}{0}
  50. \let\thanks\relax\let\maketitle\relax
  51. %\gdef\@thanks{}\gdef\@author{}\gdef\@title{}
  52. }
  53. \newcommand{\sphinxtableofcontents}{
  54. \begingroup
  55. \parskip = 0mm
  56. \tableofcontents
  57. \endgroup
  58. \rule{\textwidth}{1pt}
  59. \vspace{12pt}
  60. }
  61. \@ifundefined{fancyhf}{
  62. \pagestyle{plain}}{
  63. \pagestyle{normal}} % start this way; change for
  64. \pagenumbering{arabic} % ToC & chapters
  65. \thispagestyle{empty}
  66. % Fix the bibliography environment to add an entry to the Table of
  67. % Contents.
  68. % For an article document class this environment is a section,
  69. % so no page break before it.
  70. %
  71. \newenvironment{sphinxthebibliography}[1]{%
  72. % \phantomsection % not needed here since TeXLive 2010's hyperref
  73. \begin{thebibliography}{#1}%
  74. \addcontentsline{toc}{section}{\ifdefined\refname\refname\else\ifdefined\bibname\bibname\fi\fi}}{\end{thebibliography}}
  75. % Same for the indices.
  76. % The memoir class already does this, so we don't duplicate it in that case.
  77. %
  78. \@ifclassloaded{memoir}
  79. {\newenvironment{sphinxtheindex}{\begin{theindex}}{\end{theindex}}}
  80. {\newenvironment{sphinxtheindex}{%
  81. \phantomsection % needed because no chapter, section, ... is created by theindex
  82. \begin{theindex}%
  83. \addcontentsline{toc}{section}{\indexname}}{\end{theindex}}}

A Python package for graph kernels, graph edit distances and graph pre-image problem.