From mboxrd@z Thu Jan 1 00:00:00 1970 From: edgar@openmail.cc Subject: Re: How to export LaTeX amsmath align bmatrix to ODT? Date: Mon, 12 Jun 2017 21:36:09 +0000 Message-ID: References: <053c5f245be78d9dd8952c300c6b192b@openmail.cc> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55834) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dKX0j-0007LO-Jn for emacs-orgmode@gnu.org; Mon, 12 Jun 2017 17:36:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dKX0g-0004NM-G2 for emacs-orgmode@gnu.org; Mon, 12 Jun 2017 17:36:33 -0400 Received: from onethreetwo.vfemail.net ([199.16.11.132]:35752 helo=vfemail.net) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dKX0g-0004Mb-7n for emacs-orgmode@gnu.org; Mon, 12 Jun 2017 17:36:30 -0400 In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org On 2017-06-10 05:13, edgar@openmail.cc wrote: > On 2017-06-10 04:54, edgar@openmail.cc wrote: >> Hello, >> >> I have been making progress with my export procedure to ODT. I would >> like to know if someone knows how to export the following LaTeX block >> to ODT correctly: >> >> \[\begin{align} \begin{bmatrix} a = 1 & b=2 \\ c=3 & d = 4 >> \end{bmatrix} \end{align}\] >> https://www.vfemail.net/roundcube/?_task=mail&_action=compose&_id=289067995593b7fd683a1f# >> \[\begin{align} a = & 1 + 2 + 3 + 4 \\ c = & 4 \end{bmatrix} >> \end{align}\] >> >> As always, any help is welcome :) . >> >> >> Edgar > > By the way, I tried with latexmlmath and mathtoweb.jar without success. Ok. I got it (with a minor glitch). If someone can help me to get the right colors on the screen (my screen is black; the \tensor symbol is also black), I would appreciate it. Now I can export to ODT with my custom symbols and the bmatrix environment. For the record, I had modified org-preview-latex-process-alist to get custom symbols, and this got in the way of the LaTeX bmatrix environment (I don't know how; I was loading a file with with :latex-header as "\\input{preamble.tex}"). My partial answer (it is partial, because the \tensor preview renders in a different color than the rest of symbols): Instead of modifying org-preview-latex-process-alist, the answer I modified org-format-tex-header. I added the following at the end of M-x customize-variable org-format-tex-header (I leave it here for posterity; I added some symbols: tensor, derivative, vector, Roman numeral, etc.) \usepackage{stackengine} \stackMath % Does not work % \newcommand\tenq[2]{% % \def\useanchorwidth{T}% % \ifnum#1>1% % \stackunder[0pt]{\tenq[\numexpr#1-1\relax]{#2}}{\scriptscriptstyle\sim}% % \else% % \stackunder[1pt]{#2}{\scriptscriptstyle\sim}% % \fi% %} % Change del operator to d % http://tex.stackexchange.com/questions/178946/better-automatic-spacing-of-differential-d \renewcommand{\d}[1]{\mathop{\mathrm{d}{#1}}\!{}} \newcommand{\del}[1]{\d{\left(#1\right)}} \newcommand{\diff}[2]{ \frac{\d{}}{\d{#2}} \left(#1\right)} \newcommand{\deriv}[2]{ \frac{\del{#1}}{\d{#2}}} % https://tex.stackexchange.com/a/229547 \renewcommand{\vec}[1]{ \hbox{\oalign{$#1$\crcr\hidewidth$\scriptscriptstyle\sim$\hidewidth}}} % --- Define \dvec and \ddvec for dotted and double-dotted vectors. \newcommand{\dvec}[1]{\dot{\vec{#1}}} \newcommand{\ddvec}[1]{\ddot{\vec{#1}}} % https://tex.stackexchange.com/questions/229543/double-tilde-symbol-under-letter \newcommand{\dtens}[1]{ \stackunder[0pt]{\stackunder[1pt]{#1}{\scriptscriptstyle\sim}}{\scriptscriptstyle\sim}} \newcommand{\ftens}[1]{ \stackunder[0pt]{\stackunder[0pt]{\stackunder[0pt]{\stackunder[1pt]{#1}{\scriptscriptstyle\sim}}{\scriptscriptstyle\sim}}{\scriptscriptstyle\sim}}{\scriptscriptstyle\sim} } % Define \tensor and \mtensor (matrix) \newcommand{\tensor}[1]{\dtens{#1}} \newcommand{\tens}[1]{\ftens{#1}} \newcommand{\mtensor}[1]{% \left[{\tensor{#1}}\right]} % --- Define \dtens and \ddtens for dotted and double-dotted tensors. \newcommand{\dtens}[1]{\dot{\tensor{#1}}} \newcommand{\ddtens}[1]{\ddot{\tensor{#1}}} % --- Define \dmtens and \ddmtens for dotted and double-dotted tensors. \newcommand{\dmtens}[1]{\dot{\mtensor{#1}}} \newcommand{\ddmtens}[1]{\ddot{\mtensor{#1}}} % Trace \newcommand{\Tr}[1]{\mathop{\mathrm{tr}}\!{}\left(#1\right)} % Have a thicker line for the mean value %\newcommand*{\mean}[1]{\overbracket[0.65pt][-1pt]{#1}} % amssymb, amsmath % adapt: http://tex.stackexchange.com/questions/22100/the-bar-and-overline-commands \newcommand{\mean}[1]{\mkern 3mu\overbracket[0.65pt][-1pt]{\mkern-3mu#1\mkern-3mu}\mkern 3mu} % Roman number III \def\III{I\hspace{-2pt}I\hspace{-2pt}I} ------------------------------------------------- ONLY AT VFEmail! - Use our Metadata Mitigator to keep your email out of the NSA's hands! $24.95 ONETIME Lifetime accounts with Privacy Features! 15GB disk! No bandwidth quotas! Commercial and Bulk Mail Options!