BibTeX citations from Leo

95 views
Skip to first unread message

Juaco

unread,
Jan 16, 2012, 3:49:33 PM1/16/12
to leo-editor
Currently I am using Leo as an outliner for the elaboration of
documents with LaTeX. For this, I work with @rst nodes and Sphinx. It
works really wonderful.

When using citations, Sphinx and RsT offer a certain syntax that, as
far as I have understood, does allow only for the generation of
"simple", Leo-self-contained citation references (inside of say a "Leo
References Section" node).

So I use a citation of the form [CITBook001]_ inline in the text.
Somewhere else in the same Leo outline I have the corresponding
description as:

.. [CITBook001] A citation as well-known

When using LaTeX and BibTeX, I would like to use inside of Leo a kind
of LaTeX-inline-markup, that after generation of the RsT file through
Sphinx as well as after running of "make latex", it generates a LaTeX
file containing the citation call of the form \cite{CITBook001} as
described in a file *.bib. The only way I follow today is the later
editing by hand of the LaTeX file. This is of course not the best way.
How to convince Leo/Sphinx/RsT to generate the inline raw latex
syntax? It could be very simple, but ... I haven not been able to see
it.

Any hints?

Thanks in advance for any help!

HansBKK

unread,
Jan 16, 2012, 8:35:39 PM1/16/12
to leo-e...@googlegroups.com
Sorry I can't address your specific question, but wanted to mention that I'm using Leo for much the same thing using Txt2Tags, which also has a LaTeX output option - which specific component I haven't used yet.

Another tool that is more actively updated and with a lot of sophisticated LaTeX users is Pandoc, and I'm 99% sure that will support what you are trying to do - very responsive g_group here. If you're interested in exploring other options, perhaps my (very much work in progress) markup-conversion pivot-table here would be helpful.

Note that Leo works perfectly well with text files containing any arbitrary markup syntax, but of course doesn't currently have any built-in support for render-preview or other syntax-specific support other than reST. I would like to see support added for other markup schemes, and outlined some ideas here, just in case they are useful to you or other future googlers.

Terry Brown

unread,
Jan 16, 2012, 11:34:56 PM1/16/12
to leo-e...@googlegroups.com
On Mon, 16 Jan 2012 12:49:33 -0800 (PST)
Juaco <joaqui...@gmx.de> wrote:

> This is of course not the best way.
> How to convince Leo/Sphinx/RsT to generate the inline raw latex
> syntax?

http://docutils.sourceforge.net/docs/ref/rst/directives.html#raw-data-pass-through

?

Cheers -Terry

Juaco

unread,
Jan 17, 2012, 3:32:57 PM1/17/12
to leo-editor
Thanks a lot for your suggestion. I will try it!

Regards, Juaco

On 17 Jan., 05:34, Terry Brown <terry_n_br...@yahoo.com> wrote:
> On Mon, 16 Jan 2012 12:49:33 -0800 (PST)
>
> Juaco <joaquinlop...@gmx.de> wrote:
> > This is of course not the best way.
> > How to convince Leo/Sphinx/RsT to generate the inline raw latex
> > syntax?
>
> http://docutils.sourceforge.net/docs/ref/rst/directives.html#raw-data...
>
> ?
>
> Cheers -Terry

Juaco

unread,
Jan 17, 2012, 3:38:23 PM1/17/12
to leo-editor
Thanks for all your proposals. They are really new for me, possibly as
Sphinx and rsT were as I began working with Leo. Nevertheless: As soon
as I have a success (I assume I will have it) I would make a summary
of that. It might help some other potentially interested users.

Regards, Juaco

On 17 Jan., 02:35, HansBKK <hans...@gmail.com> wrote:
> ...
> I'm using Leo for much the same thing using Txt2Tags, which also has a
> LaTeX output option - which specific component I haven't used yet.
>
> Another tool ... is Pandoc ...
> ... other options, perhaps my (very much work
> in progress) markup-conversion pivot-table here<https://docs.google.com/spreadsheet/pub?hl=en_US&hl=en_US&key=0Ali3Yy...>would be helpful.
>
> ... I
> would like to see support added for other markup schemes, and outlined some
> ideas here<https://groups.google.com/d/msg/leo-editor/nNEnxoohFBM/XkMPQhqhDRsJ>,
> ...

Juaco

unread,
Jan 22, 2012, 2:20:51 AM1/22/12
to leo-editor
To my original question I followed the recommendations of Terry. It
was much easier as I thought! Here a summary of the use of custom
roles in Leo to generate LaTeX "inline markup" from Leo:

+ @ rst-no head Defining the custom role, here applicable to html and
latex syntax
.. role:: raw-role(raw)
:format: html latex

+ @A document section
This is my text including an example of inline markup for
generating :raw-role:`\LaTeX\` from Leo. For more details see :raw-
role:`\cite{rstDocumentation}`. Of course, my bib database below will
describe this citation with plenty of details.

+ @rst-no-head Including the bib database
.. raw:: latex

\bibliographystyle{acm}
\bibliography{myBibliography}

It worked really fine!

I haven't followed the recommendations of HansBKK trying Pantoc and
markup-conversion pivot-tables, but I read that there is a new
discussion on this.

Thanks a lot!

On 17 Jan., 05:34, Terry Brown <terry_n_br...@yahoo.com> wrote:
> On Mon, 16 Jan 2012 12:49:33 -0800 (PST)
>
> Juaco <joaquinlop...@gmx.de> wrote:
> > This is of course not the best way.
> > How to convince Leo/Sphinx/RsT to generate the inline raw latex
> > syntax?
>
> http://docutils.sourceforge.net/docs/ref/rst/directives.html#raw-data...
>
> ?
>
> Cheers -Terry

Edward K. Ream

unread,
Jan 22, 2012, 7:19:13 AM1/22/12
to leo-e...@googlegroups.com
On Sun, Jan 22, 2012 at 1:20 AM, Juaco <joaqui...@gmx.de> wrote:
> To my original question I followed the recommendations of Terry. It
> was much easier as I thought! Here a summary of the use of custom
> roles in Leo to generate LaTeX "inline markup" from Leo:

Many thanks for this report. I've made a note to myself to include it
in the next round of documentation. It's great to see this
collaboration between Leo's users.

Edward

HansBKK

unread,
Jan 23, 2012, 1:29:27 AM1/23/12
to leo-e...@googlegroups.com

On Sunday, January 22, 2012 2:20:51 PM UTC+7, Juaco wrote:
I haven't followed the recommendations of HansBKK trying Pantoc and markup-conversion pivot-tables, but I read that there is a new discussion on this.

Pantoc is only useful if you need output to target formats not supported by reST/Sphinx/Docutils.

Note that my pivot-table is just an information reference for those interested in comparing various the various text conversion/generation tools, not a tool in itself. In fact at this point it's just a flat spreadsheet, I haven't put the time into figuring out how to make the pivot-table part of it useful, as it's easy enough just to re-jig the column-sort order to compare the data sets however you like.

Reply all
Reply to author
Forward
0 new messages