From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.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 6PgHOrL0omJbmQAAbAwnHQ (envelope-from ) for ; Fri, 10 Jun 2022 09:37:23 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id IA78ObL0omIhfQEA9RJhRA (envelope-from ) for ; Fri, 10 Jun 2022 09:37:22 +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 95B951673E for ; Fri, 10 Jun 2022 09:37:22 +0200 (CEST) Received: from localhost ([::1]:47174 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzZCr-0005UR-Nf for larch@yhetil.org; Fri, 10 Jun 2022 03:37:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58958) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZ55-0003ik-D5 for emacs-orgmode@gnu.org; Fri, 10 Jun 2022 03:29:19 -0400 Received: from mailer-211-160.hitrost.net ([91.185.211.160]:3069) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZ52-0001na-W9 for emacs-orgmode@gnu.org; Fri, 10 Jun 2022 03:29:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=christianmoe.com; s=x; h=Content-Type:MIME-Version:Message-ID:Date: In-reply-to:Subject:To:From:References:Sender:Reply-To:Cc: Content-Transfer-Encoding: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=DjHbpVZQZnu86ER/7PHjynVddQC03zzmSmtgCdrwXhc=; b=OuKC+1ZmUXLa1ftkPXNZhyB9kg KmiOmMwU4/5QxFcTR4PlITnhdMCzLdnQhMo6RNl+yKxI7RX53Vl6PdRnv4yJRehfzqvQXM7ujnxQu HUNys77py/++jmdpditb9eN+/jBtOhhw90eRDRZuMDqsKx5Phl/Krn0YIY+04/5f7t8IpEp48EJNr twCJHFXiuzTpOS1kioioS7R91MLfl1qR4vzYZLNz5x6u/0Ra280bUgDv+UA3VeDUnOyRUfjcwmYo/ Jbmapk7lYP1ZmBM6UOUr4d3cqMqKbAhJCFLbyKQbEVD9EhjKlAVHP+BP8cvVw03WFiB/fpqlYLFLi JvJRhS8A==; 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.95) (envelope-from ) id 1nzZ4t-001bWK-Us; Fri, 10 Jun 2022 09:29:08 +0200 References: <87mteld6ob.fsf@mat.ucm.es> User-agent: mu4e 1.2.0; emacs 27.2 From: Christian Moe To: emacs-orgmode@gnu.org Subject: Re: export to odt, but #text# should be coloured In-reply-to: <87mteld6ob.fsf@mat.ucm.es> Date: Fri, 10 Jun 2022 09:29:07 +0200 Message-ID: <87zgil0yf0.fsf@christianmoe.com> MIME-Version: 1.0 Content-Type: text/plain 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.160; envelope-from=mail@christianmoe.com; helo=mailer-211-160.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, T_SCC_BODY_TEXT_LINE=-0.01 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" 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=1654846642; 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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=DjHbpVZQZnu86ER/7PHjynVddQC03zzmSmtgCdrwXhc=; b=joWgBXbxqUVTtVBMyhzmnBErN5MklsuBdkbdF/76quwsTDEk9PxPrHc4X5q9AoYGldQxT+ 3BuLRBWK4KSvfOc5ahljEIp5cdk7narirBZ3wjFRn4rH9EDI5a7YPpFDLS0CB69wcC8obw ZrlpDmJO8AHtpP1LtywfZEx4Pt8UEMdSNo4vyeSrEKilzNtUNkW1LpLehbReBfV3mb5GYi lRMjB1qGnd8UUE3VHQCPaLzOmCBIO2IfpO0Oh0Q0VnEdjh1zptS2VxUpqSxFSAvEyVXgVE OyJtGbQxEjtebLbzH6k8jDVxT09rIdbkGVKeiCvgP631ju5ulFP09IJoLjtelg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1654846642; a=rsa-sha256; cv=none; b=RAnfBbPda63GaDbhPpb2+Gux5dU2J8ay+wI2TItgYeoeEMQVDlT9/NdikD9S9Va3jPrU0+ hVtPYasxlJjYPdFlf7LBjEozhzSABqL17pkINQu2Z0FxcgBEDJn0tUxXwzCeoPj1/Bfzrw /NbeMlZcRcGvVn81aocUhPcZ8WcZUAX9bw1J62NqDRSvtdhbwQWwUtXE8CmYu2NIwyHAg3 +9ihGyYFM32IjvFKDBWeJhXEoetnklWlqA2aqVQrtIOKIE3Azj72RnIE9W5mlgs3T6D+Zn n2rGpTV9YUVe2tqRWgbdpi+WHarcV0x7zmHhZB0KvtSKkOWMV7Kdm2PU0vMk+A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none ("invalid DKIM record") header.d=christianmoe.com header.s=x header.b=OuKC+1Zm; 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.29 Authentication-Results: aspmx1.migadu.com; dkim=none ("invalid DKIM record") header.d=christianmoe.com header.s=x header.b=OuKC+1Zm; 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: 95B951673E X-Spam-Score: -1.29 X-Migadu-Scanner: scn1.migadu.com X-TUID: /uiwpqOeV2bN Hi, Since all formatting is defind as styles and styles are defined in separate (parts of the) files that make up an ODT file, this requires you to work with ODT styles. There may be a hack around it, I don't know. See the manual for how to use a style sheet with #+ODT_STYLES_FILE. (For a once-off document, the simplest is to export your document to ODT, make any style changes to the ODT document, save it, and point #+ODT_STYLES_FILE to that document for future export.) In the ODT document you use as styles file, create a new Character style. For example: In the document, mark some text red. Select the red text. Open the Styles and Formatting dialog, go to the Character styles tab (that's the second tab, the first is paragraph styles). Then from the drop-down "Styles actions" menu (icon on the right), choose "New style from selection". Name your style, e.g. "Red". It should show up in the list of character styles. To apply that style to a span of text, you need to wrap the text in tags in the content.xml component of the ODT file. For your "#" formatting, you could set up an export hook or filter (manual: "Advanced export configuration") with a replace-match like "@@odt:@@\\1@@odt:@@" I would probably rather use a macro like #+MACRO: red @@odt:@@$1@@odt:@@ This text is {{{red(alarmingly)}}} red. Yours, Christian Uwe Brauer writes: > Hi > > a short hack of the sort > > (interactive) > (while (re-search-forward "#\\([^#]*\\)#" nil t) > (replace-match "\\1"))) > Allows me to export text like this > #important# > > to HTML where the resulted text is colored in red. > > Now, how can I achieve something like this for the odt export? > > Reards > Uwe Brauer