[Epydoc-commits] SF.net SVN: epydoc: [1808] trunk/epydoc/src/epydoc/docwriter/latex_sty.py
Brought to you by:
edloper
|
From: <ed...@us...> - 2008-03-05 18:40:36
|
Revision: 1808
http://epydoc.svn.sourceforge.net/epydoc/?rev=1808&view=rev
Author: edloper
Date: 2008-03-05 10:40:33 -0800 (Wed, 05 Mar 2008)
Log Message:
-----------
- Use \raggedright for the subclass list
- Use utf8x encoding, instead of utf8
- \EpydocDottedName now expects its argument to use escaped characters
(underscore in particular.) E.g., \EpydocDottedName{foo\_bar}. It
no longer uses the latex url package. This makes it work better with
the hyperref package.
- Misc changes to show_latex_warnings().
Modified Paths:
--------------
trunk/epydoc/src/epydoc/docwriter/latex_sty.py
Modified: trunk/epydoc/src/epydoc/docwriter/latex_sty.py
===================================================================
--- trunk/epydoc/src/epydoc/docwriter/latex_sty.py 2008-03-04 02:32:58 UTC (rev 1807)
+++ trunk/epydoc/src/epydoc/docwriter/latex_sty.py 2008-03-05 18:40:33 UTC (rev 1808)
@@ -75,7 +75,6 @@
\RequirePackage[headings]{fullpage}
\RequirePackage[usenames]{color}
\RequirePackage{graphicx}
-\RequirePackage{url}
\@ifclassloaded{memoir}{%
\RequirePackage[other,notbib]{tocbibind}
@@ -107,6 +106,9 @@
% ======================================================================
% General Formatting
+% Setting this will make us less likely to get overfull hboxes:
+%\setlength{\emergencystretch}{1in}
+
% Separate paragraphs by a blank line (do not indent them). We define
% a new length variable. \EpydocParskip, for the paragraph-skip length.
% This needs to be assigned to \parskip here as well as inside several
@@ -566,23 +568,28 @@
% This section defines the EpydocDottedName command, which is used to
% display the names of Python objects.
-% The \EpydocDottedName command is used to escape dotted names. In
-% particular, it escapes all characters except '#', '%', and newlines,
-% and allows non-hyphenated wrapping at '.' separator characters.
-% [xx] this generates a warning for names containing _ -- we need
-% to somehow strip that out of the second argument.
-\newcommand\EpydocDottedName[1]{%
- \texorpdfstring{\protect\Epydoc@DottedName{#1}}{#1}}
+% The \EpydocDottedName command adds a possible break-point after every
+% period in the given string. It no longer escapes characters such as
+% underscore, since this interfered with the hyperref package; instead,
+% epydoc is responsible for escaping them. E.g., correct usage for a
+% name with an underscore is \EpydocDottedName{some\_name}.
+\newcommand\EpydocDottedName[1]{
+ \Epydoc@DottedName #1.@}
-\DeclareUrlCommand\Epydoc@DottedName{%
- \urlstyle{rm}%
- \def\UrlBigBreaks{\do\.}%
- % We should never see most of these chars in a name, but handle
- % them if they happen to show up (eg script names)
- \def\UrlOrds{\do\@\do\#\do\%\do\^\do\&\do\(\do\)\do\-\do\_%
- \do\|\do\\\do\"\do\/\do\?\do\>\do\<\do\{\do\}%
- \do\`\do\~}
-}
+% This helper function performs the work of \EpydocDottedName. It
+% scans forward, looking for a period, and putting all text up to the
+% period into #1. The single character after the period is put in
+% #2. This function then checks if #2 is '@', indicating that we're
+% done, or some other character, indicating that we should continue.
+% Note that \ifx tests character codes; and that when '@' appears
+% in user code, it gets the character code 'other', but when it
+% appears here, it gets the character code 'letter'.
+\def\Epydoc@DottedName#1.#2{%
+ \ifx#2@\relax #1\else
+ #1\discretionary{.}{}{.}%
+ \expandafter\expandafter\expandafter\Epydoc@DottedName
+ \expandafter #2\fi%
+ }
"""+NIST_DISCLAIMER
######################################################################
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|