emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Truong Nghiem <truong.nghiem@gmail.com>
To: Bastien <bzg@gnu.org>, emacs-orgmode@gnu.org
Subject: Re: Orgmode markups inside LaTeX fragments
Date: Thu, 8 Mar 2012 10:55:19 -0500	[thread overview]
Message-ID: <CADNXMz-gk3zFc3mh=mOy0727bxbgwP-8NhE3n-JMc2hhG=8fTg@mail.gmail.com> (raw)
In-Reply-To: <87wr6vb6q3.fsf@gnu.org>

Hi Bastien,

My use-case is that I need to write a document that needs to be output
to various styles (all using LaTeX).  Each style may use a different
class and set of packages.  And each  defines a different set of
commands, with different syntax, to format the contents (they are not
standard as \section, etc.)  Of course I don't want to re-write the
same contents for each style, so I defined a common command interface
such that I could write the contents as
    \contentBlockOne{\textbf{Bold text}}
and implemented the interface for each specific style.

That has been working very well until I need to also output the
contents to HTML.  I thought it would be great to migrate the contents
to orgmode, then export to LaTeX or HTML.  But I need to re-use the
common interface, so I defined orgmode macros to be able to write:
    {{{contentBlockOne(*Bold text*)}}}
or
    {{{contentBlockOneBegin}}} *Bold text* {{{contentBlockOneEnd}}}
The macros will be expanded to LaTeX commands or HTML markups accordingly.
The problem is that orgmode markups inside LaTeX or HTML fragments are
not converted.  And I cannot use \textbf because it will not be
translated to HTML.

However, I've just discovered that while markups like *bold*,
/italic/... are not converted, other markups like lists are.  For
example:
\mycommand{*Bold*
- Item 1
- Item 2
}

is exported as

\mycommand{\textbf{Bold}
\begin{itemize}
\item Item 1
\item Item 2
\end{itemize}
}

So it seems a bit inconsistent.

If there is any solution or workaround for my problem, please let me know.

Thanks,
--
Truong Nghiem



On Thu, Mar 8, 2012 at 7:46 AM, Bastien <bzg@gnu.org> wrote:
> Hi Truong,
>
> Truong Nghiem <truong.nghiem@gmail.com> writes:
>
>> Is there any way to turn on orgmode markups inside LaTeX fragments for
>> export?  For example, when I write
>>     \mycommand{*Bold text*}
>> in an org file and export it to LaTeX, I would like to have
>>     \mycommand{\textbf{Bold text}}
>> Currently it is exported as-is (verbatim):
>>     \mycommand{*Bold text*}
>
> There is no way to achieve this right now, and I think it would be
> confusing to support mixed syntax.  But I'm open to better use-cases.
>
> Thanks,
>
> --
>  Bastien

  reply	other threads:[~2012-03-08 15:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-08  6:32 Orgmode markups inside LaTeX fragments Truong Nghiem
2012-03-08 12:46 ` Bastien
2012-03-08 15:55   ` Truong Nghiem [this message]
2012-03-08 21:05     ` suvayu ali
2012-03-13 14:28       ` Truong Nghiem
2012-03-13 15:41         ` Albert Z. Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CADNXMz-gk3zFc3mh=mOy0727bxbgwP-8NhE3n-JMc2hhG=8fTg@mail.gmail.com' \
    --to=truong.nghiem@gmail.com \
    --cc=bzg@gnu.org \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).