Re: [O] problem exporting org to latex: sections with math

2017-10-26 Thread Eric S Fraga
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


signature.asc
Description: PGP signature


Re: [O] problem exporting org to latex: sections with math

2017-10-26 Thread Uwe Brauer



   > 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 




Re: [O] problem exporting org to latex: sections with math

2017-10-26 Thread Uwe Brauer

   > Hello,
   > Uwe Brauer  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.




Re: [O] problem exporting org to latex: sections with math

2017-10-26 Thread Nicolas Goaziou
Hello,

Uwe Brauer  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



Re: [O] problem exporting org to latex: sections with math

2017-10-26 Thread Eric S Fraga
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


signature.asc
Description: PGP signature


[O] problem exporting org to latex: sections with math

2017-10-26 Thread Uwe Brauer
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