emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Orgmode markups inside LaTeX fragments
@ 2012-03-08  6:32 Truong Nghiem
  2012-03-08 12:46 ` Bastien
  0 siblings, 1 reply; 6+ messages in thread
From: Truong Nghiem @ 2012-03-08  6:32 UTC (permalink / raw)
  To: emacs-orgmode

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*}

Thanks.
--
Truong Nghiem

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Orgmode markups inside LaTeX fragments
  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
  0 siblings, 1 reply; 6+ messages in thread
From: Bastien @ 2012-03-08 12:46 UTC (permalink / raw)
  To: Truong Nghiem; +Cc: emacs-orgmode

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Orgmode markups inside LaTeX fragments
  2012-03-08 12:46 ` Bastien
@ 2012-03-08 15:55   ` Truong Nghiem
  2012-03-08 21:05     ` suvayu ali
  0 siblings, 1 reply; 6+ messages in thread
From: Truong Nghiem @ 2012-03-08 15:55 UTC (permalink / raw)
  To: Bastien, emacs-orgmode

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Orgmode markups inside LaTeX fragments
  2012-03-08 15:55   ` Truong Nghiem
@ 2012-03-08 21:05     ` suvayu ali
  2012-03-13 14:28       ` Truong Nghiem
  0 siblings, 1 reply; 6+ messages in thread
From: suvayu ali @ 2012-03-08 21:05 UTC (permalink / raw)
  To: Truong Nghiem; +Cc: emacs-orgmode

On Thu, Mar 8, 2012 at 16:55, Truong Nghiem <truong.nghiem@gmail.com> wrote:
> If there is any solution or workaround for my problem, please let me know.

If these custom commands are analogs of commands like section and
such, you can always define your own LaTeX_CLASS. The manual has
information on how to do that.

GL

-- 
Suvayu

Open source is the future. It sets us free.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Orgmode markups inside LaTeX fragments
  2012-03-08 21:05     ` suvayu ali
@ 2012-03-13 14:28       ` Truong Nghiem
  2012-03-13 15:41         ` Albert Z. Wang
  0 siblings, 1 reply; 6+ messages in thread
From: Truong Nghiem @ 2012-03-13 14:28 UTC (permalink / raw)
  To: suvayu ali; +Cc: emacs-orgmode

These custom commands are not analogous to sectioning commands.  In
fact most of them are environments.  So I decided that orgmode could
not achieve what I wanted to do (at least currently) and continued to
use LaTeX.  Too bad, I really like orgmode syntax.
--
Truong Nghiem



On Thu, Mar 8, 2012 at 4:05 PM, suvayu ali <fatkasuvayu+linux@gmail.com> wrote:
> On Thu, Mar 8, 2012 at 16:55, Truong Nghiem <truong.nghiem@gmail.com> wrote:
>> If there is any solution or workaround for my problem, please let me know.
>
> If these custom commands are analogs of commands like section and
> such, you can always define your own LaTeX_CLASS. The manual has
> information on how to do that.
>
> GL
>
> --
> Suvayu
>
> Open source is the future. It sets us free.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Orgmode markups inside LaTeX fragments
  2012-03-13 14:28       ` Truong Nghiem
@ 2012-03-13 15:41         ` Albert Z. Wang
  0 siblings, 0 replies; 6+ messages in thread
From: Albert Z. Wang @ 2012-03-13 15:41 UTC (permalink / raw)
  To: emacs-orgmode


I had a similar issue with typesetting in theorem and proof
environments; what saved me from messy LaTeX syntax was
org-special-blocks.  More info is on Worg:

http://orgmode.org/worg/org-contrib/org-special-blocks.html

This is not *exactly* your situation, since this is using org syntax
within \begin{} ... \end{} blocks, but if you can adapt your commands
to be environments, this will get you what you want.

--
Albert Wang

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-03-13 15:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2012-03-08 21:05     ` suvayu ali
2012-03-13 14:28       ` Truong Nghiem
2012-03-13 15:41         ` Albert Z. Wang

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).