Adam J. Morrison | 13 Jul 2012 23:53

rst-compile to PDF using emacs rst-mode

I am not subscribed to Docutils-users.

I trying to start learning Emacs to write my rst documents. So far, I am 
enjoying it. However, I'm struggling to compile the rst file to a PDF 
format.

I set PDF as the primary toolset in rst.el. It appears that this uses 
rst2pdf, which I am familiar with using. However, it seems that the 
default command from Emacs does not include the required '-o 
<outputfile>' format. I've tried adding the '-o' option to the 
rst-compile-toolsets listing for PDF, but the rst-compile command then 
puts the option immediately after the rst2pdf command like 'rst2pdf -o 
<inputfile> <outputfile>'.

I'm limited in my knowledge of both Emacs and Lisp (I'm much more 
familiar with Python), so I very well could be doing something wrong. If 
someone could point me in the right direction, I would appreciate it.

Thank you,

Adam

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
Stefan Merten | 17 Jul 2012 22:28
Picon
Favicon

Re: rst-compile to PDF using emacs rst-mode

Hi Adam!

> I trying to start learning Emacs to write my rst documents. So far, I am 
> enjoying it.

:-)

> I set PDF as the primary toolset in rst.el. It appears that this uses 
> rst2pdf, which I am familiar with using. However, it seems that the 
> default command from Emacs does not include the required '-o 
> <outputfile>' format.

I didn't wrote that code and I'm personally not (yet) using `rst2pdf`.
Can you give me a (minimal) command line which should work?

> I've tried adding the '-o' option to the 
> rst-compile-toolsets listing for PDF, but the rst-compile command then 
> puts the option immediately after the rst2pdf command like 'rst2pdf -o 
> <inputfile> <outputfile>'.

`rst.el` may be simply wrong here. I never tried it.

						Grüße

						Stefan
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
(Continue reading)

Adam J. Morrison | 17 Jul 2012 22:42

Re: rst-compile to PDF using emacs rst-mode

Thank you, Stefan.

I use rst2pdf pretty extensively. Generally speaking, it has worked 
pretty well.

The following command line would be the minimum required.

rst2pdf.py mydocument.txt

This would produce a PDF file of the same name, with the exception of a 
.pdf extension. Note the the .txt extension could be anything (e.g. 
.rst, .rest, etc.)

A more typical form, which is still simple and allows for naming of the 
output file is:

rst2pdf.py mydocument.txt -o mydocument.pdf
or
rst2pdf.py mydocument.txt --output mydocument.pdf

The standard rst-compile command produces something pretty close:
rst2pdf.py mydocument.txt mydocument.pdf

There are, as you might imagine, a dozen or more other options of a 
similar form, but these above are the basics.

Thank you,

Adam

(Continue reading)

Stefan Merten | 11 Nov 2012 11:49
Picon
Favicon

Re: rst-compile to PDF using emacs rst-mode

Hi Adam and developers!

Thanks for your help and sorry for the delay.

3 months (117 days) ago Adam J Morrison wrote:
> The following command line would be the minimum required.
> 
> rst2pdf.py mydocument.txt
> 
> This would produce a PDF file of the same name, with the exception of a 
> .pdf extension. Note the the .txt extension could be anything (e.g. 
> .rst, .rest, etc.)
> 
> 
> A more typical form, which is still simple and allows for naming of the 
> output file is:
> 
> rst2pdf.py mydocument.txt -o mydocument.pdf
> or
> rst2pdf.py mydocument.txt --output mydocument.pdf
> 
> 
> The standard rst-compile command produces something pretty close:
> rst2pdf.py mydocument.txt mydocument.pdf

[...]

> On 2012-07-17 16:28, Stefan Merten wrote:
>>> I set PDF as the primary toolset in rst.el. It appears that this uses
>>> rst2pdf, which I am familiar with using. However, it seems that the
(Continue reading)

Stefan Merten | 11 Nov 2012 12:17
Picon
Favicon

Incompatible options for rst2pdf (was: Re: [Docutils-develop] rst-compile to PDF using emacs rst-mode)

Hi all!

20 minutes ago Stefan Merten wrote:
> I finally installed rst2pdf from the sandbox at
> 
> 	https://docutils.svn.sourceforge.net/svnroot/docutils/trunk/sandbox/rst2pdf/
> 
> I also discovered
> 
> 	https://docutils.svn.sourceforge.net/svnroot/docutils/trunk/sandbox/rst2pdf-rubber/
> 
> which seems to be extremely close to the other rst2pdf tree.
> 
> However, neither of the two is probably the rst2pdf you are talking
> about :-( . The one I tried follows the normal rst2* conventions and
> uses `-o` for specifying an output encoding:
> 
>   --output-encoding=<name[:handler]>, -o <name[:handler]>
> 			  Specify the text encoding and optionally the error
> 			  handler for output.  Default: UTF-8:strict.
> 
> It seems that the rst2pdf you are talking about is not in the Docutils
> SVN.
> 
>  <at> Developers: Any idea what is going on here?

Ah, I think I found out. Robert Alsina seems to prefer to maintain an
own project at http://rst2pdf.ralsina.com.ar/ which is not reflected
in the sandbox. In this project the command line conventions do not
follow the usual rst2* conventions and even collide with them. That is
(Continue reading)

Roberto Alsina | 11 Nov 2012 14:02
Picon
Favicon
Gravatar

Re: Incompatible options for rst2pdf

On 11/11/2012 12:17 PM, Stefan Merten wrote:

>>
>>  <at> Developers: Any idea what is going on here?
> 
> Ah, I think I found out. Robert Alsina seems to prefer to maintain an

Roberto, not Robert, if you don't mind.

> own project at http://rst2pdf.ralsina.com.ar/ which is not reflected
> in the sandbox. In this project the command line conventions do not
> follow the usual rst2* conventions and even collide with them. That is
> really, really bad.

It's not that I prefer to maintain my own project. It just is a separate
project, that supported for a long time a lot of things
docutils didn't (for example: math, code blocks, plugins).

Also, it's implemented completely differently from how docutils
implements writers, so it would have been a horrible fit for the
docutils codebase, and would probably, according to what I have seen,
never been accepted into docutils, which is just fine by me, too.

> So I'm pretty much inclined to say: The behavior of `rst.el` conforms
> to the reStructuredText standards and thus should not be changed.
> Instead the external project should be fixed.

Not going to happen, sorry. rst2pdf does what it does and has been doing
it for a long time, and I owe compatibility to the userbase :-)

(Continue reading)

Stefan Merten | 24 Nov 2012 18:22
Picon
Favicon

Re: Incompatible options for rst2pdf

Hi Roberto!

Last week (13 days ago) Roberto Alsina wrote:
> On 11/11/2012 12:17 PM, Stefan Merten wrote:
>> Ah, I think I found out. Robert Alsina seems to prefer to maintain an
> 
> Roberto, not Robert, if you don't mind.

I'm really sorry. I try to get names right but failed in this case.

>> own project at http://rst2pdf.ralsina.com.ar/ which is not reflected
>> in the sandbox. In this project the command line conventions do not
>> follow the usual rst2* conventions and even collide with them. That is
>> really, really bad.
> 
> It's not that I prefer to maintain my own project. It just is a separate
> project, that supported for a long time a lot of things
> docutils didn't (for example: math, code blocks, plugins).
> 
> Also, it's implemented completely differently from how docutils
> implements writers, so it would have been a horrible fit for the
> docutils codebase, and would probably, according to what I have seen,
> never been accepted into docutils, which is just fine by me, too.

Well, there is the sandbox in the docutils repository. AFAICS there
are not really limitations to put something there as long as it is
related to Docutils. If the reportlab based `rst2pdf` would be there
it would certainly be easier for Docutils hackers to help maintaining
it.

(Continue reading)

Guenter Milde | 11 Nov 2012 21:36

Re: Incompatible options for rst2pdf (was: Re: [Docutils-develop] rst-compile to PDF using emacs rst-mode)

On 2012-11-11, Stefan Merten wrote:
> 20 minutes ago Stefan Merten wrote:

>> It seems that the rst2pdf you are talking about is not in the Docutils
>> SVN.

>>  <at> Developers: Any idea what is going on here?

See http://docutils.sourceforge.net/docs/user/links.html#pdf

Günter

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_nov
_______________________________________________
Docutils-users mailing list
Docutils-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/docutils-users

Please use "Reply All" to reply to the list.
Adam J. Morrison | 12 Nov 2012 22:41

Re: Incompatible options for rst2pdf

Stefan,

Thank you for the message.

There are key differences between the docutils sandbox rst2pdf and the 
rst2pdf maintained by Roberto Alsina. The docutils uses a LaTeX 
pass-through, while the other uses Reportlab (another python package for 
direct PDF generation). The Reportlab toolchain is included along with 
the Alsina rst2pdf in popular packages like Python(x,y) for 
scientific/engineering work (my industry).

One isn't necessarily better than the other--they are just different. My 
business prefers the output and flexibility of the Reportlab approach 
for complex, data-driven documents. It seems like making the default 
commands configurable with some variables or something might be the 
easiest way to satisfy both tool chains.

It's already true that the -o option is optional, but the rst-mode 
defaults to a command that has to be modified each time. For now, I've 
just written my own emacs function to issue the command that I need.

Thanks for looking into this.

Adam

On 2012-11-11 06:17, Stefan Merten wrote:
> Hi all!
>
> 20 minutes ago Stefan Merten wrote:
>> I finally installed rst2pdf from the sandbox at
(Continue reading)


Gmane