summaryrefslogtreecommitdiff
path: root/docutils
diff options
context:
space:
mode:
authormilde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2009-09-16 21:33:17 +0000
committermilde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2009-09-16 21:33:17 +0000
commitbbc8a39bfb68cbd16a2deac11f291964f7363185 (patch)
treeb5184a9482b8e9c9fcff9aa9304fd96eb6e842dd /docutils
parentac19006821297be407a12ae81658b857ffad859e (diff)
downloaddocutils-bbc8a39bfb68cbd16a2deac11f291964f7363185.tar.gz
Bugfix for combination of "footnote-references=brackets"
with "use-latex-footnotes". git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@6132 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
Diffstat (limited to 'docutils')
-rw-r--r--docutils/HISTORY.txt4
-rw-r--r--docutils/docs/dev/todo.txt29
-rw-r--r--docutils/docs/user/docutils-05-compat.sty.txt11
-rw-r--r--docutils/docutils/writers/latex2e/__init__.py6
-rw-r--r--docutils/docutils/writers/latex2e/docutils-05-compat.sty13
5 files changed, 26 insertions, 37 deletions
diff --git a/docutils/HISTORY.txt b/docutils/HISTORY.txt
index 14cd5ca1a..07ee15f30 100644
--- a/docutils/HISTORY.txt
+++ b/docutils/HISTORY.txt
@@ -138,8 +138,8 @@ Changes Since 0.5
- Use template (file and configuration option).
- Render doctest blocks as literal blocks (fixes [ 1586058 ]).
- Use `translate` instead of repeated `replace` calls for text encoding.
- - Hyperlinked footnotes and support for symbol footnotes with
- ``--use-latex-footnotes``.
+ - Hyperlinked footnotes and support for symbol footnotes and
+ ``--footnote-references=brackets`` with ``--use-latex-footnotes``.
* docutils/writers/manpage.py
diff --git a/docutils/docs/dev/todo.txt b/docutils/docs/dev/todo.txt
index 4b1d223f6..e922e0874 100644
--- a/docutils/docs/dev/todo.txt
+++ b/docutils/docs/dev/todo.txt
@@ -1967,26 +1967,19 @@ Which packages do we want to use?
+ True footnotes with LaTeX auto-numbering? (as option?)
- The `hyperref` manual says:
+ Might need adaption and a separate counter for symbol footnotes.
+
+ .. Quote:
- hyperfootnotes: Makes the footnote marks into hyperlinks to the
- footnote text. Easily broken ...
+ If the symbol you want is not one of the ones listed, you'll need to
+ redefine ``\@fnsymbol`` and add it, e.g. perhaps like::
- the `hyperref` README says:
+ \def\@fnsymbol#1{\ifcase#1\hbox{}\or *\or \dagger\or \ddagger\or
+ \mathchar "278\or \mathchar "27B\or \|\or **\or \dagger\dagger \or
+ \ddagger\ddagger \or \mathchar"27C \else\@ctrerr\fi\relax}
- The footnote support is rather limited. It is beyond the scope to use
- \footnotemark and \footnotetext out of order or reusing \footnotemark.
- Here you can either disable hyperref's footnote
-
- And provides an example which is built on in `this thread
- <http://www.latex-community.org/forum/viewtopic.php?f=5&t=2846>`__.
-
- + disable or properly support ``--footnote-references=bracket``
-
- When supplying the command line options --footnote-references=brackets
- and --use-latex-footnotes with the LaTeX writer (which might very well
- happen when using configuration files), the spaces in front of footnote
- references aren't trimmed.
+ which would allow \symbolfootnote[10]{footnote} to have a club as its
+ mark.
.. Footnote packages:
@@ -2026,7 +2019,7 @@ Which packages do we want to use?
footnotes so that they softly and silently vanish away if used in a
moving argument.
- `Footnotes numbered \u201cper page\u201d
+ `Footnotes numbered per page
<http://www.tex.ac.uk/cgi-bin/texfaq2html?label=footnpp>`__
* perpage provides a general mechanism for resetting counters per page
diff --git a/docutils/docs/user/docutils-05-compat.sty.txt b/docutils/docs/user/docutils-05-compat.sty.txt
index ce0857841..805b9a138 100644
--- a/docutils/docs/user/docutils-05-compat.sty.txt
+++ b/docutils/docs/user/docutils-05-compat.sty.txt
@@ -88,7 +88,8 @@ __ ../ref/rst/directives.html#document-header-footer
``--literal-block-env=lstlistings`` fail with literal or doctest
blocks nested in an admonition.
-* Support symbol footnotes with ``--use-latex-footnotes``.
+* Two-way hyperlinked footnotes and support for symbol footnotes and
+ ``--footnote-references=brackets`` with ``--use-latex-footnotes``.
Backwards compatibility:
"Bug for bug compatibility" is not provided.
@@ -642,12 +643,8 @@ New Feature:
``DUsubtitle`` commands,
:topic: ``\DUtopic`` and ``\DUtitle`` commands,
:transition: ``\DUtransition`` command.
-
- Auxiliary LaTeX commands
-
- :footnotes: ``\DUfootnotemark`` and ``\DUfootnotetext`` commands with
- hyperlink support and choice of footnotemark format (symbol or
- numeric).
+ :footnotes: ``\DUfootnotemark`` and ``\DUfootnotetext`` commands with
+ hyperlink support using the Docutils-provided footnote label.
Backwards compatibility:
In most cases, the default definition corresponds to the previously used
diff --git a/docutils/docutils/writers/latex2e/__init__.py b/docutils/docutils/writers/latex2e/__init__.py
index 134cbb64e..915ee78fa 100644
--- a/docutils/docutils/writers/latex2e/__init__.py
+++ b/docutils/docutils/writers/latex2e/__init__.py
@@ -1857,6 +1857,8 @@ class LaTeXTranslator(nodes.NodeVisitor):
if self.use_latex_footnotes:
self.fallbacks['footnotes'] = PreambleCmds.footnotes
num,text = node.astext().split(None,1)
+ if self.settings.footnote_references == 'brackets':
+ num = '[%s]' % num
self.out.append('%%\n\\DUfootnotetext{%s}{%s}{%s}{' %
(node['ids'][0], backref, self.encode(num)))
if node['ids'] == node['names']:
@@ -1893,8 +1895,8 @@ class LaTeXTranslator(nodes.NodeVisitor):
# print 'matches', footnote['ids']
format = self.settings.footnote_references
if format == 'brackets':
- self.append_hypertargets()
- self.out.append('[%s\\hyperlink{%s}{' % (href))
+ self.append_hypertargets(node)
+ self.out.append('\\hyperlink{%s}{[' % href)
self.context.append(']}')
else:
self.fallbacks['footnotes'] = PreambleCmds.footnotes
diff --git a/docutils/docutils/writers/latex2e/docutils-05-compat.sty b/docutils/docutils/writers/latex2e/docutils-05-compat.sty
index aff41d2db..62c79a109 100644
--- a/docutils/docutils/writers/latex2e/docutils-05-compat.sty
+++ b/docutils/docutils/writers/latex2e/docutils-05-compat.sty
@@ -7,7 +7,7 @@
%
% :Author: Guenter Milde
% :Contact: milde@users.berlios.de
-% :Revision: $Revision: 6115 $
+% :Revision: $Revision: 6127 $
% :Date: $Date: 2009-02-24$
% :Copyright: © 2009 G. Milde,
% Released without warranties or conditions of any kind
@@ -88,7 +88,8 @@
% ``--literal-block-env=lstlistings`` fail with literal or doctest
% blocks nested in an admonition.
%
-% * Support symbol footnotes with ``--use-latex-footnotes``.
+% * Two-way hyperlinked footnotes and support for symbol footnotes and
+% ``--footnote-references=brackets`` with ``--use-latex-footnotes``.
%
% Backwards compatibility:
% "Bug for bug compatibility" is not provided.
@@ -642,12 +643,8 @@
% ``DUsubtitle`` commands,
% :topic: ``\DUtopic`` and ``\DUtitle`` commands,
% :transition: ``\DUtransition`` command.
-%
-% Auxiliary LaTeX commands
-%
-% :footnotes: ``\DUfootnotemark`` and ``\DUfootnotetext`` commands with
-% hyperlink support and choice of footnotemark format (symbol or
-% numeric).
+% :footnotes: ``\DUfootnotemark`` and ``\DUfootnotetext`` commands with
+% hyperlink support using the Docutils-provided footnote label.
%
% Backwards compatibility:
% In most cases, the default definition corresponds to the previously used