Re: [O] Making DocBook xml books from org mode?
On Sun, Oct 2, 2016, at 10:09 PM, Norman Walsh wrote: > Joost Kremerswrites: > > There's also a `docbook' writer, > > which has been part of Pandoc much longer and which outputs to (I > > assume) DocBook v4. So I suspect you either need to upgrade your Pandoc > > or make sure ox-pandoc sets the output format to `docbook'. > > Depending on what your down-stream processing is like, you could > just go with V4 DocBook from org and then convert that to V5 with > the upgrade stylesheet. > Thank you, Norm. I'll keep that in mind, but if I can get directly to DocBook5, that seems easier and less "lossy." Cheers, -pd -- Peter Davis www.techcurmudgeon.com
Re: [O] Making DocBook xml books from org mode?
On Sun, Oct 2, 2016, at 11:38 PM, Marcin Borkowski wrote: > > On 2016-10-02, at 23:23, Peter Daviswrote: > > > I'm trying this again, on a Mac instead of Windows. I managed to get > > ox-pandoc working. (It now displays an org export menu too big to fit on > > my screen, and I can't figure out how to scroll it.) > > Space/backspace? I'll give it a try. Thanks, Marcin! Now here's the real problem. I get this slew of pandoc output options on my Mac, but on my Win10 machine, also with pandoc 1.117.2, I only get two options: [P] Markdown to buffer [p] To file I seem to be running the right ox-pandoc, so I'm not sure how to get all the other options. I could run pandoc on the org file from a command line, but then the embedded dot diagrams won't be evaluated. Perhaps export to HTML (or some other format?) and then use pandoc to convert to docbook? Thanks, -pd -- Peter Davis www.techcurmudgeon.com
Re: [O] Making DocBook xml books from org mode?
On 2016-10-02, at 23:23, Peter Daviswrote: > I'm trying this again, on a Mac instead of Windows. I managed to get > ox-pandoc working. (It now displays an org export menu too big to fit on > my screen, and I can't figure out how to scroll it.) Space/backspace? Best, -- Marcin Borkowski
Re: [O] Making DocBook xml books from org mode?
Joost Kremerswrites: > There's also a `docbook' writer, > which has been part of Pandoc much longer and which outputs to (I > assume) DocBook v4. So I suspect you either need to upgrade your Pandoc > or make sure ox-pandoc sets the output format to `docbook'. Depending on what your down-stream processing is like, you could just go with V4 DocBook from org and then convert that to V5 with the upgrade stylesheet. Be seeing you, norm -- Norman Walsh | There is no monument dedicated to the http://nwalsh.com/| memory of a committee.--Lester J. | Pourciau signature.asc Description: PGP signature
Re: [O] Making DocBook xml books from org mode?
Joost Kremerswrites: > On Sun, Oct 02 2016, Peter Davis wrote: >> Interesting. I just installed Pandoc on my Mac today with Homebrew, but >> it claims to be 1.13.1. I'll try to find an update. Thanks. > > Check the "Installing" page on pandoc.org: there's a link to an OS X > package on Pandoc's Github page: > > https://github.com/jgm/pandoc/releases/tag/1.17.2 > Thanks again, Joost. I didn't find any installation instructions or kits, but I just copied the executable from the .pkg file to /usr/local/bin on my machine, overwriting the 1.13 version that was there. That seems to have worked. I was able to export from org-mode to docbook. Thanks! -pd
Re: [O] Making DocBook xml books from org mode?
On Sun, Oct 02 2016, Peter Davis wrote: > Interesting. I just installed Pandoc on my Mac today with Homebrew, but > it claims to be 1.13.1. I'll try to find an update. Thanks. Check the "Installing" page on pandoc.org: there's a link to an OS X package on Pandoc's Github page: https://github.com/jgm/pandoc/releases/tag/1.17.2 Perhaps you can use that? -- Joost Kremers Life has its moments
Re: [O] Making DocBook xml books from org mode?
Joost Kremerswrites: > On Sun, Oct 02 2016, Peter Davis wrote: >> When I try to export to docbook via pandoc (C-c C-e p d), I get >> >> Running pandoc with args: (-f org -t docbook5 -o >> /Users/peterdavis/Dropbox/HMH/my_file.dbk --parse-raw --mathjax --standalone >> /Users/peterdavis/Dropbox/HMH/my_file.tmp3362h9T.org) >> Error occured. >> pandoc: Unknown writer: docbook5 >> >> Any guesses? Is there something additional I need to install in pandoc? > > The `docbook5' writer was added to Pandoc fairly recently, in version > 1.17.1, released in June of this year. Interesting. I just installed Pandoc on my Mac today with Homebrew, but it claims to be 1.13.1. I'll try to find an update. Thanks. > There's also a `docbook' writer, > which has been part of Pandoc much longer and which outputs to (I > assume) DocBook v4. So I suspect you either need to upgrade your Pandoc > or make sure ox-pandoc sets the output format to `docbook'. Well, I'm trying to output docbook5 anyway, so better to update my installation. Thank you. -pd
Re: [O] Making DocBook xml books from org mode?
On Sun, Oct 02 2016, Peter Davis wrote: > When I try to export to docbook via pandoc (C-c C-e p d), I get > > Running pandoc with args: (-f org -t docbook5 -o > /Users/peterdavis/Dropbox/HMH/my_file.dbk --parse-raw --mathjax --standalone > /Users/peterdavis/Dropbox/HMH/my_file.tmp3362h9T.org) > Error occured. > pandoc: Unknown writer: docbook5 > > Any guesses? Is there something additional I need to install in pandoc? The `docbook5' writer was added to Pandoc fairly recently, in version 1.17.1, released in June of this year. There's also a `docbook' writer, which has been part of Pandoc much longer and which outputs to (I assume) DocBook v4. So I suspect you either need to upgrade your Pandoc or make sure ox-pandoc sets the output format to `docbook'. -- Joost Kremers Life has its moments
Re: [O] Making DocBook xml books from org mode?
Peter Daviswrites: > To follow up ... > > On Thu, Sep 29, 2016, at 06:17 PM, Peter Davis wrote: >> On Thu, Sep 29, 2016, at 03:23 PM, Joost Kremers wrote: >> > >> > Pandoc can convert to Docbook, so that might be an option. Note that >> > Pandoc also converts *from* Org, (although it cannot handle all of Org's >> > capabilities), so depending on your needs, that might be a way to go >> > directly from Org to Docbook. >> > >> >> Thank you. I did succeed in exporting from org to texi, and then >> makeinfo'ing that into a DocBook xml, though a bit of hand editing was >> necessary. >> > > I did manage to get this working. I found I had to export to Pandoc > instead of running pandoc from a command line with the org file as > input. Otherwise, the embedded dot code I used would not link to an > image, but simply contain the dot code as source. > > Unfortunately, in trying to export to a file, I'm getting > > Unable to resolve link "www.gimp.org/downloads" > > I don't know where this is coming from, or how to fix it. > > Finally, the 'Export with Pandoc' menu item only gives me two choices: > [P] Markdown to buffer > [p] To file > > I assume it's just generating Markdown, which would then have to be > converted to docbook or whatever in a separate step. Any way to export > to docbook directly, using Pandoc implicitly? I'm trying this again, on a Mac instead of Windows. I managed to get ox-pandoc working. (It now displays an org export menu too big to fit on my screen, and I can't figure out how to scroll it.) When I try to export to docbook via pandoc (C-c C-e p d), I get Running pandoc with args: (-f org -t docbook5 -o /Users/peterdavis/Dropbox/HMH/my_file.dbk --parse-raw --mathjax --standalone /Users/peterdavis/Dropbox/HMH/my_file.tmp3362h9T.org) Error occured. pandoc: Unknown writer: docbook5 Any guesses? Is there something additional I need to install in pandoc? Thanks! -pd
Re: [O] Making DocBook xml books from org mode?
Marcin Borkowskiwrites: > On 2016-09-29, at 20:04, Peter Davis wrote: > >> I've started a new position in which I have to create and maintain a >> large set of documents in DocBook xml format. For new books, I'd really >> like to use org mode, since a) I'm already familiar with it, b) I love >> it, and c) I believe it does (or can be made to do) nearly everything I >> need. > > Nice. Of many things XML is ill-suited to, marking text up is a nice > exception: it seems really good at it (definitely way better than LaTeX, > of which I'm a great fan!). > Why do you think so? I've used XML lightly over the years and I have found it to be a bear. LaTeX has its own problems but I grew up with it, so I guess I'm less conscious of its flaws (but I rarely write LaTeX any more: org has subsumed it). Should I change my mind? >> 3. The direct route from org to DocBook xml seems to be missing. From > My memory might be playing tricks on me, but wasn't there a docbook exporter at some point? Maybe it did not survive the 8.x transition? Or am I misremembering? -- Nick
Re: [O] Making DocBook xml books from org mode?
On Fri, Sep 30, 2016, at 05:37 AM, Marcin Borkowski wrote: > > On 2016-09-29, at 20:04, Peter Daviswrote: > > > I've started a new position in which I have to create and maintain a > > large set of documents in DocBook xml format. For new books, I'd really > > like to use org mode, since a) I'm already familiar with it, b) I love > > it, and c) I believe it does (or can be made to do) nearly everything I > > need. > > Nice. Of many things XML is ill-suited to, marking text up is a nice > exception: it seems really good at it (definitely way better than LaTeX, > of which I'm a great fan!). > I'm also a big LaTeX fan, but I don't use it often enough to remember everything I need. I rely on copying stretches from documents I created earlier, or constantly having to Google for solutions. One thing I like about org-mode for creating documents (as opposed to all its other uses), is the fact that I can easily remember the simple mark-up, see reminders on screen while editing, and easily generate HTML and PDF. > > 3. The direct route from org to DocBook xml seems to be missing. From > > Why not start with the HTML exporter and write your own one? It's quite > fun, and can be done in reasonable time. > For some definition of "reasonable." Seriously, I might want to do this as an exercise sometime, but I can't wait for that right now. > > > 4. [LONGSHOT] Is there any way to /import/ docbook xml into org mode? > > XSLT? > Yes, that's a good option I hadn't considered. > > Hth, > Definitely. Thanks! -pd -- Peter Davis www.techcurmudgeon.com
Re: [O] Making DocBook xml books from org mode?
On 2016-09-29, at 20:04, Peter Daviswrote: > I've started a new position in which I have to create and maintain a > large set of documents in DocBook xml format. For new books, I'd really > like to use org mode, since a) I'm already familiar with it, b) I love > it, and c) I believe it does (or can be made to do) nearly everything I > need. Nice. Of many things XML is ill-suited to, marking text up is a nice exception: it seems really good at it (definitely way better than LaTeX, of which I'm a great fan!). > 3. The direct route from org to DocBook xml seems to be missing. From Why not start with the HTML exporter and write your own one? It's quite fun, and can be done in reasonable time. I did a talk about writing your own Org exporter during EmacsConf 2015; also, I had a plan (and I even started) for a series of blog posts on that topic, but I don't have time for that now. Still, you might want to pursue this road - you'd have (as opposed to Pandoc, which admittedly is a great tool, but has its limitations, as Joost mentioned) full control over what get exported to what. > 4. [LONGSHOT] Is there any way to /import/ docbook xml into org mode? XSLT? > Thank you very much. > > -pd Hth, -- Marcin Borkowski
Re: [O] Making DocBook xml books from org mode?
Dear Joost, On Thu, Sep 29, 2016, at 03:23 PM, Joost Kremers wrote: > > On Thu, Sep 29 2016, Peter Davis wrote: > > > > but the PDFs I'm getting still look like articles. (I copied the > > above from some examples posted on this list a while ago. Thanks!) > > Your LaTeX_CLASS is set to `koma-article', so that makes sense. > Ah, yes! Thanks. > > > 2. Are there any advantages to considering MarkDown or AsciiDoc as > > opposed to org markup? (Again, my familiarity with org is a strong > > incentive here, but I'm willing to consider other options.) > > There is a (IMHO) excellent markdown-mode available on Melpa, and if you > use Pandoc[1] to convert your documents you have a lot of flexibility. > There's also `pandoc-mode' (of which I'm the author), a minor mode that > makes interacting with pandoc from within Emacs easier. > Bravo! Thank you again. > > > 3. The direct route from org to DocBook xml seems to be missing. From > > what I gather, I can get there somehow via texi (but I don't even have > > that in org currently), or perhaps export to HTML and then convert that > > to db xml. Am I missing something? Is there some other route I should > > consider? > > Pandoc can convert to Docbook, so that might be an option. Note that > Pandoc also converts *from* Org, (although it cannot handle all of Org's > capabilities), so depending on your needs, that might be a way to go > directly from Org to Docbook. > Thank you. I did succeed in exporting from org to texi, and then makeinfo'ing that into a DocBook xml, though a bit of hand editing was necessary. > > > 4. [LONGSHOT] Is there any way to /import/ docbook xml into org mode? > > Pandoc also converts *from* Docbook, and can convert *to* Org, so again, > that might be of help. > > Of course, whether Pandoc can be useful to you really depends on your > needs. Pandoc's internal document representation is based on Markdown, > and by its very nature Markdown is more limited in it capabilities than > Org. In essence, anything that cannot be handled by (Pandoc's version > of) Markdown, cannot be handled by Pandoc in other formats. > Thanks. Sounds like Pandoc should really be in my toolkit. > > HTH Definitely! Thanks, -pd -- Peter Davis www.techcurmudgeon.com
Re: [O] Making DocBook xml books from org mode?
On Thu, Sep 29 2016, Peter Davis wrote: > I've started a new position in which I have to create and maintain a > large set of documents in DocBook xml format. For new books, I'd really > like to use org mode, since a) I'm already familiar with it, b) I love > it, and c) I believe it does (or can be made to do) nearly everything I > need. > > However, after Googling around the org-mode/DocBook space, I'm left with > some questions. > > 1. I'm going to be creating books, as opposed to articles. My org-header > looks like this: > > #+STARTUP: showeverything logdone > #+OPTIONS: H:5 num:t \n:nil @:t ::t |:t ^:nil -:t f:t *:t <:t > #+LaTeX_CLASS: koma-article > #+LaTeX_HEADER: \usepackage{listings} > #+LATEX_HEADER: \setlength{\parskip}{2ex plus 4pt minus 2pt} > #+LATEX_HEADER: \setlength{\parindent}{0pt} > #+LATEX_HEADER: \renewcommand{\baselinestretch}{1.0} > #+LATEX_HEADER: \setlength{\topsep}{-10pt} > #+LATEX_HEADER: \setlength{\partopsep}{0pt} > #+LaTeX_HEADER: \usepackage{xcolor} > #+LaTeX_HEADER: \lstset{ > #+LaTeX_HEADER: basicstyle=\ttfamily, > #+LaTeX_HEADER: breaklines=true, > #+LaTeX_HEADER: > prebreak=\mbox{\ensuremath{\color{red}\hookleftarrow}}, > #+LaTeX_HEADER: > postbreak=\raisebox{0ex}[0ex][0ex]{\ensuremath{\color{red}\hookrightarrow\space}}, > #+LaTeX_HEADER: columns=fullflexible, > #+LaTeX_HEADER: keepspaces=true > #+LaTeX_HEADER: } > #+LaTeX_CLASS_OPTIONS: > [book,letterpaper,times,12pt,listings-bw,microtype] > > but the PDFs I'm getting still look like articles. (I copied the > above from some examples posted on this list a while ago. Thanks!) Your LaTeX_CLASS is set to `koma-article', so that makes sense. > 2. Are there any advantages to considering MarkDown or AsciiDoc as > opposed to org markup? (Again, my familiarity with org is a strong > incentive here, but I'm willing to consider other options.) There is a (IMHO) excellent markdown-mode available on Melpa, and if you use Pandoc[1] to convert your documents you have a lot of flexibility. There's also `pandoc-mode' (of which I'm the author), a minor mode that makes interacting with pandoc from within Emacs easier. > 3. The direct route from org to DocBook xml seems to be missing. From > what I gather, I can get there somehow via texi (but I don't even have > that in org currently), or perhaps export to HTML and then convert that > to db xml. Am I missing something? Is there some other route I should > consider? Pandoc can convert to Docbook, so that might be an option. Note that Pandoc also converts *from* Org, (although it cannot handle all of Org's capabilities), so depending on your needs, that might be a way to go directly from Org to Docbook. > 4. [LONGSHOT] Is there any way to /import/ docbook xml into org mode? Pandoc also converts *from* Docbook, and can convert *to* Org, so again, that might be of help. Of course, whether Pandoc can be useful to you really depends on your needs. Pandoc's internal document representation is based on Markdown, and by its very nature Markdown is more limited in it capabilities than Org. In essence, anything that cannot be handled by (Pandoc's version of) Markdown, cannot be handled by Pandoc in other formats. HTH -- Joost Kremers Life has its moments