From: Zelphir Kaltstahl <zelphirkaltstahl-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: pandoc-discuss <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Subject: Re: Latex Code inside reST File convert to PDF
Date: Fri, 25 Nov 2016 05:57:54 -0800 (PST) [thread overview]
Message-ID: <0ca5be6f-3992-4db6-a455-f1ed87d7e5a6@googlegroups.com> (raw)
In-Reply-To: <20161125103045.GF77617-l/d5Ua9yGnxXsXJlQylH7w@public.gmane.org>
[-- Attachment #1.1: Type: text/plain, Size: 3010 bytes --]
That's a nice idea.
I already wrote that part of my code though. It's not that much code, so
not much work wasted or anything.
In the end I also decided to not go with the pandoc citation style but the
style reST aready has. My self-argumentation was:
1. When someone writes a rst file, they probably have some kind of syntax
highlighting and rst support or at least are used to writing rst files. So
when I stick to the existing rst syntax, it would be supported by their
tools.
2. It seemed better not to introduce a "completely new" citation style into
rst syntax, when it already has citations. However I added page number
capability, while rst doesn't seem to have that. I guess you could say I am
not consequent on this one.
3. Adding Pandoc's citation style would be very easy in my program, just a
matter of adding a few regexes.
Here is what I got so far:
https://github.com/ZelphirKaltstahl/rst-citations-to-raw-latex
<https://github.com/ZelphirKaltstahl/rst-citations-to-raw-latex>
I run it with:
python -m RSTCitations <rst file with rst citations>
From the directory:
rst-citations-to-raw-latex
After:
git clone
https://github.com/ZelphirKaltstahl/rst-citations-to-raw-latex.git
I already did a test run and it worked well using the following script:
pandoc \
--from=rst \
--preserve-tabs \
--top-level-division=chapter \
--standalone \
--template=template-book-de.latex \
--latex-engine=xelatex \
--bibliography=bibliography.bib \
--natbib \
--metadata=toc:false \
--metadata=title:"Citation Example" \
--metadata=subtitle:"none" \
--metadata=author:"Zelphir" \
--metadata=keywords:"citation style" \
--metadata=subject:"citation" \
--output citation-example-from-rst.latex \
citation-example.rst.out
if [ $? -eq 0 ]; then
echo -e "${SUCCESS_COLOR}Successfully${NO_COLOR} created
${HIGHLIGHT_COLOR}citation-example-from-rst.latex${NO_COLOR}"
else
echo -e "${ERROR_COLOR}Failed${NO_COLOR} to create
${HIGHLIGHT_COLOR}citation-example-from-rst.latex${NO_COLOR}"
exit 1
fi
latexmk -xelatex citation-example-from-rst.latex
In this case:
citation-example.rst.out
is the resulting file from the call of my program.
So far the program makes the assumption, that the raw latex role has not
been defined in the rst file yet and simply adds three lines on top of the
file.
--
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/0ca5be6f-3992-4db6-a455-f1ed87d7e5a6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
[-- Attachment #1.2: Type: text/html, Size: 3798 bytes --]
next prev parent reply other threads:[~2016-11-25 13:57 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-23 19:27 Zelphir Kaltstahl
[not found] ` <dd7df4c5-c089-4141-b29d-1360c5e017f0-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2016-11-23 23:43 ` John MacFarlane
[not found] ` <20161123234304.GF76966-l/d5Ua9yGnxXsXJlQylH7w@public.gmane.org>
2016-11-24 12:18 ` Zelphir Kaltstahl
[not found] ` <a51db0fc-ff96-497b-a316-fa5968cbd4d1-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2016-11-24 13:10 ` John MacFarlane
[not found] ` <20161124131029.GA25992-BKjuZOBx5Kn2N3qrpRCZGbhGAdq7xJNKhPhL2mjWHbk@public.gmane.org>
2016-11-24 17:28 ` Zelphir Kaltstahl
[not found] ` <8ca3f9a4-089c-4a77-82ea-a19107e0a35c-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2016-11-24 17:38 ` Latex files for resume/CV formatting Fernando Botelho
[not found] ` <e5cc7f94-23d9-642e-b8f8-2f38a06f2f66-mxjLRozsjzA@public.gmane.org>
2016-11-24 17:50 ` Zelphir Kaltstahl
[not found] ` <8bc9d081-118e-49fc-95de-122bfd8c1b69-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2016-11-25 12:19 ` Fernando Botelho
2016-11-25 10:30 ` Latex Code inside reST File convert to PDF John MacFarlane
[not found] ` <20161125103045.GF77617-l/d5Ua9yGnxXsXJlQylH7w@public.gmane.org>
2016-11-25 13:57 ` Zelphir Kaltstahl [this message]
[not found] ` <0ca5be6f-3992-4db6-a455-f1ed87d7e5a6-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2016-11-25 13:59 ` Zelphir Kaltstahl
2016-11-24 17:32 ` Zelphir Kaltstahl
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0ca5be6f-3992-4db6-a455-f1ed87d7e5a6@googlegroups.com \
--to=zelphirkaltstahl-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).