From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 0IiHGn1vvGL1GwAAbAwnHQ (envelope-from ) for ; Wed, 29 Jun 2022 17:27:57 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id GI+KGX1vvGIGlAAAG6o9tA (envelope-from ) for ; Wed, 29 Jun 2022 17:27:57 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 1C6661EAB0 for ; Wed, 29 Jun 2022 17:27:57 +0200 (CEST) Received: from localhost ([::1]:55234 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o6Zbg-0004Y6-21 for larch@yhetil.org; Wed, 29 Jun 2022 11:27:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58604) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6Zag-0004Xs-1r for emacs-orgmode@gnu.org; Wed, 29 Jun 2022 11:26:54 -0400 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]:45958) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o6Zae-0001nL-Gm for emacs-orgmode@gnu.org; Wed, 29 Jun 2022 11:26:53 -0400 Received: by mail-pl1-x631.google.com with SMTP id d5so14409852plo.12 for ; Wed, 29 Jun 2022 08:26:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:references:user-agent:in-reply-to :message-id:mime-version; bh=WU+cyDtv0jV0lLVlZSlp+nf0EEm/qRdFQPQnA9hTt4g=; b=McNv0FQTbC6vre4mAmcekHqwcjUZSNn+mpYtfWukeSyzsnhIB90hbmizAyH7enaqSl v94iNJPbkDIjH0Qmz+FnQReXEphgI37xqQaxfqtPQUCA9U97pAaS0/xDg8lyzzGBBkVk gtGIYDUPOzQe1iI9aIts/QTgVNDYMneQ013cSR7hdVneW67cngJ96HH4YB97SbL7eVZ8 iDTrH7T+YIUabSkihPKcK+NexdVG9VEwWqMvCGfVIh2nl6WVIExxI+xJzkR5Hlf9ORAg SLkc+EFxiuToqyYCB0r4mq+gY3WaX2XeNxSV7XGTAuXHSH2X2jrcgk6/I8m4tx1yVNj2 qfaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:references:user-agent :in-reply-to:message-id:mime-version; bh=WU+cyDtv0jV0lLVlZSlp+nf0EEm/qRdFQPQnA9hTt4g=; b=pIJ0Axj2R0p73Zl86JkEN9cckffOHRaVLYy0x/eoLXsP6ju2W55HHn5J/u/MLe77mb AiWNCTNT7FKN6CxBdVjD02RWftMbMu1I01URScQV8hkBaaKIDzaz7bUC8682V7eim8w2 gMa44kkOQf97DqRWQIoxG5hIX6UG+tOsXsQySAxbkWXMapoTZTLFjBRq9+5ITo7j0g8z FDPetZ0/+HfhzH7h083J09bGM/9b+CN753Rl/K9W4qsCRnJf/M5uZnJHhLbFj8Og4uwr yZqDIpGxjDBVqoJGKyAodwJc85EIdV2Rqi1jOg4L+qETH6BJP3PhsBT23QaGsErDa17I q11A== X-Gm-Message-State: AJIora9/7jHIe3dUtxGdpGP/8S95ulEMiJkjAZovVmfVWFRJ3UNHxQLs 8fCc+UnKaSVecKW2M3vhmZA= X-Google-Smtp-Source: AGRyM1sqfbP1eoRrJdnu4F9xvKnFUc9LmcLzMKftZdsRY4RkBo8gXindWuLqqv9xVz30bMHUpgzjpA== X-Received: by 2002:a17:903:110f:b0:16b:9350:84e6 with SMTP id n15-20020a170903110f00b0016b935084e6mr7571430plh.142.1656516409807; Wed, 29 Jun 2022 08:26:49 -0700 (PDT) Received: from localhost (2403-580e-91f7--124.ip6.aussiebb.net. [2403:580e:91f7::124]) by smtp.gmail.com with ESMTPSA id c3-20020a624e03000000b005183cf12184sm1702994pfb.133.2022.06.29.08.26.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Jun 2022 08:26:49 -0700 (PDT) From: Timothy To: Matt Huszagh Cc: Ihor Radchenko , emacs-orgmode@gnu.org Subject: Re: [PATCH] Fix caption format for custom latex src block Date: Wed, 29 Jun 2022 23:26:33 +0800 References: <871qvrrjh6.fsf@localhost> <87zghxtor2.fsf@gmail.com> User-agent: mu4e 1.6.11; emacs 28.0.92 In-reply-to: <87zghxtor2.fsf@gmail.com> Message-ID: <87pmir7ao9.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2607:f8b0:4864:20::631; envelope-from=tecosaur@gmail.com; helo=mail-pl1-x631.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1656516477; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=WU+cyDtv0jV0lLVlZSlp+nf0EEm/qRdFQPQnA9hTt4g=; b=QPxrfb3vFlTrMbW6IVHUHqm6mDKsiwdHsmOD1JeT7s7PZYBE0uCnv4KLs+VibU/slrBen1 NQvSwVIEy4JXQJFcjn3Huyo9XKFiw48s/7uy1Z0wuy1gayRzL81hJ4EP9WEd+ghjms7x4t 9ItgVvpuCUVYsvYuyoFBCzVkd/rqU0edlCdBt34O5Pwa7TWHrUnMPum1Biju4Dfm2vCyoI yQsp5/MWn5/N+5U6IsxcM7XFR4+jzxqC6cfKg9F7JRKF6kre5n/uYd9kxUqPClL6Tx79NE B8XGd8gMcgFzjHwOxsUX4zewu1U3uicXDjky8emRYzN0l2QwYDEHHzuJruEYbg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1656516477; a=rsa-sha256; cv=none; b=mZmaaxDxzauwBrUiydRX4z7vgvt31bmrAj4gCGwrtoTh61vWvrhXxHNG2HYD61IUk/6MOR rd0XLnNRnPCZw/z+qtcZxNOD8rhRTOhpJVLYdMiUNq1YiVPW6UXOljcEbeULKaVl/pqcLO AXMcsetM+lVvP9rHnhO6cfvKjP0BhF8ZwmoZJKZiffr6rxWuaTu+82us47bNse181YC4z1 CE2XDwQoBioLgFqXJLe+hRM96r5KJa1LI7VX8XZ7UAvwK7XU6BNMGvKbtHdA1biz5Y4XPp yFkWU3Go/ZfOlYeQUccc8KCvpBIa0H2fKoaiJ+t9Uyy8I4ojGwf1vqF4K1CU5g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=McNv0FQT; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -8.25 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=McNv0FQT; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 1C6661EAB0 X-Spam-Score: -8.25 X-Migadu-Scanner: scn0.migadu.com X-TUID: Qi+IXQ8X0YPn --=-=-= Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Matt, As mentioned by Ihor, you=E2=80=99ll want to take a look at the curent vers= ion of ox-latex, specifically `org-latex-src-block--custom' which now contains `(?= c . ,caption)'. You may want to consider modifying `org-latex--caption/label-st= ring' to accept the form `(element info &optional content-only)' or reimplementing j= ust the bits needed for this purpose =E2=80=94 which ever works out nicer. Looking = at `org-latex--caption/label-string' a substring approach looks quite fragile,= though you might be able to get away with an application of `replace-regexp-in-str= ing', though I=E2=80=99d personally consider this a bit of a last resort. Matt Huszagh writes: > Ihor Radchenko writes: > >> I think that it will be better if you use >> org-latex=E2=80=93caption/label-string instead. It will take care about = short >> captions as well. > > Changing this to (?c . ,caption-str) yields for the original example > > {Perform inter-sample interpolation. > } > > I could use substring to remove the leading { and trailing > }. What do you think? All the best, Timothy --=-=-=--