From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/11717 Path: news.gmane.org!not-for-mail From: Matthew Pickering Newsgroups: gmane.text.pandoc Subject: Re: LaTeX Headers/Macros in pandoc conversion Date: Fri, 9 Jan 2015 22:31:13 +0000 Message-ID: References: <90cb9924-0ed1-441a-8ef2-f2e3928a165c@googlegroups.com> <20150109193307.GA90254@localhost.hsd1.ca.comcast.net> <039f5de8-68e3-42a7-9f9c-cdc6bde24bc4@googlegroups.com> <40a476ba-e1a8-413e-ab7e-584f21f70101@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1420842682 2289 80.91.229.3 (9 Jan 2015 22:31:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 9 Jan 2015 22:31:22 +0000 (UTC) To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBCO2LGEC4AIBBMNNYGSQKGQEXLOXGXA-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Fri Jan 09 23:31:16 2015 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-la0-f60.google.com ([209.85.215.60]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Y9i5L-000623-0z for gtp-pandoc-discuss@m.gmane.org; Fri, 09 Jan 2015 23:31:15 +0100 Original-Received: by mail-la0-f60.google.com with SMTP id pn19sf1531283lab.5 for ; Fri, 09 Jan 2015 14:31:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20120806; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:x-original-sender:x-original-authentication-results :reply-to:precedence:mailing-list:list-id:list-post:list-help :list-archive:sender:list-subscribe:list-unsubscribe; bh=xS+MHnV7JGmlJdgwKKrJh3s02aXJtbTO5JBH38lkZqQ=; b=Inr76JGMqTjYOBSyGENSfBzE8SSN4La8nXAJQXJR8+oGEDRA90Tu5RQqM+KGYGSp77 VbeNwmF3YaUJQdnw7tiLJUCc5FozeGAzE2P+aNj3zVPGEi9EvDTJ3BAPCVlkeZte0IO5 PUGlUIJViIDz6KSf1hHjCoe2s61A9sVaztHHVpLRAu1ufTNzYEqRg2gZp88sx/hyhFhX d8xOlnBQR9r3hueYfg7CEFKLj1KuO6u8eOr3bJN2UWcrJE4B67ALjaWKXvyJbAagy9X4 tL4VUqR3N+Mt47hyaZqN8zxtk7hQEeqbFE717124tpGH7WnlHR7j7p/jhGJ0vSsib9Aq wuxg== X-Received: by 10.152.203.161 with SMTP id kr1mr53081lac.8.1420842674651; Fri, 09 Jan 2015 14:31:14 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 10.152.44.232 with SMTP id h8ls515347lam.3.gmail; Fri, 09 Jan 2015 14:31:13 -0800 (PST) X-Received: by 10.112.161.201 with SMTP id xu9mr211lbb.11.1420842673500; Fri, 09 Jan 2015 14:31:13 -0800 (PST) Original-Received: from mail-la0-x22d.google.com (mail-la0-x22d.google.com. [2a00:1450:4010:c03::22d]) by gmr-mx.google.com with ESMTPS id m9si1019239lbp.0.2015.01.09.14.31.13 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 09 Jan 2015 14:31:13 -0800 (PST) Received-SPF: pass (google.com: domain of matthewtpickering-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:4010:c03::22d as permitted sender) client-ip=2a00:1450:4010:c03::22d; Original-Received: by mail-la0-x22d.google.com with SMTP id gq15so16852295lab.4 for ; Fri, 09 Jan 2015 14:31:13 -0800 (PST) X-Received: by 10.112.160.104 with SMTP id xj8mr24183756lbb.62.1420842673371; Fri, 09 Jan 2015 14:31:13 -0800 (PST) Original-Received: by 10.114.91.136 with HTTP; Fri, 9 Jan 2015 14:31:13 -0800 (PST) In-Reply-To: <40a476ba-e1a8-413e-ab7e-584f21f70101-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> X-Original-Sender: matthewtpickering-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of matthewtpickering-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:4010:c03::22d as permitted sender) smtp.mail=matthewtpickering-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dkim=pass header.i=@gmail.com; dmarc=pass (p=NONE dis=NONE) header.from=gmail.com Precedence: list Mailing-list: list pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org; contact pandoc-discuss+owners-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org List-ID: X-Google-Group-Id: 1007024079513 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Xref: news.gmane.org gmane.text.pandoc:11717 Archived-At: \newcommand is supported. Does the simple file not work for you ``` \newcommand{\varName}{TESTMACRO!} \varName ``` ? On Fri, Jan 9, 2015 at 8:22 PM, Mike Hynes <91mbbh-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > I should also mention that even just concatenating my header and body files > into the classic latex slurry produces the same effect: no \FIG macros. > > I've also defined a simple, no-parameter testing macro: > \newcommand{\varName}{TESTMACRO!} > > This does not get converted correctly using pandoc; the macro is removed > entirely if it is contained simply in text, as in \varName\ in the current > sentence. If I write $\varName$, my macros appears as: the following in the > output file: \(\varName\). > > This seems like a strange bug to me---is no \newcommand supported? Or have I > not supplied the correct flags to pandoc? > > > On Friday, January 9, 2015 at 3:12:58 PM UTC-5, Mike Hynes wrote: >> >> Version: >> >> >> pandoc -v >> pandoc 1.13.2 Compiled with texmath 0.8.0.1, highlighting-kate 0.5.11.1. >> Syntax highlighting is supported for the following languages: abc, >> actionscript, ada, agda, apache, asn1, asp, awk, bash, bibtex, boo, c, >> changelog, clojure, cmake, coffee, coldfusion, commonlisp, cpp, cs, css, >> curry, d, diff, djangotemplate, dockerfile, dot, doxygen, doxygenlua, dtd, >> eiffel, email, erlang, fasm, fortran, fsharp, gcc, glsl, gnuassembler, go, >> haskell, haxe, html, ini, isocpp, java, javadoc, javascript, json, jsp, >> julia, latex, lex, lilypond, literatecurry, literatehaskell, lua, m4, >> makefile, mandoc, markdown, mathematica, matlab, maxima, mediawiki, >> metafont, mips, modelines, modula2, modula3, monobasic, nasm, noweb, >> objectivec, objectivecpp, ocaml, octave, opencl, pascal, perl, php, pike, >> postscript, prolog, pure, python, r, relaxng, relaxngcompact, rest, rhtml, >> roff, ruby, rust, scala, scheme, sci, sed, sgml, sql, sqlmysql, >> sqlpostgresql, tcl, tcsh, texinfo, verilog, vhdl, xml, xorg, xslt, xul, >> yacc, yaml, zsh Default user data directory: /home//mike/.pandoc Copyright >> (C) 2006-2014 John MacFarlane Web: http://johnmacfarlane.net/pandoc This is >> free software; see the source for copying conditions. There is no warranty, >> not even for merchantability or fitness for a particular purpose. >> >> >> uname -a >> Linux seuss 3.17.3-1-ARCH #1 SMP PREEMPT Fri Nov 14 23:13:48 CET 2014 >> x86_64 GNU/Linux >> >> As for running >> >> pandoc -s --listings header.tex main.tex -o output.tex >> I get the same problem (with or without the -s flag) that my macros are >> not processed. >> >> I also commented out the lines: >> \documentclass{article} >> and >> \input{header} >> in the respective files when supplying the files on the commandline to be >> concatenated. The same problem occurs: my macros are not expanded. With the >> -s flag, I will see my macro definitions in the output file, but any >> reference to them in the body is obliterated. >> >> Thank you for your time---any ideas you have are appreciated. >> >> >> On Friday, January 9, 2015 at 2:33:21 PM UTC-5, John MacFarlane wrote: >>> >>> What pandoc version are you using? >>> >>> `\input` should be supported, but you'd need `header.tex` to be in the >>> working directory. >>> >>> You can also try simply putting `header.tex` on the command line: >>> >>> pandoc header.tex main.tex >>> >>> This produces the same output as if you had the contents of >>> `header.tex` at the beginning of `main.tex`. >>> >>> >>> +++ Mike Hynes [Jan 09 15 10:27 ]: >>> >Hello, >>> > >>> >I am trying to use pandoc to convert my latex files into other doc >>> > types, >>> >mainly html and doc. >>> > >>> >My latex documents generally have the following format: >>> > >>> >\input{header} >>> >\begin{document} >>> > body text as usual >>> >\end{document} >>> > >>> >The file header.tex is either contained in the same directory, or in >>> >~/texmf/tex/latex/headers/. In my headers, I have frequently-used macros >>> >such as: >>> > >>> >\newcommand{\FIG}[3]{ >>> >\begin{figure}[h!] >>> >\centering >>> >\includegraphics[width=#2\columnwidth,angle=0]{#1} >>> >\caption{#3} >>> >\label{fig:#1} >>> >\end{figure} >>> >} >>> > >>> >That is, I use almost *no* latex commands in my writing, and make >>> > frequent >>> >use of macros to simplify inclusion tables, figures, algorithms, >>> >mathematical formulae, etc. >>> > >>> >I would like to run pandoc on such documents, but am having trouble. My >>> >macros are not getting parsed, and when I run pandoc with >>> >--template=$USER/texmf/tex/latex/report.tex (or with an -H flag), I >>> > often >>> >just have the file echoed back to with, without any conversion of the >>> >specified input files. >>> > >>> >Can someone please direct me to the most efficient way of processing my >>> > tex >>> >files, given their macro-heavy format? I can't seem to find the correct >>> >flags in the documentation for what I'm trying to do. >>> > >>> >Thanks >>> > >>> >-- >>> >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-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>> >To post to this group, send email to pandoc-...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>> >To view this discussion on the web visit >>> > https://groups.google.com/d/msgid/pandoc-discuss/90cb9924-0ed1-441a-8ef2-f2e3928a165c%40googlegroups.com. >>> >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/40a476ba-e1a8-413e-ab7e-584f21f70101%40googlegroups.com. > > For more options, visit https://groups.google.com/d/optout.