From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id aoXTHfVXpmEBbgEAgWs5BA (envelope-from ) for ; Tue, 30 Nov 2021 17:57:25 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id UEQRGfVXpmGOBAAA1q6Kng (envelope-from ) for ; Tue, 30 Nov 2021 16:57:25 +0000 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 E043CA477 for ; Tue, 30 Nov 2021 17:57:23 +0100 (CET) Received: from localhost ([::1]:35080 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ms6RV-0002Zd-U6 for larch@yhetil.org; Tue, 30 Nov 2021 11:57:21 -0500 Received: from eggs.gnu.org ([209.51.188.92]:52756) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ms6QP-0002Z0-6J for emacs-orgmode@gnu.org; Tue, 30 Nov 2021 11:56:13 -0500 Received: from mout02.posteo.de ([185.67.36.66]:52873) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ms6QL-0006kO-7W for emacs-orgmode@gnu.org; Tue, 30 Nov 2021 11:56:12 -0500 Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id ADEB3240104 for ; Tue, 30 Nov 2021 17:56:04 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1638291364; bh=D/E1DrcRAy3on0wMYT2ybK1g6/sPbBCS4uLUhDmAHV8=; h=From:To:Cc:Subject:Date:From; b=am87PJCfpgtdFohFbYgHCcKsWpxrGVHCf2XCqD4+Bjs4LhEq1H1g9cG3lLS69uL7j PG5o3Y0fPd5dNSbBos+EQzZ4KHD8VXjl/Uk55lTnl/x64Fx6fbsly+t0peoeza8ENq ZWoiTXlSfOuZJMZYpTV7RA3WJ5etamK/wgbGK6ItK20whg71HKi12AsJ4L+4j1GHbO wnjZrRsGrNkRlnDWT9YNhJlVSUulYlAahS30uC8wxX30OIbMZtFfKngWsQCQ+pJH68 75aAZZzMvGcptTSXcy+BPVGGtqp018Y7xOWWGbdpZ0D0wmrFVxKOey0OKoIXhOrj75 ci2q7lGm3AMLQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4J3Sz74B7jz9rxG; Tue, 30 Nov 2021 17:56:02 +0100 (CET) From: =?utf-8?Q?Juan_Manuel_Mac=C3=ADas?= To: Uwe Brauer Subject: Re: how to export red colored TeX to latex References: <87a6hlr4jm.fsf@mat.ucm.es> Date: Tue, 30 Nov 2021 16:56:00 +0000 In-Reply-To: <87a6hlr4jm.fsf@mat.ucm.es> (Uwe Brauer's message of "Tue, 30 Nov 2021 17:28:45 +0100") Message-ID: <87bl21vazj.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.66; envelope-from=maciaschain@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, 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: , Cc: orgmode , John Kitchin Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" 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=1638291444; 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=YqRe2vrqabszBkChdTpDgyTvxGMZETyHU8H2zajJQZ4=; b=Nb2uC1ynke005XqoWmmySD5knzdZtnlcWyE4WPCEg++Tpai0kS0zgLlXoFI/RocR8C5XGs UJ3Q1/vTr3Ho48LyMuCA8u92xsbvfUh4QX4fZXFEJuwxtx1WI5sRL3ACnCt6l4RgTBCFSZ nGOWB+TXJpaG7PL2hZMWKntNzshlY9A4SWqj4TZnHqtRHSg9DzvXPOvXljZyi1t8K9WExY Cjmdj1RQ3zYN22oNLVyoSaMFQjElbVL4a75z4uQ7X34X9vB3TLCHhTFEVuXsdHZKwivNks L+SE5ILehXZRFzZvUJYhreOHcWZa6EtKy3PlT+3yFR25CzeCR753lGZ7sfdlVw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1638291444; a=rsa-sha256; cv=none; b=PUFM/JaSvMnKdWl5dtoEobLh7S69AoQLUfLoY50x6gvsd3ttrSp1/VKS1hExuRObjdw12K pzUre3T7+aOVdEQPfmolxxMwr6HtPooUy/WVc97ZIQtduRDmNOOU9H8WT/Qy11gkTX8bfS M7bdIC0gnOK9h2fraflI+EFkOGWpnGa74kCGo7K4V3vJV4NUkaqR8Jkc7vVQ31Q686icES w7jv5GKxHL0YRY35G4vxu3+1FmtCxZU2M3W0B+NC+YKiL3WxsaOeWdy3Y7N+RejMyCCap9 aPPn5ShJPl6uLyZ3ZLW4m+7jeinv99+Wc//tZ81gtV/G/0dtQalq/3KAywtgIA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=am87PJCf; dmarc=pass (policy=none) header.from=posteo.net; 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: -4.31 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=am87PJCf; dmarc=pass (policy=none) header.from=posteo.net; 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: E043CA477 X-Spam-Score: -4.31 X-Migadu-Scanner: scn0.migadu.com X-TUID: NswJW/7F+rmY Hi, Uwe Brauer writes: > Hi > > I want to obtain a latex file that contains > > \textcolor{red}{$\delta \phi = \frac{2 m}{R}$} > > > However when I add > \textcolor{red}{$\delta \phi = \frac{2 m}{R}$} > > To an org file and export it as Latex, the construct ends up like this > > > \textcolor{red}\{\(\delta \phi = \frac{2 m}{R}\)\} > > Which is wrong. > > Any ideas how to obtain the correctly exported expression? Not exactly related, but if it helps, I have defined this custom link for colored text segments: (NB: I apply two colors for `:face', because normally I use two themes, one clear for the day and another dark for the night hours: when my dark theme is active, apply a background color. But you can simplify that part to your liking): (org-link-set-parameters "color" ;; :display 'full :face (lambda (path) (when path (if (string= (face-attribute 'default :background) "#282c34") `(:foreground ,path :background "#F5f5f5") `(:foreground ,path)))) :export (lambda (path desc format) (cond ((eq format 'latex) (concat "\\textcolor{" path "}{" desc "}")) ((eq format 'html) (format "%s" path desc))))) The link would then look like this, adapting John's solution using a LaTeX export snippet: [[color:red][@@latex:$\delta \phi = \frac{2 m}{R}$@@]] Best regards, Juan Manuel