emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* problem exporting org to latex: sections with math
@ 2017-10-26  8:24 Uwe Brauer
  2017-10-26  8:52 ` Eric S Fraga
  2017-10-26  9:04 ` Nicolas Goaziou
  0 siblings, 2 replies; 6+ messages in thread
From: Uwe Brauer @ 2017-10-26  8:24 UTC (permalink / raw)
  To: emacs-orgmode

Hello

I export a org file to latex using the exam class and therefore thanks
to Thomas Hunter I have defined.


(org-latex-classes
(quote
 (
  ("exam" "\\documentclass[12pt, addpoints, answers]{exam}"
   ("\\begin{questions}%%%s" "\\end{questions}"
   "\\begin{questions}%%%s" "\\end{questions}")
   ("\\titledquestion[%s]  " . "")
   ("\\begin{parts}%%%s" "\\end{parts}" "\\begin{parts}%%%s"
   "\\end{parts}")
   ("\\part[%s] " . "")
   ("\\begin{subparts}%%%s" "\\end{subparts}"
   "\\begin{subparts}%%%s" "\\end{subparts}")
   ("\\subpart[%s] " . "")
   ("\\begin{solution}[%s]" "\\end{solution}" "\\begin{solution}[%s]"
   "\\end{solution}")))))

The problem is that my document also contains latex \section commmands.
These are exported correctly *only* if they don't contain math.

Works
\section{Adaptive methods using  hopt}

Does not work:
\section{Adaptive methods using  $h_{\text{op}}$}


The resulting latex file looks like

Ok
\section{Adaptive methods using  hopt}

The following is not ok,

\section\{Adaptive methods using  \(h_{\text{op}}\)\}


So what shall I do?

Thanks regards

Uwe Brauer 

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

* Re: problem exporting org to latex: sections with math
  2017-10-26  8:24 problem exporting org to latex: sections with math Uwe Brauer
@ 2017-10-26  8:52 ` Eric S Fraga
  2017-10-26 14:55   ` Uwe Brauer
  2017-10-26  9:04 ` Nicolas Goaziou
  1 sibling, 1 reply; 6+ messages in thread
From: Eric S Fraga @ 2017-10-26  8:52 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 442 bytes --]

On Thursday, 26 Oct 2017 at 10:24, Uwe Brauer wrote:
> Hello
>
> I export a org file to latex using the exam class and therefore thanks
> to Thomas Hunter I have defined.

[...]

> So what shall I do?

My suggestion would be to use top level headlines (level 1) as sections
and subheadlines as questions/solutions.  I.e. change the
org-latex-classes entry.

-- 
: Eric S Fraga via Emacs 27.0.50, Org release_9.1.2-117-g5b2b8f

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 194 bytes --]

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

* Re: problem exporting org to latex: sections with math
  2017-10-26  8:24 problem exporting org to latex: sections with math Uwe Brauer
  2017-10-26  8:52 ` Eric S Fraga
@ 2017-10-26  9:04 ` Nicolas Goaziou
  2017-10-26 14:54   ` Uwe Brauer
  1 sibling, 1 reply; 6+ messages in thread
From: Nicolas Goaziou @ 2017-10-26  9:04 UTC (permalink / raw)
  To: emacs-orgmode

Hello,

Uwe Brauer <oub@mat.ucm.es> writes:

> The problem is that my document also contains latex \section commmands.
> These are exported correctly *only* if they don't contain math.
>
> Works
> \section{Adaptive methods using  hopt}
>
> Does not work:
> \section{Adaptive methods using  $h_{\text{op}}$}

IIUC, you write the above directly in the document. Org has very limited
support for raw LaTeX syntax. It can only understand simple macros with
simple arguments -- i.e., no nested arguments.

If you need to write more complicated constructs in the document,
consider using dedicated syntax, e.g.,

  #+latex: \section{Adaptive methods using  $h_{\text{op}}$}

Regards,

-- 
Nicolas Goaziou

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

* Re: problem exporting org to latex: sections with math
  2017-10-26  9:04 ` Nicolas Goaziou
@ 2017-10-26 14:54   ` Uwe Brauer
  0 siblings, 0 replies; 6+ messages in thread
From: Uwe Brauer @ 2017-10-26 14:54 UTC (permalink / raw)
  To: emacs-orgmode


   > Hello,
   > Uwe Brauer <oub@mat.ucm.es> writes:


   > IIUC, you write the above directly in the document. Org has very limited
   > support for raw LaTeX syntax. It can only understand simple macros with
   > simple arguments -- i.e., no nested arguments.

   > If you need to write more complicated constructs in the document,
   > consider using dedicated syntax, e.g.,

   >   #+latex: \section{Adaptive methods using  $h_{\text{op}}$}

Ah thanks! That solves my problem.

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

* Re: problem exporting org to latex: sections with math
  2017-10-26  8:52 ` Eric S Fraga
@ 2017-10-26 14:55   ` Uwe Brauer
  2017-10-26 15:39     ` Eric S Fraga
  0 siblings, 1 reply; 6+ messages in thread
From: Uwe Brauer @ 2017-10-26 14:55 UTC (permalink / raw)
  To: emacs-orgmode




   > On Thursday, 26 Oct 2017 at 10:24, Uwe Brauer wrote:

   > [...]


   > My suggestion would be to use top level headlines (level 1) as
   > sections and subheadlines as questions/solutions. I.e. change the
   > org-latex-classes entry.

That is a possibility, thanks, but I think right now I will stick to
Nick's suggestion.

Uwe 

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

* Re: problem exporting org to latex: sections with math
  2017-10-26 14:55   ` Uwe Brauer
@ 2017-10-26 15:39     ` Eric S Fraga
  0 siblings, 0 replies; 6+ messages in thread
From: Eric S Fraga @ 2017-10-26 15:39 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 496 bytes --]

On Thursday, 26 Oct 2017 at 16:55, Uwe Brauer wrote:
>    > My suggestion would be to use top level headlines (level 1) as
>    > sections and subheadlines as questions/solutions. I.e. change the
>    > org-latex-classes entry.
>
> That is a possibility, thanks, but I think right now I will stick to
> Nick's suggestion.

Always, especially in org, more than one way to skin a cat (apologies to
cat lovers... :-)).
-- 
: Eric S Fraga via Emacs 27.0.50, Org release_9.1.2-117-g5b2b8f

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 194 bytes --]

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

end of thread, other threads:[~2017-10-26 15:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-26  8:24 problem exporting org to latex: sections with math Uwe Brauer
2017-10-26  8:52 ` Eric S Fraga
2017-10-26 14:55   ` Uwe Brauer
2017-10-26 15:39     ` Eric S Fraga
2017-10-26  9:04 ` Nicolas Goaziou
2017-10-26 14:54   ` Uwe Brauer

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