Re: Asterisk'd image, with path

2008-11-08 Thread Georg Brandl

Yarko T schrieb:
 
 
 On Thu, Nov 6, 2008 at 3:57 AM, Georg Brandl [EMAIL PROTECTED]
 mailto:[EMAIL PROTECTED] wrote:
 
 
 .
 As for the latex title/author patch, this is actually documented :)
 It's e.g. needed for doing author=A \\and B.
 
 Georg
 
 
 This seems like there is still something not right with this
 
 If I have :
 
 Python3 Patterns \\and Idioms
 
 ===
 
 
 the LaTeX output is (which still needs hand editing --- need that to be
 \ at least)
 
 \title{Python 3 Patterns  Idioms book}

Are you using 0.4? This is an area where I did some fixes in tip.

Anyway, there are *two* ways to set a title for the LaTeX documentation:

* set a title in the conf.py latex_documents setting. Since this text is
  only ever used for LaTeX, it is not escaped.

* don't set a title there, then the title of the document you give in the
  conf.py setting is used. In this case, the text is properly escaped, so
  you should be fine to use

Python 3 Patterns  Idioms
==

  there.

HTH,
Georg

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
sphinx-dev group.
To post to this group, send email to sphinx-dev@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sphinx-dev?hl=en
-~--~~~~--~~--~--~---



Re: Asterisk'd image, with path

2008-11-06 Thread Yarko T
saw that - thanks...

On Thu, Nov 6, 2008 at 3:57 AM, Georg Brandl [EMAIL PROTECTED] wrote:


 yarko schrieb:
  In the current tree, this fails:
 
  .. image::  _images/foo.*
 
  The path gets lost in processing this for the builders.
 
  I'll have a patch for this in a moment...

 Thanks for the patch -- it goes in the right direction, but there
 was another glitch with it. I've fixed it in tip now.

 As for the latex title/author patch, this is actually documented :)
 It's e.g. needed for doing author=A \\and B.

 Georg

 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
sphinx-dev group.
To post to this group, send email to sphinx-dev@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sphinx-dev?hl=en
-~--~~~~--~~--~--~---



Re: Asterisk'd image, with path

2008-11-05 Thread Yarko T
On Wed, Nov 5, 2008 at 10:16 PM, yarko [EMAIL PROTECTED] wrote:


 In the current tree, this fails:

 .. image::  _images/foo.*

 The path gets lost in processing this for the builders.

 I'll have a patch for this in a moment...

 Yarko


I also found a minor problem w/ Latex generation:  title / author was not
being escaped for LaTeX (sections, etc. were - so this was annoying...)

Here's a patch which addresses both attached.

Regards,
Yarko

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
sphinx-dev group.
To post to this group, send email to sphinx-dev@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sphinx-dev?hl=en
-~--~~~~--~~--~--~---

diff -r 4d9cc1b7c60f sphinx/environment.py
--- a/sphinx/environment.py Tue Nov 04 23:46:17 2008 +0100
+++ b/sphinx/environment.py Thu Nov 06 00:49:35 2008 -0600
@@ -621,9 +621,9 @@
 for filename in glob(path.join(self.srcdir, imgpath)):
 dir, base = path.split(filename)
 if base.lower().endswith('.pdf'):
-candidates['application/pdf'] = path.join(docdir, base)
+candidates['application/pdf'] = path.join(docdir, 
filename)
 elif base.lower().endswith('.svg'):
-candidates['image/svg+xml'] = path.join(docdir, base)
+candidates['image/svg+xml'] = path.join(docdir, 
filename)
 else:
 f = open(filename, 'rb')
 try:
@@ -631,7 +631,7 @@
 finally:
 f.close()
 if imgtype:
-candidates['image/' + imgtype] = path.join(docdir, 
base)
+candidates['image/' + imgtype] = path.join(docdir, 
filename)
 else:
 candidates['*'] = imgpath
 for imgpath in candidates.itervalues():
diff -r 4d9cc1b7c60f sphinx/latexwriter.py
--- a/sphinx/latexwriter.py Tue Nov 04 23:46:17 2008 +0100
+++ b/sphinx/latexwriter.py Thu Nov 06 00:49:35 2008 -0600
@@ -160,10 +160,10 @@
 'papersize':papersize,
 'pointsize':builder.config.latex_font_size,
 # if empty, the title is set to the first section title
-'title':document.settings.title,
+'title':document.settings.title.translate(tex_escape_map),
 'date': strftime(builder.config.today_fmt or _('%B %d, 
%Y')),
 'release':  builder.config.release,
-'author':   document.settings.author,
+'author':   document.settings.author.translate(tex_escape_map),
 'releasename':  _('Release'),
 'preamble': builder.config.latex_preamble,
 'modindexname': _('Module Index'),
@@ -339,7 +339,7 @@
 if not self.elements['title']:
 # text needs to be escaped since it is inserted into
 # the output literally
-self.elements['title'] = 
node.astext().translate(tex_escape_map)
+   self.elements['title'] = node.astext().translate(tex_escape_map)
 self.this_is_the_title = 0
 raise nodes.SkipNode
 elif isinstance(node.parent, nodes.section):