From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.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 o5BML4XwkmPniAAAbAwnHQ (envelope-from ) for ; Fri, 09 Dec 2022 09:23:33 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id 2HB0LoXwkmM3MAAA9RJhRA (envelope-from ) for ; Fri, 09 Dec 2022 09:23:33 +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 69C71198DE for ; Fri, 9 Dec 2022 09:23:33 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p3Yeh-0001Qy-UP; Fri, 09 Dec 2022 03:22:52 -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 1p3Yef-0001QD-47 for emacs-orgmode@gnu.org; Fri, 09 Dec 2022 03:22:49 -0500 Received: from mailer-211-145.hitrost.net ([91.185.211.145]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p3Yec-0006xN-QY for emacs-orgmode@gnu.org; Fri, 09 Dec 2022 03:22:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=christianmoe.com; s=x; h=Content-Transfer-Encoding:Content-Type: MIME-Version:Message-ID:Date:In-reply-to:Subject:Cc:To:From:References:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=eO+JoFxYdDD84RBfXsl+1VL0+jLxl2u32dJfhKo7IDc=; b=tbxfH+FoxK9kvQsrys0BfNM8RH PBflk3MTbvmziuqOqIr75Qr3kCo+ISPrD8lnAYZgoU4TIaF+c/zUc/1Ylus4H5+J/Fk2MX2KyIkzu m00IhxS03tY+KGqj038GFHrekEc9sI520p4e1erSNU7RdtTKq/dFJUo2huScATYoSBhTlOpL8sAjw uaa5K+9amdiBwHbBxhL7bbtTkkWloS8rwbnIX0ooYlyUwx+N5XAV92uucLXw0sQ9LPFbV4tbiFl0C nNcAzyawYDWud3vw0nXG1VZgwcZRvFv9mK6z19FgIIpmdpHYy9/pEB6XJWrmEZ/n6Cc6Va0o/5CY7 Ja41K62A==; Received: from 84-20-244-215.dynamic.telemach.net ([84.20.244.215] helo=Tauriel) by b1.hitrost.net with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1p3YeT-00GDyF-2O; Fri, 09 Dec 2022 09:22:37 +0100 References: <79cf9afe-5d86-9ee3-0e99-27164ea0f740@gmail.com> User-agent: mu4e 1.2.0; emacs 27.2 From: Christian Moe To: emacs-orgmode@gnu.org Cc: Carlos =?utf-8?Q?Mart=C3=ADnez?= Subject: Re: Macro: exporting roman numerals formatted as small-caps In-reply-to: <79cf9afe-5d86-9ee3-0e99-27164ea0f740@gmail.com> Date: Fri, 09 Dec 2022 09:22:37 +0100 Message-ID: <87y1rh2dgy.fsf@christianmoe.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-GeoIP: Country [IP], SI [84.20.244.215] X-Antivirus-Scanner: Clean mail though you should still use an Antivirus X-Authenticated-Id: mail@christianmoe.com Received-SPF: pass client-ip=91.185.211.145; envelope-from=mail@christianmoe.com; helo=mailer-211-145.hitrost.net X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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=1670574213; 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: 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=eO+JoFxYdDD84RBfXsl+1VL0+jLxl2u32dJfhKo7IDc=; b=phCWtuW2e4yIVH/6SFeZedhCzL+vOaKZUT+8pPS5BpXAjLoDLqCIkcLUN9q1ZZeAectZsg jVCFdSRvmmvGiemAyFbNpwHGYCFSS8edcNIb/Umx6rnV5xzIWuOb2tO2i2X5wPA+vIqQNV f6pxJYewuYeFRKiH5DZ9RSXscE8rDRbzb4+js9YTzwKh7JCnSf9iDqc9DnExmiatVD9RQe BV3lSeolTiKVth9UFunZZytWTVcsXmx4XQA2/B2Tn6ltj0ktLYbaoljYtfMQVZ1yP4TeyD +DhGy7MY1On1zZ/r6rm+YFxcmOKb+an3hTwgcA5ScMffTIs5CiCL+6xyQRaESw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1670574213; a=rsa-sha256; cv=none; b=objFEHfVSxc1mH+NZ0ywgkrhApnqT+EV9GbGAr0ngVDEAO4W36rZy9imxjVRfz+mZaD2RA niIsZtnP3gyhsd70ksWmqoquqZktZf66xq/gHXgjDmG9kBgbGrvlqszQPwTUsCDymh7th6 AZfHUk1q+JTBTWEuhQMG86nJQJJABdiU/9QocJdW0myb7RFTT8JrgvfgvH71aCDSH3E07N 4e+XB34+UA63UYmBy18w23dv/h3mXWGjq/Ld77cpHGof6Q49WEtVDr6FnucBr6apUA7OqI 9jZfK8zMk9/hd0W9OrmMieXKHPYzEVQH3PvLq4RezSPAM37haUAkZQVIH4dlfw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none ("invalid DKIM record") header.d=christianmoe.com header.s=x header.b=tbxfH+Fo; dmarc=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: -1.25 Authentication-Results: aspmx1.migadu.com; dkim=none ("invalid DKIM record") header.d=christianmoe.com header.s=x header.b=tbxfH+Fo; dmarc=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: 69C71198DE X-Spam-Score: -1.25 X-Migadu-Scanner: scn1.migadu.com X-TUID: jr5l6g4orAjT Max Nikulin writes: > On 08/12/2022 19:38, Carlos Mart=C3=ADnez 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=3D\"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 Indeed. Carlos, I'm guessing that you formatted a Roman numeral in ODT as you wanted it to look, saved the document, opened content.xml and used the resulting XML. However, what happens then is that the formatting gets saved as an automatically numbered text style "T1", which isn't going to mean the same thing the next time you export a document. See if this works: - In the document you are using as your ODT_STYLES_FILE, type a Roman numeral and format it the way you like. - Then make it a named character style. In LibreOffice, open the "Styles and formatting" sidebar and select the "Character styles" tab. Select the formatted Roman numeral in the text. From the "Styles actions" dropdown (top right in "Styles and formatting"), choose "New style from selection". Give it a name, e.g. "Roman numeral". - Save the styles file. - In your macro: replace "T1" with "Roman numeral". - In all your Org documents where you want this to work: make sure that (1) the macro is defined and (2) that ODT_STYLES_FILE points to the file you have saved with the style definition for "Roman numeral". There isn't any simpler way to do it, due to the way LibreOffice stores all local formatting as generated styles. Yours, Christian