public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* TeX output - worth it?
@ 2016-03-26  7:57 Scot Mcphee
  2016-03-26 20:03 ` John MacFarlane
  0 siblings, 1 reply; 4+ messages in thread
From: Scot Mcphee @ 2016-03-26  7:57 UTC (permalink / raw)
  To: pandoc-discuss

[-- Attachment #1: Type: text/plain, Size: 2217 bytes --]

I have been taking my pandoc markdown files for my thesis and producing TeX output rather directly to PDF. 

My “build system” incorporates multiple pandoc markdown files (e.g. one chapter per file) and produces two main outputs: 

1. A PDF per chapter which is generated from pandoc directly.

2. A “total document” output produced in three steps:
    a. first use pandoc to take all the markdown files and make a big one-stop markdown file.
    b. then use pandoc to compile that one-stop markdown file to a TeX file
    c. then use latexmk to compile the tex file to a PDF.

I’ve noticed recently that the markdown>tex>pdf build has been seriously misformatting the bibliography. Obviously also with TeX I don’t get to use nice CSL files, but there’s fundamental transformation issues with the TeX (e.g. page number handling) which looks like the way pandoc is making the TeX output when the target output type is TeX.

Do I bother to persist with the TeX step? Should I just change the second one to

    a. first use pandoc to take all the markdown files and make a big one-stop markdown file.
    b. then use pandoc to compile it to a PDF.

Is there anything that I can’t do with the pandoc command line that I need the TeX file for? I don’t have a lot of complex math (or any in fact), and so far minimal use for tables (when I do use need a table, as I’ve needed for a couple of documents, I’ve put the latex directly into the Pandoc). 

--
Scot Mcphee
Computer Programmer, Classics PhD.
p +61 412 957414
e scot.mcphee-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
http://autonomous.org/

-- 
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/etPan.56f640d6.5dd5a101.b57a%40CrazyMcphee.
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #2: Type: text/html, Size: 4142 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: TeX output - worth it?
  2016-03-26  7:57 TeX output - worth it? Scot Mcphee
@ 2016-03-26 20:03 ` John MacFarlane
       [not found]   ` <20160326200359.GB25366-jF64zX8BO091tJRe0FUodcM6rOWSkUom@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: John MacFarlane @ 2016-03-26 20:03 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

Some tex features require extra processing -- e.g. if you
use bibtex or biblatex, or if you use LaTeX's automatic
indexing capabilities.  But if you're starting from pandoc
markdown without raw TeX, and using pandoc-citeproc for
citations, and you don't use any of these tex features, then
using pandoc to go directly to pdf should
work fine.

PS. You can use pandoc-citeproc when you're producing
TeX, rather than using bibtex or biblatex.  pandoc-citeproc
will work with any output format.

+++ Scot Mcphee [Mar 26 16 17:57 ]:
>   I have been taking my pandoc markdown files for my thesis and producing
>   TeX output rather directly to PDF.
>   My “build system” incorporates multiple pandoc markdown files (e.g. one
>   chapter per file) and produces two main outputs:
>   1. A PDF per chapter which is generated from pandoc directly.
>   2. A “total document” output produced in three steps:
>       a. first use pandoc to take all the markdown files and make a big
>   one-stop markdown file.
>       b. then use pandoc to compile that one-stop markdown file to a TeX
>   file
>       c. then use latexmk to compile the tex file to a PDF.
>   I’ve noticed recently that the markdown>tex>pdf build has been
>   seriously misformatting the bibliography. Obviously also with TeX I
>   don’t get to use nice CSL files, but there’s fundamental transformation
>   issues with the TeX (e.g. page number handling) which looks like the
>   way pandoc is making the TeX output when the target output type is TeX.
>   Do I bother to persist with the TeX step? Should I just change the
>   second one to
>       a. first use pandoc to take all the markdown files and make a big
>   one-stop markdown file.
>       b. then use pandoc to compile it to a PDF.
>   Is there anything that I can’t do with the pandoc command line that I
>   need the TeX file for? I don’t have a lot of complex math (or any in
>   fact), and so far minimal use for tables (when I do use need a table,
>   as I’ve needed for a couple of documents, I’ve put the latex directly
>   into the Pandoc).
>
>   --
>   Scot Mcphee
>   Computer Programmer, Classics PhD.
>   p +61 412 957414
>   e scot.mcphee-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
>   http://autonomous.org/
>
>   --
>   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/etPan.56f640d6.5dd5
>   a101.b57a%40CrazyMcphee.
>   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/etPan.56f640d6.5dd5a101.b57a@CrazyMcphee?utm_medium=email&utm_source=footer
>   4. https://groups.google.com/d/optout

-- 
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/20160326200359.GB25366%40MacBook-Air-2.local.
For more options, visit https://groups.google.com/d/optout.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: TeX output - worth it?
       [not found]   ` <20160326200359.GB25366-jF64zX8BO091tJRe0FUodcM6rOWSkUom@public.gmane.org>
@ 2016-03-27  0:41     ` Scot Mcphee
  2016-03-27 15:30       ` Jesse Rosenthal
  0 siblings, 1 reply; 4+ messages in thread
From: Scot Mcphee @ 2016-03-27  0:41 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

[-- Attachment #1: Type: text/plain, Size: 6371 bytes --]

The one thing I’ve seen which I think TeX definitely does which is better than pandoc's output is simply this:

In my tex template:
  
\newenvironment{theendmatter}%
{\SingleSpacing \setlength{\parskip}{0.5em} \setlength{\parindent}{0em}}%
{\setlength{\parskip}{0em}}

[ . . .]

\begin{theendmatter}
\printbibliography[title=Works Cited]
\end{theendmatter}

This is ignored if I go directly from markdown to PDF. The bibliography uses the same basic text formatting as the main body. I understand that pandoc is using pandoc-citeproc to read CSL and that the “bibliography” in the intermediate TeX is more like pandoc-citeproc output as body text appended to the document. I think that Pandoc needs a command line argument to specific the name of the environment in which to enclose that bibliography.

The other thing I think that pandoc can do better is that when it outputs raw TeX cites, it should turn 

[@Author2016 p.12] 

into 

\autocite[12]{Author2016}

rather than

\autocite[ p.12]{Author2016}

The “p.12” is properly processed through citeproc, just not transformed into raw Biblatex correctly.

I’d love to get pandoc-citeproc working with TeX but I don’t have the time! TeX is hard enough. Also now I’ve got my bib latex styles much closer to what I need for my thesis, CSL is nearly there but not quite. ;-)

Thanks
Scot

--
Scot Mcphee
Computer Programmer, Classics PhD.
p +61 412 957414
e scot.mcphee-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
http://autonomous.org/

From: John MacFarlane <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org>
Reply: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <pandoc-discuss-/JYPxA39Uh4Ykp1iOSErHA@public.gmane.orgm>
Date: 27 March 2016 at 06:04:13  
To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Subject:  Re: TeX output - worth it?  

Some tex features require extra processing -- e.g. if you  
use bibtex or biblatex, or if you use LaTeX's automatic  
indexing capabilities. But if you're starting from pandoc  
markdown without raw TeX, and using pandoc-citeproc for  
citations, and you don't use any of these tex features, then  
using pandoc to go directly to pdf should  
work fine.  

PS. You can use pandoc-citeproc when you're producing  
TeX, rather than using bibtex or biblatex. pandoc-citeproc  
will work with any output format.  

+++ Scot Mcphee [Mar 26 16 17:57 ]:  
> I have been taking my pandoc markdown files for my thesis and producing  
> TeX output rather directly to PDF.  
> My “build system” incorporates multiple pandoc markdown files (e.g. one  
> chapter per file) and produces two main outputs:  
> 1. A PDF per chapter which is generated from pandoc directly.  
> 2. A “total document” output produced in three steps:  
> a. first use pandoc to take all the markdown files and make a big  
> one-stop markdown file.  
> b. then use pandoc to compile that one-stop markdown file to a TeX  
> file  
> c. then use latexmk to compile the tex file to a PDF.  
> I’ve noticed recently that the markdown>tex>pdf build has been  
> seriously misformatting the bibliography. Obviously also with TeX I  
> don’t get to use nice CSL files, but there’s fundamental transformation  
> issues with the TeX (e.g. page number handling) which looks like the  
> way pandoc is making the TeX output when the target output type is TeX.  
> Do I bother to persist with the TeX step? Should I just change the  
> second one to  
> a. first use pandoc to take all the markdown files and make a big  
> one-stop markdown file.  
> b. then use pandoc to compile it to a PDF.  
> Is there anything that I can’t do with the pandoc command line that I  
> need the TeX file for? I don’t have a lot of complex math (or any in  
> fact), and so far minimal use for tables (when I do use need a table,  
> as I’ve needed for a couple of documents, I’ve put the latex directly  
> into the Pandoc).  
>  
> --  
> Scot Mcphee  
> Computer Programmer, Classics PhD.  
> p +61 412 957414  
> e scot.mcphee-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org  
> http://autonomous.org/  
>  
> --  
> 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/etPan.56f640d6.5dd5  
> a101.b57a%40CrazyMcphee.  
> 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/etPan.56f640d6.5dd5a101.b57a@CrazyMcphee?utm_medium=email&utm_source=footer  
> 4. https://groups.google.com/d/optout  

--  
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/20160326200359.GB25366%40MacBook-Air-2.local.  
For more options, visit https://groups.google.com/d/optout.  

-- 
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/etPan.56f72c4c.291dbd8e.b57a%40CrazyMcphee.
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #2: Type: text/html, Size: 11023 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: TeX output - worth it?
  2016-03-27  0:41     ` Scot Mcphee
@ 2016-03-27 15:30       ` Jesse Rosenthal
  0 siblings, 0 replies; 4+ messages in thread
From: Jesse Rosenthal @ 2016-03-27 15:30 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 1611 bytes --]

On Saturday, March 26, 2016 at 8:42:07 PM UTC-4, Scot Mcphee wrote:
>
> I think that Pandoc needs a command line argument to specific the name of 
> the environment in which to enclose that bibliography.
>

I agree that something like this would be useful. I have a filter that I 
use, which does the job for me. But since I use it every time, I'd be 
interested to see something like it in pandoc-citeproc. Here's the filter, 
in case it's useful. Note that it uses memoir-specific commands, but you 
could replace them with whatever env you wanted.

{-# LANGUAGE PatternGuards #-}

import Text.Pandoc.JSON

formatBib :: Maybe Format -> Block -> Block
formatBib (Just (Format "latex")) (Div attr blks)
  | ("refs", _, _) <- attr =
      let blks' =
            [RawBlock (Format "tex") 
"\\begin{hangparas}{.25in}{1}\\begin{SingleSpace}"] ++
            blks ++
            [RawBlock (Format "tex") "\\end{SingleSpace}\\end{hangparas}"]
      in
        Div attr blks'
formatBib _ blk = blk

main :: IO ()
main = toJSONFilter formatBib 


-- 
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/bc7ade3d-4baa-4f1c-93b1-8372ec706e36%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #1.2: Type: text/html, Size: 6396 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-03-27 15:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-26  7:57 TeX output - worth it? Scot Mcphee
2016-03-26 20:03 ` John MacFarlane
     [not found]   ` <20160326200359.GB25366-jF64zX8BO091tJRe0FUodcM6rOWSkUom@public.gmane.org>
2016-03-27  0:41     ` Scot Mcphee
2016-03-27 15:30       ` Jesse Rosenthal

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).