From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/26097 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: John MacFarlane Newsgroups: gmane.text.pandoc Subject: Re: Approach to converting large, custom, LaTeX document to restructured text Date: Thu, 10 Sep 2020 17:50:11 -0700 Message-ID: References: <9c40cd2c-9874-446b-8772-c8a99e377acan@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32360"; mail-complaints-to="usenet@ciao.gmane.io" To: Jeremy Conlin , pandoc-discuss Original-X-From: pandoc-discuss+bncBCJZJHG45QDBBUMT5P5AKGQEHYO37PQ-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Fri Sep 11 02:50:28 2020 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-vs1-f64.google.com ([209.85.217.64]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kGXGm-0008LA-LG for gtp-pandoc-discuss@m.gmane-mx.org; Fri, 11 Sep 2020 02:50:28 +0200 Original-Received: by mail-vs1-f64.google.com with SMTP id d123sf2221775vsd.18 for ; Thu, 10 Sep 2020 17:50:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1599785427; cv=pass; d=google.com; s=arc-20160816; b=GFLxvDeA/ATribFQ1SfulJU9b/9KLjouayJ9CYL6RCI+QhLYUxyZQ8bqa4qbWFsqAW SFnHNMaHfaY290vbEI8ejXeqHHgQwJ6wO/H/Cy3C4YX0htWOEMHBpTFeD2eMJwiWp5Bx uUY17dc1SxAP9a34heqMxOPqCLl3N+INtFUJkCwTlGXMEXSlJVpRP79DTkS1jTNZ2KuQ 2aXRKROQppNhM65S1PxeRvxNT94yrYCNRTMegNyyPtyx4p6D4aGaxEe7wiMxBbHqtR65 01ZNMXY6KP54pchf1fvgFHjniWatRciTp9MXy0JkOXQJMC49vm7DcLjErOt32s1BGR1c qPAg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:mime-version:message-id :date:references:in-reply-to:subject:to:from:sender:dkim-signature; bh=YVYqgiadEQ/sauPCpp/bH1E+CdZpPSGUQxPDv3yfujE=; b=okbe7I4OedEUSqhWPTjtLKL1Q9mZ6ecciu8ChE1Pkv4hm0CSW2bR8Sl4uk2YYVd2vA Uxr48oGLcRRstRhMiU48PPeK/+b6mtREi7Q4vI9t/tn5Sl98zNi1gkR7mjaKuSNhGPrd noUpOOWPFuWgaTwF9seHg20OBEA2bApHhjRqwX+KHRTVtlLnD+MyN/8Sjcj0aTwPV87E pptDKzQzJwa4Oj3JF92s4KqpxJcf2NGO/CjYySNphvCeaTRtBA/cfYxjWiiYlXISP6cs trhMxuLLOYCcK6xthBx2sBM2AvkMPnLYjjqgEC/jR7k08wLm09t8uUBnHw0CUiAnNmfK YHiQ== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@berkeley-edu.20150623.gappssmtp.com header.s=20150623 header.b=aWXb+Eq+; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::532 as permitted sender) smtp.mailfrom=jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:from:to:subject:in-reply-to:references:date:message-id :mime-version:x-original-sender:x-original-authentication-results :reply-to:precedence:mailing-list:list-id:list-post:list-help :list-archive:list-subscribe:list-unsubscribe; bh=YVYqgiadEQ/sauPCpp/bH1E+CdZpPSGUQxPDv3yfujE=; b=FUtF/p4ywu31aslh916J29NXHCYZXT1ngLKNghexzaBBOdDQPaiFCwpQMA0lgXtP8z 6WohoN4w60pyL7+qHkYJOkzAg5uYOVISyA4V1gzD71re/YduMsWNZ2Ui5M9pMOE0I3bT RQLZ2fxcdaB/ZG0Td9/HNbQNTl0qUaoUp1VCAd7GOjhzIFT4Z+TltbNrwcGK+j8SKg0I A8RQyA2QKimO5ucLlVeBivYYO26gVWC+fflshDQxmTI/3fl++n9+QjP7FYke1E+wYEVI ntQGJ6h/5skYcWg/ZVU5RP4+J8LTpHLDyiRhviCMnyAz7py/L4Kuwv1QCR5w5DWD0FDX 2NKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:from:to:subject:in-reply-to:references :date:message-id:mime-version:x-original-sender :x-original-authentication-results:reply-to:precedence:mailing-list :list-id:x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=YVYqgiadEQ/sauPCpp/bH1E+CdZpPSGUQxPDv3yfujE=; b=JU2wjVIWFgYAnKHqR7LUU8DPspudz7bDR9CsXMZUeWmxxDA54XHl0oBtnVWlTY8Dvf 9oXH1Vq0lZYiTHUqLa1DVwVPJQHE+QOB1rb7WfmK2z5XjuDCBxcMPaaNv05v3Ev4jf0F MPEOutGheljcC3NDaBlw7j40lQcrkmnaNvPiAqKqsYmFvOIO32c/u2uU+u0I63GVf7sq cNATuOTvYiU9OA//KlTvRaoRX3ilNp3idRauaX7N+S44Ih7N9bVb3G4uCzo7gjjuGsTD c8UAVMrgBc+hmfJFTwd1fHXInLqm2W8bgIufe9poRw0oIJz/Zj7AQw5RENGuIK1cL9sc UdrQ== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOAM533zXtrJ62cn6EQbpQRWSBWmHdedVtNi7ckM/cRqE4tZ+2X2iiT4 LsvPMaDEAcXQKyDjYoy8NZs= X-Google-Smtp-Source: ABdhPJyLL58bPE53/G9/4v7CCds++9qqtgn1yFuoOKcU62kEWfPd30qNhQIv6h0nMUCm0LI7p1eMJA== X-Received: by 2002:a67:7fd6:: with SMTP id a205mr5917340vsd.8.1599785427699; Thu, 10 Sep 2020 17:50:27 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:6102:20c5:: with SMTP id i5ls96472vsr.6.gmail; Thu, 10 Sep 2020 17:50:25 -0700 (PDT) X-Received: by 2002:a67:ebc6:: with SMTP id y6mr6116121vso.103.1599785425057; Thu, 10 Sep 2020 17:50:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599785425; cv=none; d=google.com; s=arc-20160816; b=WPwspsST5BciMDbAKlNxK9SDquvqt5s2cNqzGuBEcSSwciD/McyZRFE7r57o9cePTF GGYLhGmCGDfGp7gKRcviY3bjL/shMv/PcEhrU6AKXiD8rU4fSizZ7ErfmLepoRCXbzHA 9X5IiJDgQV8qaWi3HyCk6B4nwtSmugHrnzmdeH6l2majStV8AW08atkzJsG/QmSxoVu2 2AD+r1KOY5go33Vavopw0gBqE7RELOJqR2Mnf6L58NEujRjWt+N/ifiO1sO2te+oEEXV GjBBr+yfepe8hcAmVxQ2Bd8IkCHCyNLRLX3A9TlQTX5n7r6RZorL78v893sDEQb5lB28 WnSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:message-id:date:references:in-reply-to:subject:to:from :dkim-signature; bh=d99/zuZOdwuzynGJXZ3CyBzKK+CpSkW+5mRLooIzvS8=; b=gDG2f2pmK3Xswl1w+ODqfOjfbnCI5ihCvwlyowmLeNZEYDyQ5+aGVJlOAHllYfyLLy GY/faS/3IcuNMsb+hR8DI35owbViFeea6nZPjYl8VzrZMSq/wWwzgThQQHuK7Jm9iktM O3CYq8aCXoUQAzKHnIglCehGjmi+88ZvqJ5KvL275FnbK2j3P2fb8lVdL1Y3aWv7Kfte m2Kb/JgSZ2PTu+YfEBvZkgaIWNLX2/2EAMXJf+I/uIvEdJexevErRjfyw9RSJakP8LT5 G4CSai/DSUKuJw4QvLsenBHgykJ2oUY68aDW0ScaYhzFo5gL3Vxy2z1dx25NRyrsTJCy +7bQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@berkeley-edu.20150623.gappssmtp.com header.s=20150623 header.b=aWXb+Eq+; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::532 as permitted sender) smtp.mailfrom=jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org Original-Received: from mail-pg1-x532.google.com (mail-pg1-x532.google.com. [2607:f8b0:4864:20::532]) by gmr-mx.google.com with ESMTPS id p129si54985vkg.3.2020.09.10.17.50.25 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 10 Sep 2020 17:50:25 -0700 (PDT) Received-SPF: pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::532 as permitted sender) client-ip=2607:f8b0:4864:20::532; Original-Received: by mail-pg1-x532.google.com with SMTP id s65so4277487pgb.0 for ; Thu, 10 Sep 2020 17:50:25 -0700 (PDT) X-Received: by 2002:a17:902:7449:: with SMTP id e9mr7886770plt.69.1599785423970; Thu, 10 Sep 2020 17:50:23 -0700 (PDT) Original-Received: from johnmacfarlane.net (li55-134.members.linode.com. [74.82.3.134]) by smtp.gmail.com with ESMTPSA id gn24sm213687pjb.8.2020.09.10.17.50.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2020 17:50:23 -0700 (PDT) Original-Received: by johnmacfarlane.net (Postfix, from userid 1000) id 5FFA6A2A1; Thu, 10 Sep 2020 20:50:12 -0400 (EDT) In-Reply-To: <9c40cd2c-9874-446b-8772-c8a99e377acan-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> X-Original-Sender: jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@berkeley-edu.20150623.gappssmtp.com header.s=20150623 header.b=aWXb+Eq+; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::532 as permitted sender) smtp.mailfrom=jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org 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.io gmane.text.pandoc:26097 Archived-At: It really depends on the details of the document, but if pandoc is struggling with certain commands and environments, one approach is to define custom macros for those, which convert them into something pandoc can handle. (In a few cases you might get away with just putting the .sty file in the working directory, so pandoc tries to parse it, but pandoc usually can't handle the lower-level tex definitions style files have, so this usually doesn't work.) For example, if you have a foobar command, just add this to your document \renewcommand{foobar}[2]{limit yourself here to stuff pandoc can handle} You can often get pretty far with this method. Jeremy Conlin writes: > I have a large (900 page) LaTeX document (broken up into several LaTeX > files) that I want to convert into restructured text. I've already tried to > use pandoc to convert some of the files and it has failed for a few > reasons. > > I'm a new pandoc user, but I figure I'm going to have to write my own > converter. Before I do, I wanted to ask this forum what the right way to > approach the conversion. I was planning on reading everything into Python, > do my own search/replace and then pass the result on to pandoc. I would > then rinse/repeat until I have everything the way I want it. > > I know there are filters and such that I can write to customize things, but > (as a beginner) I'm not sure if it would be easier to learn pandoc syntax > and write my own filter, or just go at it in Python as I described above. > > I don't mind doing it either way; I think it might be a fun side project to > do when I'm procrastinating doing what I really should be doing. > > Please advise on what is the right approach. I'm sure there are other > approaches too that I'm not aware of. I'm open for suggestions. > > Thanks, > Jeremy > > -- > 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 view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/9c40cd2c-9874-446b-8772-c8a99e377acan%40googlegroups.com.