From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/26085 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: M A Newsgroups: gmane.text.pandoc Subject: Re: Font change in \mbox in LaTeX math mode Date: Tue, 8 Sep 2020 20:57:53 -0700 (PDT) Message-ID: <76286a6c-b8d6-4098-b1c2-5d9e28309ec8n@googlegroups.com> References: <7262e88e-6096-48f2-a7c4-541fa3a15410n@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_399_402188657.1599623873492" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14941"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBCL3JXGGYYFRBQVF4H5AKGQE375V4RY-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Wed Sep 09 05:57:58 2020 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-oo1-f56.google.com ([209.85.161.56]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kFrF7-0003l2-S8 for gtp-pandoc-discuss@m.gmane-mx.org; Wed, 09 Sep 2020 05:57:57 +0200 Original-Received: by mail-oo1-f56.google.com with SMTP id p6sf527218ooo.0 for ; Tue, 08 Sep 2020 20:57:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:date:from:to:message-id:in-reply-to:references:subject :mime-version:x-original-sender:reply-to:precedence:mailing-list :list-id:list-post:list-help:list-archive:list-subscribe :list-unsubscribe; bh=qh3W3Hx2h/EmzePB6gLJkSVtZxudPYjzH2r5cMz1fko=; b=oGGcZVzWOVt2muVYgo+4rm4mwvr9N6oZLt8YgMRAXZDCJgh3t8sAuxKICTJwtaHsEI aOW0GPuyMfKKYH0A4dVYD3O4vEM9pOVMyiBuar5Tjxqrlb0z53B6PX22zCWHlhgBtowN 9dqE9izw+8saS/D9VmuP2fXbqeaRs4uBvRtNaEraBLPyA5YF1LP2C3yyRplmRLtVwYth ktllH3VaMVi5mnlIZtxKWE91y/jkxnL6SgA/YeXi2k6u8VutfezK1F3hiAJftMAGQFb6 HDMMqPilkjgfVadHlmjRDB00J/rxSNdJVUXL5dR5MlyUACfXjWBUi4qLHaBOc9KdLjbY q9tA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:date:from:to:message-id:in-reply-to :references:subject:mime-version:x-original-sender:reply-to :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post :list-help:list-archive:list-subscribe:list-unsubscribe; bh=qh3W3Hx2h/EmzePB6gLJkSVtZxudPYjzH2r5cMz1fko=; b=W3bjiv0K7jFPtl6hsjFpCFsEnbXU+Y3xrg6GLRKahQtO+kYvRB4G85696P+bSpUmTc gsOaAD/rJ4kDUeKE+jrD0KCbgp6NEHossWrXLVr7wjKSg123aGfESsEeOULBOBUA5qs5 T64HpK3AovPJz6tUdwp960DP2uIGttXSvLOdwbkIQ36Nmr/01erERdrwnaAgiVdIdOoR GkC3nIsGmlZpzkmfqlh7MyJmiYzMekZSZIpv9g+BBS5yzCVYUMRQHA8459OAxJLqJdiM R+T6fTfHMEDsZG7kSHgVTlozCloAsXXAucarInDcm8/2IinvaPvWunlyyNFZBfHSZOUi Ljow== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOAM532f7BbpNNMBXxKmZh5ffHGcQnN/coEAspOu1JeXFd2LSHa3j8Yf VtTBjwOcIOxG7vJDGF2vwSo= X-Google-Smtp-Source: ABdhPJxeVMJIQXA7qc5zYhgk/EW/Z6PfCF+OER9sN7zzaEUxjGN7FXQncLHgYFUrO8Y1a1i+MzBYJg== X-Received: by 2002:a05:6808:5c6:: with SMTP id d6mr1498475oij.80.1599623876967; Tue, 08 Sep 2020 20:57:56 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:aca:72ca:: with SMTP id p193ls222418oic.3.gmail; Tue, 08 Sep 2020 20:57:54 -0700 (PDT) X-Received: by 2002:aca:a884:: with SMTP id r126mr1519916oie.38.1599623874189; Tue, 08 Sep 2020 20:57:54 -0700 (PDT) In-Reply-To: X-Original-Sender: marshall-g+3rYsS+t1LR7s880joybQ@public.gmane.org Precedence: list Mailing-list: list pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org; contact pandoc-discuss+owners-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org List-ID: X-Google-Group-Id: 1007024079513 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Xref: news.gmane.io gmane.text.pandoc:26085 Archived-At: ------=_Part_399_402188657.1599623873492 Content-Type: multipart/alternative; boundary="----=_Part_400_1828853379.1599623873492" ------=_Part_400_1828853379.1599623873492 Content-Type: text/plain; charset="UTF-8" Ah, OK. I understand. Thanks John. I found a workaround for my LaTeX code, but I'm happy to know what was happening, and what to look out for in the future. On Tuesday, September 8, 2020 at 4:02:25 PM UTC-5 John MacFarlane wrote: > > Math conversion is handled by the texmath library. This is > specialized to math, and in the particular case you're interested > converts tex math to the math format used by Word. > > Since it's specialized to math, it doesn't know how to handle > arbitrary non-math text of the sort that can go into an mbox. > > There's not a good solution without changes in texmath's > architecture (one can imagine changing it so you pass in a parser > for normal text in the target format, which would be used inside > mboxes). > > I wouldn't hold your breath, but you could put up an issue > on jgm/texmath on GitHub so we don't lose track. > > M A writes: > > > I'm converting from LaTeX to MS Word (.docx). LaTeX lets you embed the > > command > > > > \mbox{...} > > > > in LaTeX math mode. What goes inside the mbox is normal, non-math-mode > > text and commands. In my case, I have some special terms that I use > > outside of mathmode, which are italicized, e.g. like > > > > \textit{foo} > > > > I need to embed exactly the same text, formatted in the same way, in > math > > mode. For example, in LaTeX, this is fine: > > > > $2 \times \mbox{\textit{foo}}$ > > > > However, when using pandoc to convert to Word, I get this error: > > > > [WARNING] Could not convert TeX math '2\times\mbox{\textit{foo}}', > > rendering as TeX: > > 2\times\mbox{\textit{foo}} > > ^ > > unexpected "\\" > > expecting "}", text, "{", "$", "$$", "\\(" or "\\[" > > > > It appears that \mbox is not treated as an escape out to normal non-math > > mode, so that things that you could normally do in LaTeX in math mode > are > > not understood by pandoc. > > > > Is this correct? Is this just an unimplemented feature? I know that > > pandoc can 't do everything that LaTeX does; that's OK. Is there a > > workaround? > > > > Thanks > > > > -- > > You received this message because you are subscribed to the Google > Groups "pandoc-discuss" group. > > To unsubscribe from this group and stop receiving emails from it, send > an email to pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To view this discussion on the web visit > https://groups.google.com/d/msgid/pandoc-discuss/7262e88e-6096-48f2-a7c4-541fa3a15410n%40googlegroups.com. > > -- You received this message because you are subscribed to the Google Groups "pandoc-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/76286a6c-b8d6-4098-b1c2-5d9e28309ec8n%40googlegroups.com. ------=_Part_400_1828853379.1599623873492 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Ah, OK.  I understand.  Thanks John. 
I found a workaround for my LaTeX code, but I'm happy to know = what was happening, and what to look out for in the future.

On Tuesday,= September 8, 2020 at 4:02:25 PM UTC-5 John MacFarlane wrote:

Math conversion is handled by the texmath library. This is
specialized to math, and in the particular case you're interested
converts tex math to the math format used by Word.

Since it's specialized to math, it doesn't know how to handle
arbitrary non-math text of the sort that can go into an mbox.

There's not a good solution without changes in texmath's
architecture (one can imagine changing it so you pass in a parser
for normal text in the target format, which would be used inside
mboxes).

I wouldn't hold your breath, but you could put up an issue
on jgm/texmath on GitHub so we don't lose track.

M A writes:

> I'm converting from LaTeX to MS Word (.docx). LaTeX lets you embe= d the=20
> command
>
> \mbox{...}
>
> in LaTeX math mode. What goes inside the mbox is normal, non-math= -mode=20
> text and commands. In my case, I have some special terms that I u= se=20
> outside of mathmode, which are italicized, e.g. like
>
> \textit{foo}
>
> I need to embed exactly the same text, formatted in the same way, = in math=20
> mode. For example, in LaTeX, this is fine:
>
> $2 \times \mbox{\textit{foo}}$
>
> However, when using pandoc to convert to Word, I get this error:
>
> [WARNING] Could not convert TeX math '2\times\mbox{\textit{foo}}',= =20
> rendering as TeX:
> 2\times\mbox{\textit{foo}}
> ^
> unexpected "\\"
> expecting "}", text, "{", "$", "$$", "\\(" or "\\["
>
> It appears that \mbox is not treated as an escape out to normal no= n-math=20
> mode, so that things that you could normally do in LaTeX in math m= ode are=20
> not understood by pandoc.
>
> Is this correct? Is this just an unimplemented feature? I know t= hat=20
> pandoc can 't do everything that LaTeX does; that's OK. Is there = a=20
> workaround?
>
> Thanks
>
> --=20
> You received this message because you are subscribed to the Google= Groups "pandoc-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, = send an email to pando= c-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
> To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/7262= e88e-6096-48f2-a7c4-541fa3a15410n%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups &= quot;pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to pand= oc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d= /msgid/pandoc-discuss/76286a6c-b8d6-4098-b1c2-5d9e28309ec8n%40googlegroups.= com.
------=_Part_400_1828853379.1599623873492-- ------=_Part_399_402188657.1599623873492--