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.

sphinxmanual.cls 3.6 kB

5 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. %
  2. % sphinxmanual.cls for Sphinx (http://sphinx-doc.org/)
  3. %
  4. \NeedsTeXFormat{LaTeX2e}[1995/12/01]
  5. \ProvidesClass{sphinxmanual}[2017/03/26 v1.6 Document class (Sphinx manual)]
  6. % chapters starting at odd pages (overridden by 'openany' document option)
  7. \PassOptionsToClass{openright}{\sphinxdocclass}
  8. % 'oneside' option overriding the 'twoside' default
  9. \newif\if@oneside
  10. \DeclareOption{oneside}{\@onesidetrue}
  11. % Pass remaining document options to the parent class.
  12. \DeclareOption*{\PassOptionsToClass{\CurrentOption}{\sphinxdocclass}}
  13. \ProcessOptions\relax
  14. % Defaults two-side document
  15. \if@oneside
  16. % nothing to do (oneside is the default)
  17. \else
  18. \PassOptionsToClass{twoside}{\sphinxdocclass}
  19. \fi
  20. \LoadClass{\sphinxdocclass}
  21. % Set some sane defaults for section numbering depth and TOC depth. You can
  22. % reset these counters in your preamble.
  23. %
  24. \setcounter{secnumdepth}{2}
  25. \setcounter{tocdepth}{1}
  26. % Change the title page to look a bit better, and fit in with the fncychap
  27. % ``Bjarne'' style a bit better.
  28. %
  29. \renewcommand{\maketitle}{%
  30. \let\spx@tempa\relax
  31. \ifHy@pageanchor\def\spx@tempa{\Hy@pageanchortrue}\fi
  32. \hypersetup{pageanchor=false}% avoid duplicate destination warnings
  33. \begin{titlepage}%
  34. \let\footnotesize\small
  35. \let\footnoterule\relax
  36. \noindent\rule{\textwidth}{1pt}\par
  37. \begingroup % for PDF information dictionary
  38. \def\endgraf{ }\def\and{\& }%
  39. \pdfstringdefDisableCommands{\def\\{, }}% overwrite hyperref setup
  40. \hypersetup{pdfauthor={\@author}, pdftitle={\@title}}%
  41. \endgroup
  42. \begin{flushright}%
  43. \sphinxlogo
  44. \py@HeaderFamily
  45. {\Huge \@title \par}
  46. {\itshape\LARGE \py@release\releaseinfo \par}
  47. \vfill
  48. {\LARGE
  49. \begin{tabular}[t]{c}
  50. \@author
  51. \end{tabular}
  52. \par}
  53. \vfill\vfill
  54. {\large
  55. \@date \par
  56. \vfill
  57. \py@authoraddress \par
  58. }%
  59. \end{flushright}%\par
  60. \@thanks
  61. \end{titlepage}%
  62. \setcounter{footnote}{0}%
  63. \let\thanks\relax\let\maketitle\relax
  64. %\gdef\@thanks{}\gdef\@author{}\gdef\@title{}
  65. \if@openright\cleardoublepage\else\clearpage\fi
  66. \spx@tempa
  67. }
  68. \newcommand{\sphinxtableofcontents}{%
  69. \pagenumbering{roman}%
  70. \pagestyle{plain}%
  71. \begingroup
  72. \parskip \z@skip
  73. \tableofcontents
  74. \endgroup
  75. % before resetting page counter, let's do the right thing.
  76. \if@openright\cleardoublepage\else\clearpage\fi
  77. \pagenumbering{arabic}%
  78. \ifdefined\fancyhf\pagestyle{normal}\fi
  79. }
  80. % This is needed to get the width of the section # area wide enough in the
  81. % library reference. Doing it here keeps it the same for all the manuals.
  82. %
  83. \renewcommand*\l@section{\@dottedtocline{1}{1.5em}{2.6em}}
  84. \renewcommand*\l@subsection{\@dottedtocline{2}{4.1em}{3.5em}}
  85. % Fix the bibliography environment to add an entry to the Table of
  86. % Contents.
  87. % For a report document class this environment is a chapter.
  88. %
  89. \newenvironment{sphinxthebibliography}[1]{%
  90. \if@openright\cleardoublepage\else\clearpage\fi
  91. % \phantomsection % not needed here since TeXLive 2010's hyperref
  92. \begin{thebibliography}{#1}%
  93. \addcontentsline{toc}{chapter}{\bibname}}{\end{thebibliography}}
  94. % Same for the indices.
  95. % The memoir class already does this, so we don't duplicate it in that case.
  96. %
  97. \@ifclassloaded{memoir}
  98. {\newenvironment{sphinxtheindex}{\begin{theindex}}{\end{theindex}}}
  99. {\newenvironment{sphinxtheindex}{%
  100. \if@openright\cleardoublepage\else\clearpage\fi
  101. \phantomsection % needed as no chapter, section, ... created
  102. \begin{theindex}%
  103. \addcontentsline{toc}{chapter}{\indexname}}{\end{theindex}}}

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