From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/26663 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Albert Krewinkel Newsgroups: gmane.text.pandoc Subject: Re: Inconsistent results of returning the original or a new Image in lua filter Date: Fri, 30 Oct 2020 17:37:46 +0100 Message-ID: <87o8kjllet.fsf@zeitkraut.de> References: 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="13060"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBCZJF7XJTILRBX4C6H6AKGQETKUAQ5Y-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Fri Oct 30 17:37:56 2020 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-wr1-f63.google.com ([209.85.221.63]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kYXPW-0003Fk-Q3 for gtp-pandoc-discuss@m.gmane-mx.org; Fri, 30 Oct 2020 17:37:54 +0100 Original-Received: by mail-wr1-f63.google.com with SMTP id 2sf2872197wrd.14 for ; Fri, 30 Oct 2020 09:37:54 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1604075874; cv=pass; d=google.com; s=arc-20160816; b=Bw38OjsVGQh8OW3skocCf90LHPPzjCt0MVFy1erBOFzHWR6SCFuT6XqltoIrbCfyWE 0tJSLqfm3zCGA8nAvAXI93nsDDuWEaCLME0NQLATvCnnjT3lk69u0Adp5ih9O7HCLYBg Ll/bNpADkE2gKLgRcu4b7wv+ifJ8uhzbcEsOMaM+I/o1l37bQgjjntf9g1CwxbzBhK4U 6jgbmR4BJ4eT2qW2VxeBdVqFUsBS4JMXZNF3LSZPrf8dZ44zluyHwGQuWowLj6vBKpU/ j6+AZpK4Abb7QTe7UbqjhbYTIyspJ5rumKuXYVJE4jgO4jT5CSIp06B615e0wI1JjNwd JGkw== 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:in-reply-to:subject:to:from:references:sender:dkim-signature; bh=HtI9naCxbDUx+GIVMzRCQ/h6NWt9ZrcwHozhBeFiByM=; b=zOnQseQJhAeYsR7/PDvSru7uAZerZE7OYlRc/rHoCWK2ge6+qGB3GfYBfE79JJj5Cz eqcHgqKBV7Ildax6RDHyxzozmuN4cHTC0u5Gx2eoWrDOiLVuvQiRWDhGRvWMsyt70oQm k1FSued8Mvlukj0s7F0hD3rs1brLvQ86VXj4oES4PAaMpgR/u2MHpJgOyrf8yjR0Y30C kAQfIYl2vr2Fq6239kOGx1g8jqe/BDnywoDf8L/CA29hGnK3o0FVbhORXwfOvWuo4CVA Yqy+oAYR+wyOOW+w399GUUdzbqFiz9P6uzAwSpOBL3Ul0G50hvU6V6hXD7N+Vcz1MLkx DXWg== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org designates 2001:67c:2050::465:201 as permitted sender) smtp.mailfrom=albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:references:from:to:subject:in-reply-to: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=HtI9naCxbDUx+GIVMzRCQ/h6NWt9ZrcwHozhBeFiByM=; b=hO4x+VD3yehsEv3tdc4bbpNeSV0/R3PKWAVFFBa1uHULQICj/R2YdL+JaFdgazL30J YjoxEc7I0cK/eSLiRcFETkpY82u6a27x9+bBo5MgwTXDqPCXNmoC9+cvCs8lq0AiwBMF GFhRPti2RxDBSDE346aEfJa2lzEcDPMuBOLqTuuPD1dzuek8K4zPpW4RISy1iDjpavxL /RJ+kCBt1ZFA/o4VbDO+joqDPI8yJgwJi5TPlg4mRD1WyZA8/ocBZ6M5YWIo+Ib1+jJ/ IKiAfdhRnTv8ERdHBqN7L9igDuGAOPFYnjAgWMmlnr6OIkVbb7/+z7dqj+NeIoPFKEgl s79g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:references:from:to:subject:in-reply-to :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=HtI9naCxbDUx+GIVMzRCQ/h6NWt9ZrcwHozhBeFiByM=; b=ET7sXwCZPRpYFfmLkp5pYUb5Rvod3zPifAY3/5dg+Y2mrEIzAVrGG40pJS0WGw/wgf 5gEi/TW2p28pmRpsMyPMh9GJ9BH0zWPk5ogEINTbaVB4nB9WX/m4dLFQzKjPw8G1o0Bl YlSM6BrdO7UMvTBNtotHPUsKus8Q0hQk6985Q/kRYXM0SCz8D2WYG8Q9sSjMoBvvgJsy iFF91VB3Gtm3Y1TfU4bPEQBfxFIg6FrV5evaBr4xKoYSx3J0FuhDzhUipi7J/AvxP4f/ n9uMpYMwStv64MtPAFKQQex7UUOqvB0E8b2ZRGjnBUaVXz2PrQ71+M4jTcG+QEhameQb nWBA== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOAM531pD7tbbKe98tAHGrJdKw7fWzxZ5tB7IbSWFkW7Jtd7G41JPR4N obY3NJM5QfPdJV0l0J+Du3Y= X-Google-Smtp-Source: ABdhPJwI6X4c3t0dOD1xEO3hOfRSPPV+413EUaqZK0+NVs5fkcZOVOLMk7qFPmDyjnMNwbP0dnaytA== X-Received: by 2002:a7b:c255:: with SMTP id b21mr3761296wmj.72.1604075874505; Fri, 30 Oct 2020 09:37:54 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a1c:5417:: with SMTP id i23ls1020295wmb.2.canary-gmail; Fri, 30 Oct 2020 09:37:50 -0700 (PDT) X-Received: by 2002:a7b:c418:: with SMTP id k24mr3826887wmi.118.1604075870436; Fri, 30 Oct 2020 09:37:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1604075870; cv=none; d=google.com; s=arc-20160816; b=II6XfhlMuFoQqkjm3yb6q4m2y68tjo0jXhX2/yybLTZqhTUk19x4P6l8jC3jskaTvn fd95QR5/OtDaRQSx7ptqiG8hP/vsobyJ+d1yzyNSZxH8sEoZMGo64JlyY4w7jLhE0qBe M4QurIC0/0pE8QZyRdBZyyfKO6qF6s51M3B/nVGA/pAzgA6TK145GtyuFvUfiRvQHsXh I2+QbHzJ5OYTH9LvDQgnOgtr+EIl8IztBrNgYc9u8m7KnzH6n7KzZKukvgl1Eto7qm+U R38hcpKs4RTzo0t7TtY5jC+qzPzmxr0NvDQqz4CItqNXAxb8YAUfgWMxmGHr3+/s77A1 nikQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:message-id:date:in-reply-to:subject:to:from:references; bh=1x5zfSe9KhjzPI4Vz3wpc2SHBATKANxAlTzIygukLXo=; b=j4s861icI2u2llsiygRQdF3VK2ZZtOVCEPxHSjB5ENO4GmSZseb3NpSITcVGHtotgG oFxH20K6okKnH6x08EIistiYgX1WEuLNjB2gBMIlMYAWRGUy627nQXZtCJBSPA6rycTz 4VE61w85EooAG1K19gKYEKbDJKu9KCTs7x+/tcTiyyUDyW5gtmc2uFZDmENBDacGdHnf PAotFcyW1z7yyuxELsAE+tyY94r4rYKOJW9D/3eFBHY/3yuwLkKmYkTGpcLXru8bjaMM QWlngEEK4gQj35pSho3RflOtkL9SeZra+B7H7uwR44oBH9/8qmj0XvKplC3VJ52EA65F EJow== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org designates 2001:67c:2050::465:201 as permitted sender) smtp.mailfrom=albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org Original-Received: from mout-p-201.mailbox.org (mout-p-201.mailbox.org. [2001:67c:2050::465:201]) by gmr-mx.google.com with ESMTPS id c20si141120wmd.2.2020.10.30.09.37.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Oct 2020 09:37:50 -0700 (PDT) Received-SPF: pass (google.com: domain of albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org designates 2001:67c:2050::465:201 as permitted sender) client-ip=2001:67c:2050::465:201; Original-Received: from smtp2.mailbox.org (smtp2.mailbox.org [80.241.60.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4CN7Jt1VMwzQkKG for ; Fri, 30 Oct 2020 17:37:50 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de Original-Received: from smtp2.mailbox.org ([80.241.60.241]) by spamfilter04.heinlein-hosting.de (spamfilter04.heinlein-hosting.de [80.241.56.122]) (amavisd-new, port 10030) with ESMTP id o7ikG8_my3Ly for ; Fri, 30 Oct 2020 17:37:47 +0100 (CET) In-reply-to: X-Rspamd-Score: -4.34 / 15.00 / 15.00 X-Rspamd-Queue-Id: 38F8D171D X-Rspamd-UID: ffaa98 X-Original-Sender: albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org designates 2001:67c:2050::465:201 as permitted sender) smtp.mailfrom=albert+pandoc-9EawChwDxG8hFhg+JK9F0w@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:26663 Archived-At: jiewuza writes: > In my markdown file, it has > ``` > ![This is the caption](image.png) > ``` > > And I have in my lua filter > ``` > function Image(img) > return img > end > ``` > > When converting it into latex, I get > ``` > \begin{figure} > \centering > \includegraphics{image.png} > \caption{This is the caption} > \end{figure} > ``` > > And if I modify the function > ``` > function Image(img) > return pandoc.Image(img.caption, img.src) > end > ``` > > I just get: > ``` > \includegraphics{image.png} > ``` Pandoc's writers treat images as figures iff 1. the image is the only element in a paragraph, and 2. the image's title begins with the string 'fig:'. The modified function removes the title from the image element, so condition 2 is no longer satisfied. The title can be passed as the third argument to the `pandoc.Image` function, which will mark it as a figure again: function Image(img) return pandoc.Image(img.caption, img.src, img.title) end -- Albert Krewinkel GPG: 8eed e3e2 e8c5 6f18 81fe e836 388d c0b2 1f63 1124