From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 4KnaNvnvkWN6agEAbAwnHQ (envelope-from ) for ; Thu, 08 Dec 2022 15:08:57 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id +HKkNvnvkWOjPAAAauVa8A (envelope-from ) for ; Thu, 08 Dec 2022 15:08:57 +0100 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 A42A63E964 for ; Thu, 8 Dec 2022 15:08:57 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p3HZD-0006lE-BX; Thu, 08 Dec 2022 09:08:03 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p3HYy-0006kl-M4 for emacs-orgmode@gnu.org; Thu, 08 Dec 2022 09:07:48 -0500 Received: from mail-lj1-x22f.google.com ([2a00:1450:4864:20::22f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p3HYw-0004pJ-Gf for emacs-orgmode@gnu.org; Thu, 08 Dec 2022 09:07:48 -0500 Received: by mail-lj1-x22f.google.com with SMTP id q7so1656950ljp.9 for ; Thu, 08 Dec 2022 06:07:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=rojuI2AtSYh5au4jzMlB0xJTzfEfnGIURV/j8Q9w/Ls=; b=d7mPWUL2NMhiicA5yrNMC0cLLLLxTxtYKyW6Zq7ioKO4vfwNEvpT+TIWNZBEDRF/B0 MQ5mtivTS+F5dSWCbY2lRfGgjdTie5OZx6aNFfb4izZHqzrSWNxU1DB3XVqCmzmLtv+l S+k1AW7qqQeTdfez8QQSQgGs2DSS4bYWKqd87XuFm9jjhzVMYBnlTgXUI24wD2LilAPq BqHx5BtR5shyefQSnosJiMTAaSax3yjh8mMCOPpc4jMSzVkbJMBRLOO4I+k8kSvnQpvO gUlHUTv0/KzBIBJ4BTWvsr6Uv3M4btvlLgCq6ObtxTuYuaoYgRrq7/h7kH7uwhl8xsxS VA0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=rojuI2AtSYh5au4jzMlB0xJTzfEfnGIURV/j8Q9w/Ls=; b=0AL95PrZ7vHb5Oc3CSEpyVcRJDTuOVeWhyoy/ZkBh1BxNpp+fHhWca8SLMRgkzLXZv i3wttqdWDbn6QEnCB5gz8Uw02R4w3IPWBjCiWtiVZ0NU2b5xaZNNxcrHVSLUQrqkJQJT nFfxWUrmAZjEBkColsf6O0hKqpyFjirQOpTSapDfhZmcgQrz5YMCSoVMqLfqIS2I6qXC FHavF8ORXSRVyZAbTe7dc7cfm5vLFJRwwWoYc26esLNYZo4EYgwhw6bID8CXIQLfoUjW 1m54VEz2wYaL9sHI7Vw7JyZkibnOA4C7NaXWP5fLvBj4T/QVHOBglNjhx3IWcrhFOkj4 l65g== X-Gm-Message-State: ANoB5pnChZliGB+PIUYspV4CFgHwr5RLEfAzvmOxwrMM3T93RLeXdOmZ H+73fSENiUzr+AdQqgXFQVcixBqG6MM= X-Google-Smtp-Source: AA0mqf4KPfFnpQ0UH0u3fSQEBnjxev3p3qh4YMYMxdhZod4xUEhae4uUZczjwuwAnxSD5sXBIbtbKg== X-Received: by 2002:a2e:a58f:0:b0:279:8590:8a17 with SMTP id m15-20020a2ea58f000000b0027985908a17mr730654ljp.52.1670508462459; Thu, 08 Dec 2022 06:07:42 -0800 (PST) Received: from [192.168.0.101] (nat-0-0.nsk.sibset.net. [5.44.169.188]) by smtp.googlemail.com with ESMTPSA id b27-20020a05651c033b00b002770e6c620bsm1299111ljp.106.2022.12.08.06.07.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Dec 2022 06:07:41 -0800 (PST) Message-ID: <79cf9afe-5d86-9ee3-0e99-27164ea0f740@gmail.com> Date: Thu, 8 Dec 2022 21:07:40 +0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: Macro: exporting roman numerals formatted as small-caps Content-Language: en-US To: =?UTF-8?Q?Carlos_Mart=c3=adnez?= , emacs-orgmode@gnu.org References: From: Max Nikulin In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::22f; envelope-from=manikulin@gmail.com; helo=mail-lj1-x22f.google.com X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 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, NICE_REPLY_A=-0.266, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1670508537; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=rojuI2AtSYh5au4jzMlB0xJTzfEfnGIURV/j8Q9w/Ls=; b=Xi9OX1bLxrakT6LePq3favDimJ+FAKavcpB/1bc84RUZ4sRKL0lejPP/O1Aiiv+vpvFNh0 W6vLgjXFNayCvPhundYVMAmEJfRExRGd57LJQ/f55E/aSuv9YZpYqrek0XGSdxayLrUPYa g8gsIF8Wc56lAbWsVztHjvhe120BZjjtZ7suzGC+zSWtsqKY0XhUfaGxI4yuk8hF+GQ+wz o4rx9NkAtdq/mVST+Kp03Uwggj1mqCilv17QJ+rjGSeDj/aAjejCMXQo/zQgoCuI5L5hMM MTlR4nqsoN9p7maRUz8X076Zk8pZtGCgO3JUldOmYmFlRB6a+h4MWzFi15oLQA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1670508537; a=rsa-sha256; cv=none; b=MPpZFJndSY4QR6HDK3tXf9lDkXFva0qRs3f7zUibTliYtmxhMb+0N1jTOKTGMG/VKqHspm CnvMpqq53A0uSE9aAdApRkMiX1n6SpO5QcVcQ7MO24EJkTringWMHTvAG5MCO4f4O0N+er iqxE5RrG3OOOanQykGj/8UtH/Cxy2RvqhjLJKBG+kbYysuUDX9EruZOTj7kmD4i8om/RbN 2XXRoIgyJbxP81c93WwDTcAkA1T3HCN52tcjI+JIlprpy7An/vwbDQgqp0GhgHpQLH1TPr 69HuEIe07xsT/ufrHfLlrtz71+QyyxfE9CUtIGtvgBtosp0vL7yjBDck7Z+v9w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=d7mPWUL2; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); 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: 6.24 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=d7mPWUL2; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); 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: A42A63E964 X-Spam-Score: 6.24 X-Migadu-Scanner: scn1.migadu.com X-TUID: dz90v+HIxEvC On 08/12/2022 19:38, Carlos Martínez wrote: > > #+MACRO: sc (eval (if (org-export-derived-backend-p > org-export-current-backend 'latex) (concat "@@latex:\\textsc{@@" $1 > "@@latex:}@@") (concat "@@odt: text:style-name=\"T1\">@@"$1"@@odt:@@"))) ^ ^ Your missed spaces around $1, but it is unlikely a problem. Disclaimer: I know almost nothing about odt. Have you customized ODT styles? I do not see "T1" in etc/styles/OrgOdtStyles.xml info "(org) Advanced topics in ODT export" https://orgmode.org/manual/Advanced-topics-in-ODT-export.html > I want to achieve something like this: "When exporting to LaTeX (o > derived formats), surround the argument with \textsc{}; if any other > format [it will always be odt], do the same with the proper odt code. I recommend fallback to the argument as plain text for other backends: (cond ((org-export-derived-backend-p org-export-current-backend 'latex) (concat ; or format )) ((org-export-derived-backend-p org-export-current-backend 'odt) ; ... )) (t $1)) If you are absolutely sure that you will never export the file to ascii or html then no `eval' is necessary #+MACRO: sc @@latex:\textsc{$1}@@@@odt:$1@@ Here I assume that macro argument contains no markup and can be safely put inside export snippets. Otherwise a bit longer version closer to `concat' arguments in your original variant would be better. Another point is the name. Small caps as "sc" means direct formatting. A name based on "roman number" might be better. If some other objects should be formatted as small caps then creating another macro might help to change styles independently later.