public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: John MacFarlane <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org>
To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
Subject: Re: Use of RCS with pandoc YAML blocks - SOLVED
Date: Thu, 21 Aug 2014 17:08:11 -0700	[thread overview]
Message-ID: <20140822000810.GH32670@berkeley.edu> (raw)
In-Reply-To: <d77c8bf8-79c6-4643-82d6-407611fc2d13-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>

I meant for you to define \noop as
\newcommand{\noop}[1]{#1} so it passes through the contained
command.  If you do that, and put in the single quotes so YAML
doesn't get confused, it works:


---
title: Test  Document
header-includes:
  - '\usepackage{fancyhdr}'
  - '\usepackage{lastpage}'
  - '\usepackage{rcs}'
  - '\newcommand{\noop}[1]{#1}'
  - '\noop{\RCS $Revision: 1.1 $}'
  - '\noop{\RCS $Date: 2014/08/18 14:24:49 $}'
  - '\pagestyle{fancy}'
  - '\fancyfoot[R]{Revision:\ \RCSRevision}'
  - '\fancyfoot[L]{\RCSDate}'
  - '\date{\RCSDate}'
author: Pete Phillips
...

ok
\newpage
then

+++ Pete Phillips [Aug 21 14 02:16 ]:
>   Hi John.
>   On Wednesday, 20 August 2014 17:32:55 UTC+1, John MacFarlane wrote:
>
>     The difference is explained by the following item in the changelog:
>         + Inline math must have nonspace before final `$` (#1313).
>     In 1.12.4, your RCS string was being erroneously parsed as LaTeX
>     math.  This had the good consequence (for you) that it was rendered
>     verbatim, without escaping the $'s.  But this was a bug in the
>     markdown
>     reader, which has now been fixed.
>
>   OK - that explains my few months of happiness then. ;-)
>
>
>
>     >   If it was possible to revert to that behaviour for the YAML
>     block I
>     >   would be a happy bunny.  Is that possible ?
>     Sorry, no.  I did think of a workaround which is a bit kludgy, but
>     might
>     work.  Suppose you defined a do-nothing macro \noop{..}, then
>     enclosed
>     your RCS in that:
>         \noop{\RCS $blah blah $}
>
>   I have tried this:
>
>   ---
>   title: Test  Document
>   header-includes:
>       - \usepackage{fancyhdr}
>       - \usepackage{lastpage}
>       - \usepackage{rcs}
>       - \newcommand{\noop}[1]{}
>       - \noop{\RCS $Revision: 1.1 $}
>       - \noop{\RCS $Date: 2014/08/18 14:24:49 $}
>       - \pagestyle{fancy}
>       - \fancyfoot[R]{Revision:\ \RCSRevision}
>       - \fancyfoot[L]{\RCSDate}
>       - \date{\RCSDate}
>   author: Pete Phillips
>   ---
>   § test
>   test
>   \newpage
>   § more test
>   test
>
>   And running
>
>    pandoc -s --parse-raw testoldrcs.mkd -o testoldrcs.pdf
>
>   I get the error:
>
>   ! LaTeX Error: Missing \begin{document}.
>
>   This is the same error I was getting in the early days of trying this
>   out.  Previously it was solved by adding quotes -     - '\RCS
>   $Revision: 1.2 $'
>
>   but that makes no difference now.  The latex generated is attached.
>   Note that using --parse-raw makes no difference to the latex code - I
>   get the same code with of without that option.
>
>   Pete
>
>
>
>
>
>   --
>   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 [1]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>   To post to this group, send email to
>   [2]pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>   To view this discussion on the web visit
>   [3]https://groups.google.com/d/msgid/pandoc-discuss/d77c8bf8-79c6-4643-
>   82d6-407611fc2d13%40googlegroups.com.
>   For more options, visit [4]https://groups.google.com/d/optout.
>
>References
>
>   1. mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
>   2. mailto:pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
>   3. https://groups.google.com/d/msgid/pandoc-discuss/d77c8bf8-79c6-4643-82d6-407611fc2d13%40googlegroups.com?utm_medium=email&utm_source=footer
>   4. https://groups.google.com/d/optout

>\documentclass[]{article}
>\usepackage{lmodern}
>\usepackage{amssymb,amsmath}
>\usepackage{ifxetex,ifluatex}
>\usepackage{fixltx2e} % provides \textsubscript
>\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
>  \usepackage[T1]{fontenc}
>  \usepackage[utf8]{inputenc}
>\else % if luatex or xelatex
>  \ifxetex
>    \usepackage{mathspec}
>    \usepackage{xltxtra,xunicode}
>  \else
>    \usepackage{fontspec}
>  \fi
>  \defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase}
>  \newcommand{\euro}{€}
>\fi
>% use upquote if available, for straight quotes in verbatim environments
>\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
>% use microtype if available
>\IfFileExists{microtype.sty}{\usepackage{microtype}}{}
>\ifxetex
>  \usepackage[setpagesize=false, % page size defined by xetex
>              unicode=false, % unicode breaks when used with xetex
>              xetex]{hyperref}
>\else
>  \usepackage[unicode=true]{hyperref}
>\fi
>\hypersetup{breaklinks=true,
>            bookmarks=true,
>            pdfauthor={Pete Phillips},
>            pdftitle={Test Document},
>            colorlinks=true,
>            citecolor=blue,
>            urlcolor=blue,
>            linkcolor=magenta,
>            pdfborder={0 0 0}}
>\urlstyle{same}  % don't use monospace font for urls
>\setlength{\parindent}{0pt}
>\setlength{\parskip}{6pt plus 2pt minus 1pt}
>\setlength{\emergencystretch}{3em}  % prevent overfull lines
>\setcounter{secnumdepth}{0}
>
>\title{Test Document}
>\author{Pete Phillips}
>\date{}
>\usepackage{fancyhdr}
>\usepackage{lastpage}
>\usepackage{rcs}
>\newcommand{\noop}[1]{}
>true
>true
>\pagestyle{fancy}
>\fancyfoot[R]{Revision:\ \RCSRevision}
>\fancyfoot[L]{\RCSDate}
>\date{\RCSDate}
>
>\begin{document}
>\maketitle
>
>\section{test}\label{test}
>
>test
>
>\newpage
>
>\section{more test}\label{more-test}
>
>test
>
>\end{document}

-- 
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/20140822000810.GH32670%40berkeley.edu.
For more options, visit https://groups.google.com/d/optout.


  parent reply	other threads:[~2014-08-22  0:08 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-25 10:52 Use of RCS with pandoc YAML blocks Pete Phillips
     [not found] ` <b2239f27-e27b-466c-a625-24df5add19a5-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2014-07-09  7:36   ` Pete Phillips
     [not found]     ` <82c52494-d3e8-418f-b873-cf06c7217f97-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2014-07-10  7:14       ` John MacFarlane
2014-07-10  8:11         ` Use of RCS with pandoc YAML blocks - SOLVED Pete Phillips
     [not found]           ` <b6de5398-e50b-4960-9f21-0071744a3f46-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2014-08-18 14:30             ` Pete Phillips
     [not found]               ` <19f1dbef-ad4e-401e-b549-dd2154c9c531-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2014-08-18 19:44                 ` John MacFarlane
     [not found]                   ` <20140818194437.GB35861-0VdLhd/A9Pm0ooXD8Eul3WdAkF2ioujlTVLZxgkOlNX2fBVCVOL8/A@public.gmane.org>
2014-08-19 12:22                     ` Pete Phillips
     [not found]                       ` <c8feaad3-2044-48aa-9fc2-f105aabdd9af-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2014-08-19 13:31                         ` Matthew Pickering
2014-08-19 16:45                         ` John MacFarlane
     [not found]                           ` <20140819164539.GF17247-bi+AKbBUZKbivNSvqvJHCtPlBySK3R6THiGdP5j34PU@public.gmane.org>
2014-08-20  7:16                             ` Pete Phillips
     [not found]                               ` <c39f2ee3-c05a-45cb-86be-11d134ce999b-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2014-08-20  8:11                                 ` Matthew Pickering
     [not found]                                   ` <CALuQ0m_eY+bY0wfmwEQaAV88tUn+V8Jw4T4KTtBPAA0+1Boi7Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-08-20 13:57                                     ` Pete Phillips
     [not found]                                       ` <ac2faa29-074d-4d46-984c-19b6a6e9774a-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2014-08-20 14:30                                         ` Pete Phillips
     [not found]                                           ` <9326fed8-88cc-44ee-a3bf-574311e40da9-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2014-08-20 15:01                                             ` Matthew Pickering
     [not found]                                               ` <CALuQ0m9dcXhOwf7HFAbSogBwv78nnh7g7Gg_-j3ydja3RpyX2w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-08-20 15:42                                                 ` Pete Phillips
     [not found]                                                   ` <9caf551f-a3ff-4d61-bf91-389f7260db03-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2014-08-20 16:32                                                     ` John MacFarlane
     [not found]                                                       ` <20140820163235.GA18332-bi+AKbBUZKbivNSvqvJHCtPlBySK3R6THiGdP5j34PU@public.gmane.org>
2014-08-21  9:16                                                         ` Pete Phillips
     [not found]                                                           ` <d77c8bf8-79c6-4643-82d6-407611fc2d13-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2014-08-22  0:08                                                             ` John MacFarlane [this message]
     [not found]                                                               ` <20140822000810.GH32670-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org>
2014-08-22  0:33                                                                 ` YAML metadata raw fields [was: Use of RCS with pandoc YAML blocks] John MacFarlane
     [not found]                                                                   ` <20140822003345.GA1999-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org>
2014-08-22  0:57                                                                     ` John MacFarlane
     [not found]                                                                       ` <20140822005703.GA22080-bi+AKbBUZKbivNSvqvJHCtPlBySK3R6THiGdP5j34PU@public.gmane.org>
2014-08-22  8:09                                                                         ` BPJ
2015-05-13  8:31                                                                         ` msprevak
     [not found]                                                                           ` <14456064-1273-444b-8f0e-1491036761ed-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2015-05-13 17:01                                                                             ` John MacFarlane
     [not found]                                                                               ` <20150513170104.GA38274-bi+AKbBUZKbivNSvqvJHCtPlBySK3R6THiGdP5j34PU@public.gmane.org>
2015-05-14 11:21                                                                                 ` msprevak
     [not found]                                                                                   ` <19f5136d-1475-4294-8951-5c9ba7ca15db-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2015-05-14 15:33                                                                                     ` John MacFarlane
     [not found]                                                                                       ` <20150514153337.GA47850-bi+AKbBUZKbivNSvqvJHCtPlBySK3R6THiGdP5j34PU@public.gmane.org>
2015-05-14 20:00                                                                                         ` msprevak
     [not found]                                                                                           ` <c4ef36b4-fa8d-480f-952e-665fe555557a-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2015-05-15  3:53                                                                                             ` John MacFarlane
     [not found]                                                                                               ` <20150515035354.GC48234-bi+AKbBUZKbivNSvqvJHCtPlBySK3R6THiGdP5j34PU@public.gmane.org>
2015-05-15  8:12                                                                                                 ` msprevak
     [not found]                                                                                                   ` <3941739e-8de2-46d9-9bc0-319c31631e3e-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2015-05-15  8:20                                                                                                     ` Nikolay Yakimov
     [not found]                                                                                                       ` <CA+hqrpVke6kK6BXCAg1AthTVKkz9igVJd8R9NY8FXn5wexyPJg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-05-15  9:00                                                                                                         ` msprevak
2015-05-14 22:13                                                                                 ` Nick Yakimov
     [not found]                                                                                   ` <52bd513c-8b8a-4c12-8724-5e26721952a9-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2015-05-15  3:50                                                                                     ` John MacFarlane
     [not found]                                                                                       ` <20150515035032.GB48234-bi+AKbBUZKbivNSvqvJHCtPlBySK3R6THiGdP5j34PU@public.gmane.org>
2015-05-15  3:59                                                                                         ` Nikolay Yakimov
2014-08-22  7:22                                                                 ` Use of RCS with pandoc YAML blocks - SOLVED Pete Phillips

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=20140822000810.GH32670@berkeley.edu \
    --to=jgm-tvlzxgkolnx2fbvcvol8/a@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).