From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/26883 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: John MacFarlane Newsgroups: gmane.text.pandoc Subject: Re: How to add a `\usepackage` in a Lua filter meant to support LaTeX? Date: Thu, 19 Nov 2020 12:10:15 -0800 Message-ID: References: <2e27c210-a276-4319-abd7-c81d5db7f7d7n@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="30514"; mail-complaints-to="usenet@ciao.gmane.io" To: Norman Ramsey , pandoc-discuss Original-X-From: pandoc-discuss+bncBCJZJHG45QDBBNFC3P6QKGQEN625CPY-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Thu Nov 19 21:10:32 2020 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-pl1-f183.google.com ([209.85.214.183]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kfqGG-0007pC-LC for gtp-pandoc-discuss@m.gmane-mx.org; Thu, 19 Nov 2020 21:10:32 +0100 Original-Received: by mail-pl1-f183.google.com with SMTP id n10sf4631206plk.14 for ; Thu, 19 Nov 2020 12:10:32 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1605816631; cv=pass; d=google.com; s=arc-20160816; b=lg0Uf6jPYUIRSvhO5Hlj6U42n9OSfWhVv1pRijlfcVfIOCsJeOHa2agf9EsJpHkNBK 2YjBWg9HAW+W/wU1XF/VAOHt0k+Sc1aBzb0Q4eTTn0Sfa2hqRbW79zX8Geyyi8FEgM6c J0ybsflwh6ykz6QNzLe0xdVWP6YURtZHH52gIUFhvX8BbhBpznyjRGv/59QISzkIfzBf qbM5phhfi9uu6J2ekW9K5rS8TdBZahaRK8h/NpOzJCPEUCD1oZbM7onBRwTK/w8G0gi0 HRaZpGABno6I/FGzb2JEL83wl7ByCDxppnedssilZm189vVrW7v2nRUjhIPFjmyaN4+z uTMg== 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=IXiEYIwk4vbXNf1yQN1P2nXCUx+Vu98ZDF0ntUgS6X4=; b=0VLi/39C+JLCqQOVOxJyqEleNd2sQQGedI0H9pkWZZ0jgNlHcJy6T2kAAaajMG8mDE jrSDtAXAPfA09EDYm9jut2GsONE0IbKvCgT9CU10bg9nHpESJobCSYZDo7KoRh8XJnnX MxpwvxdzvZ2JZ67oCbJYltgJ6+ZJ6hdXvE3O6o2uci1aTQpSp6lgAS1V/ZEhJzvAZgTG xKfG589OUVijUKzJqJt1uiSTupr4Z4HTUHhgdbKmut1RRd1OvhWTChT/BSSYwh++rVnJ C5xajv0+fQEYNkrod+IVVDP/z6hIg/gDKbheTUOobsGQH/PgVk5eCYC4RZlk2xGhPBKt DCAQ== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@berkeley-edu.20150623.gappssmtp.com header.s=20150623 header.b=lE+vnDfo; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::434 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=IXiEYIwk4vbXNf1yQN1P2nXCUx+Vu98ZDF0ntUgS6X4=; b=Qe1W1uldQDZKdOQgszxak10kw2i9L7ZnW4BE7Kg3WXAMWUu1NU/sCTaQnBPa2nhB7g ZrR17Ev59u/rLAev6fHU55UVbHtA0B7E+b9OEvguc4UhGlgtAz1PTuz0sxb8TZSThMUC XT3mzZ1725pZhtH1GjWUqNMWSWufYhI1eT0zI2qupJa0oizI2VKg4gSeqrYq6yz/1i5R eMM1QtbDO3rHYyxBSVp9pKRgBkILVf/c3fZv5Lo4irFaaejJUCgqy+4Vf+2ct2UDcFv5 n83XoBiPIJ1YSJBWl5wMrS0DmXK4ythtyDdy325/cB5asMT8EkwZne9WJUF1r9Awkepr Zxiw== 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=IXiEYIwk4vbXNf1yQN1P2nXCUx+Vu98ZDF0ntUgS6X4=; b=ET+l7GDG8ImZsNA4YSY4upDq5Wt2kS2D/u549i+xP1SYIHBpOJkt96ADSBAKgAyJB+ ar2KTvI++22G/erSrqYl67FzcqAaW1+Ed07RIVS6mWlXPZwrNG5DfRiiyofs6Sx0LvmL Zs+3w2Utgci0+zdMPcFtGI1NomrVMI3qkePZEUwaij0lMC3RKyoJ8zvE0NuQRqKWw+Gz QNx97Kl6SzlLZueHzsKoFbYdVk4DIUULCl/0JrkRMSzxTjw3fdXKf7/g5PG5Fbwt5fOe Jv0APHjOD+gP/OGcA6U19toQ9F0ztaGsGRxTrnrQkfFhjr2vBDt/zMDwvr1/uOZtQOho YpLg== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOAM531WJbE2v8MBvbqMZGDzin5dUUu6rYv/Y9LFEXNEVmNyPk2DCHru rf1Aaa6K585ogr8I/VyVI84= X-Google-Smtp-Source: ABdhPJxfnnTpKR5YLDz/W9BSHbKTaonVHLaS2NMEMYa16q/X9g19RzkJYw42TQtFCmjck1mO6l5SQA== X-Received: by 2002:a63:4414:: with SMTP id r20mr13716231pga.67.1605816631446; Thu, 19 Nov 2020 12:10:31 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a62:8f0c:: with SMTP id n12ls1473094pfd.8.gmail; Thu, 19 Nov 2020 12:10:28 -0800 (PST) X-Received: by 2002:a63:f50f:: with SMTP id w15mr13459121pgh.403.1605816627937; Thu, 19 Nov 2020 12:10:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605816627; cv=none; d=google.com; s=arc-20160816; b=oUdLJwuGb/7BJDMqiPl5tpTd3L+1QIjMNPWLWr8+OG4ifhsw08cLny2EfMwPtgpwJR yJCo893sFLPduShE1KjGg8mbEXawWSgZ+apsQvehs6mOAA2Sfa1yHZyBfhzcpcH9VPtC T5L1TPAFHJ1WcEE6AX7L2z1CQ1ICcn7AHQdzxgOtRBjIB0hraW62MmajZg1Ook6Z6iVf AocC3s+DOfN8AtiFCxzyWQGFTYFspKs7+prhkK5CbRv9YWERiG1Bfu91UUw1JIME99sX gdWmZReaXqa9ylwL6yBOzBE15mzvCf397VPqx3/4waai6jS5F9OeDMiG/DwktWHJ4uEu 1KUA== 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=tF8z8LvE+oq8jdsyamdD+bViSQ5Z2UskSF/NCZ2wad4=; b=MGuPnbUVlzOqXW23poDYnERFyZ/ggMtpV9WhztjKu1mRqNbGMkNKI7r6sRmjry8Nmc NEsiwlN3E7wLhKGENrmeYWOtpl6t5cHxuJ88aS0ZATBYKNXaAxacwZUzrAGYTHCwCxMc NgEzx+Pe5ONlQoitSWqjyjMtqC/LicherKNhc6E+Wy9luG/PwsZPMVkjRghgM3EDk+Y0 zkInpE/+oWh/2A1xX32UDPaZ9IRKAIiqbsqtf9phWRyA85G81BseKskI2mJgArLMWEoo Z5wdxkKLAm2HheqRSnsm7S7tTi/l7keM7G2cotRs4O8/SzY0bo4JvYxXIQ0XE4Rxh20x ViLw== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@berkeley-edu.20150623.gappssmtp.com header.s=20150623 header.b=lE+vnDfo; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::434 as permitted sender) smtp.mailfrom=jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org Original-Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com. [2607:f8b0:4864:20::434]) by gmr-mx.google.com with ESMTPS id 80si92868pga.5.2020.11.19.12.10.27 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 19 Nov 2020 12:10:27 -0800 (PST) Received-SPF: pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::434 as permitted sender) client-ip=2607:f8b0:4864:20::434; Original-Received: by mail-pf1-x434.google.com with SMTP id v5so1500152pff.10 for ; Thu, 19 Nov 2020 12:10:27 -0800 (PST) X-Received: by 2002:a17:90a:5d0a:: with SMTP id s10mr6342720pji.160.1605816627502; Thu, 19 Nov 2020 12:10:27 -0800 (PST) Original-Received: from johnmacfarlane.net (li55-134.members.linode.com. [74.82.3.134]) by smtp.gmail.com with ESMTPSA id w66sm802638pff.171.2020.11.19.12.10.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 12:10:26 -0800 (PST) Original-Received: by johnmacfarlane.net (Postfix, from userid 1000) id AB319A18A; Thu, 19 Nov 2020 15:10:15 -0500 (EST) In-Reply-To: <2e27c210-a276-4319-abd7-c81d5db7f7d7n-/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=lE+vnDfo; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::434 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:26883 Archived-At: You can always use a custom template. Other than that, I'm not sure. I see the need for this, and need to think more about #3139 -- it's the kind of change that might have unexpected consequences. Norman Ramsey writes: > I've got a Lua filter that is meant to render certain document elements in > a `boxedminipage` environment. To accomplish this feat, I give the element > in a suitable `div`, and a Lua filter inserts the LaTeX environment. The > document itself remains universal, but the Lua filter is resolutely > intended for LaTeX. > > The filter adds a raw `\usepackage{boxedminipage2e}` to the > `header-includes` of the metadata, but unfortunately when `-V > header-includes=...` appears on the command line, it takes precedence and > the document metadata is ignored. > > I thought of trying to use `-M header-includes=...` instead of `-V > header-includes=...`, but that comes with its own problems: using the `-M` > option, the argument on the command line is escaped. It is not clear to me > if there is a mechanism I can use to put raw LaTeX in that spot. > > The issue of the command line overriding metadata has been discussed at > some length on the issue tracker > (https://github.com/jgm/pandoc/issues/3139) and in pandoc-discuss, where a > related issue is laid out in the last post > (https://groups.google.com/g/pandoc-discuss/c/N6WhlmSPXbY/m/UYJJBdZwAAAJ). > The discussion thread in pandoc-discuss is now two and a half years old, > and it seemed to be in favor of a change. But as of pandoc version > 2.11.1.1, no change appears to have been made, and issue #3139 remains open. > > Is there a workaround I can add to my Lua filter that will make it work in > a self-contained way even in the presence of assignments to the > `header-includes` variable on the command line? And is there any thought > of #3139 being resolved one way or the other? > > -- > 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/2e27c210-a276-4319-abd7-c81d5db7f7d7n%40googlegroups.com.