public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* LaTeX Macros from External File
@ 2019-04-21 20:27 Alberto Simoes
       [not found] ` <f2870a3c-cdc1-4ede-bb88-8875a94537ab-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 11+ messages in thread
From: Alberto Simoes @ 2019-04-21 20:27 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 807 bytes --]

Hi

The latex_macro extension allows me to define extensions directly on my 
pandoc md source.
Nevertheless, I have a file with my usual macros, and I would like to use 
it from my pandoc md files.
Is that possible?

Thank you
Alberto

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/f2870a3c-cdc1-4ede-bb88-8875a94537ab%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #1.2: Type: text/html, Size: 1310 bytes --]

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

* Re: LaTeX Macros from External File
       [not found] ` <f2870a3c-cdc1-4ede-bb88-8875a94537ab-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2019-04-22 13:22   ` BPJ
       [not found]     ` <CADAJKhDvc-WkrgyqP=Ahoz1YgVZLEGnw58Fya6mW=fgw13mfkA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 11+ messages in thread
From: BPJ @ 2019-04-22 13:22 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

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

You can include the file with the macro definitions on the command line
before the actual source. They will be concatenated so effectively the
macro definitions end up at the top of your markdown.Just make sure to give
it an `.md` rather than a `.tex` or `.ltx` extension, or set the source
format explicitly with the `-f` or `-r` option:

````sh
pandoc -f markdown mymacros.ltx source.md
````


Den sön 21 apr. 2019 22:28Alberto Simoes <hashashin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> skrev:

> Hi
>
> The latex_macro extension allows me to define extensions directly on my
> pandoc md source.
> Nevertheless, I have a file with my usual macros, and I would like to use
> it from my pandoc md files.
> Is that possible?
>
> Thank you
> Alberto
>
> --
> You received this message because you are subscribed to the Google Groups
> "pandoc-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pandoc-discuss/f2870a3c-cdc1-4ede-bb88-8875a94537ab%40googlegroups.com
> <https://groups.google.com/d/msgid/pandoc-discuss/f2870a3c-cdc1-4ede-bb88-8875a94537ab%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CADAJKhDvc-WkrgyqP%3DAhoz1YgVZLEGnw58Fya6mW%3Dfgw13mfkA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #2: Type: text/html, Size: 3299 bytes --]

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

* Re: LaTeX Macros from External File
       [not found]     ` <CADAJKhDvc-WkrgyqP=Ahoz1YgVZLEGnw58Fya6mW=fgw13mfkA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2019-04-22 15:52       ` John MacFarlane
  2019-04-25 19:33       ` Alberto Simoes
  1 sibling, 0 replies; 11+ messages in thread
From: John MacFarlane @ 2019-04-22 15:52 UTC (permalink / raw)
  To: BPJ, pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw


You can even use

\include{mymacros}

in a markdown file and it will load the macros you
define in mymacros.sty or .tex.


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

* Re: LaTeX Macros from External File
       [not found]     ` <CADAJKhDvc-WkrgyqP=Ahoz1YgVZLEGnw58Fya6mW=fgw13mfkA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  2019-04-22 15:52       ` John MacFarlane
@ 2019-04-25 19:33       ` Alberto Simoes
       [not found]         ` <70bd63af-7ad0-4c24-8531-a0c3ac418ff1-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  1 sibling, 1 reply; 11+ messages in thread
From: Alberto Simoes @ 2019-04-25 19:33 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 2710 bytes --]

Hi

For LaTeX it is working great.
Nevertheless, for HTML, it isn't. 
And it is behaving strangely.

These are my macros:

\newcommand{\yhat}{\hat{y}}
\newcommand{\ex}[2]{#1^{(#2)}}
\newcommand{\exi}[1]{\ex{#1}{i}}

and only the one in the middle (\ex) is really being processed properly.
No matter the place I put it, it is always the only working.
Is this because it is the only one that only uses "primitive" constructs, 
somehow?

Thank you
Alberto


On Monday, April 22, 2019 at 2:22:53 PM UTC+1, BP wrote:
>
> You can include the file with the macro definitions on the command line 
> before the actual source. They will be concatenated so effectively the 
> macro definitions end up at the top of your markdown.Just make sure to give 
> it an `.md` rather than a `.tex` or `.ltx` extension, or set the source 
> format explicitly with the `-f` or `-r` option:
>
> ````sh
> pandoc -f markdown mymacros.ltx source.md
> ````
>
>
> Den sön 21 apr. 2019 22:28Alberto Simoes <hash...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org <javascript:>> 
> skrev:
>
>> Hi
>>
>> The latex_macro extension allows me to define extensions directly on my 
>> pandoc md source.
>> Nevertheless, I have a file with my usual macros, and I would like to use 
>> it from my pandoc md files.
>> Is that possible?
>>
>> Thank you
>> Alberto
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "pandoc-discuss" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <javascript:>.
>> To post to this group, send email to pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org 
>> <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/pandoc-discuss/f2870a3c-cdc1-4ede-bb88-8875a94537ab%40googlegroups.com 
>> <https://groups.google.com/d/msgid/pandoc-discuss/f2870a3c-cdc1-4ede-bb88-8875a94537ab%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/70bd63af-7ad0-4c24-8531-a0c3ac418ff1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #1.2: Type: text/html, Size: 4981 bytes --]

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

* Re: LaTeX Macros from External File
       [not found]         ` <70bd63af-7ad0-4c24-8531-a0c3ac418ff1-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2019-04-25 20:02           ` Alberto Simoes
       [not found]             ` <2572e66c-d943-4899-98c7-90fbed4b7aaa-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 11+ messages in thread
From: Alberto Simoes @ 2019-04-25 20:02 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 3036 bytes --]

Tried changing exi to not use ex:

\newcommand{\exi}[1]{#1^{(i)}} 
\newcommand{\ex}[2]{#1^{(#2)}}
\newcommand{\yhat}{\hat{y}} 

but exi continues not working.
Any idea why? I am completely clueless!

On Thursday, April 25, 2019 at 8:33:22 PM UTC+1, Alberto Simoes wrote:
>
> Hi
>
> For LaTeX it is working great.
> Nevertheless, for HTML, it isn't. 
> And it is behaving strangely.
>
> These are my macros:
>
> \newcommand{\yhat}{\hat{y}}
> \newcommand{\ex}[2]{#1^{(#2)}}
> \newcommand{\exi}[1]{\ex{#1}{i}}
>
> and only the one in the middle (\ex) is really being processed properly.
> No matter the place I put it, it is always the only working.
> Is this because it is the only one that only uses "primitive" constructs, 
> somehow?
>
> Thank you
> Alberto
>
>
> On Monday, April 22, 2019 at 2:22:53 PM UTC+1, BP wrote:
>>
>> You can include the file with the macro definitions on the command line 
>> before the actual source. They will be concatenated so effectively the 
>> macro definitions end up at the top of your markdown.Just make sure to give 
>> it an `.md` rather than a `.tex` or `.ltx` extension, or set the source 
>> format explicitly with the `-f` or `-r` option:
>>
>> ````sh
>> pandoc -f markdown mymacros.ltx source.md
>> ````
>>
>>
>> Den sön 21 apr. 2019 22:28Alberto Simoes <hash...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> skrev:
>>
>>> Hi
>>>
>>> The latex_macro extension allows me to define extensions directly on my 
>>> pandoc md source.
>>> Nevertheless, I have a file with my usual macros, and I would like to 
>>> use it from my pandoc md files.
>>> Is that possible?
>>>
>>> Thank you
>>> Alberto
>>>
>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "pandoc-discuss" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to pandoc-...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>>> To post to this group, send email to pandoc-...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/pandoc-discuss/f2870a3c-cdc1-4ede-bb88-8875a94537ab%40googlegroups.com 
>>> <https://groups.google.com/d/msgid/pandoc-discuss/f2870a3c-cdc1-4ede-bb88-8875a94537ab%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/2572e66c-d943-4899-98c7-90fbed4b7aaa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #1.2: Type: text/html, Size: 4997 bytes --]

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

* Re: LaTeX Macros from External File
       [not found]             ` <2572e66c-d943-4899-98c7-90fbed4b7aaa-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2019-04-25 20:41               ` Alberto Simoes
  2019-04-26  0:45               ` John MacFarlane
  1 sibling, 0 replies; 11+ messages in thread
From: Alberto Simoes @ 2019-04-25 20:41 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 3396 bytes --]


Hi,

My bad, none is really being expanded...  
I had an equation where I still had it written manually...

So, no, using macros to export to html is not working, unfortunately.

Thanks
Alberto

On Thursday, April 25, 2019 at 9:02:56 PM UTC+1, Alberto Simoes wrote:
>
> Tried changing exi to not use ex:
>
> \newcommand{\exi}[1]{#1^{(i)}} 
> \newcommand{\ex}[2]{#1^{(#2)}}
> \newcommand{\yhat}{\hat{y}} 
>
> but exi continues not working.
> Any idea why? I am completely clueless!
>
> On Thursday, April 25, 2019 at 8:33:22 PM UTC+1, Alberto Simoes wrote:
>>
>> Hi
>>
>> For LaTeX it is working great.
>> Nevertheless, for HTML, it isn't. 
>> And it is behaving strangely.
>>
>> These are my macros:
>>
>> \newcommand{\yhat}{\hat{y}}
>> \newcommand{\ex}[2]{#1^{(#2)}}
>> \newcommand{\exi}[1]{\ex{#1}{i}}
>>
>> and only the one in the middle (\ex) is really being processed properly.
>> No matter the place I put it, it is always the only working.
>> Is this because it is the only one that only uses "primitive" constructs, 
>> somehow?
>>
>> Thank you
>> Alberto
>>
>>
>> On Monday, April 22, 2019 at 2:22:53 PM UTC+1, BP wrote:
>>>
>>> You can include the file with the macro definitions on the command line 
>>> before the actual source. They will be concatenated so effectively the 
>>> macro definitions end up at the top of your markdown.Just make sure to give 
>>> it an `.md` rather than a `.tex` or `.ltx` extension, or set the source 
>>> format explicitly with the `-f` or `-r` option:
>>>
>>> ````sh
>>> pandoc -f markdown mymacros.ltx source.md
>>> ````
>>>
>>>
>>> Den sön 21 apr. 2019 22:28Alberto Simoes <hash...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> skrev:
>>>
>>>> Hi
>>>>
>>>> The latex_macro extension allows me to define extensions directly on my 
>>>> pandoc md source.
>>>> Nevertheless, I have a file with my usual macros, and I would like to 
>>>> use it from my pandoc md files.
>>>> Is that possible?
>>>>
>>>> Thank you
>>>> Alberto
>>>>
>>>> -- 
>>>> You received this message because you are subscribed to the Google 
>>>> Groups "pandoc-discuss" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send 
>>>> an email to pandoc-...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>>>> To post to this group, send email to pandoc-...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>>>> To view this discussion on the web visit 
>>>> https://groups.google.com/d/msgid/pandoc-discuss/f2870a3c-cdc1-4ede-bb88-8875a94537ab%40googlegroups.com 
>>>> <https://groups.google.com/d/msgid/pandoc-discuss/f2870a3c-cdc1-4ede-bb88-8875a94537ab%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>> .
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/03bec534-eafd-48ea-8e2f-e7c9df42c6e7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #1.2: Type: text/html, Size: 5536 bytes --]

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

* Re: LaTeX Macros from External File
       [not found]             ` <2572e66c-d943-4899-98c7-90fbed4b7aaa-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  2019-04-25 20:41               ` Alberto Simoes
@ 2019-04-26  0:45               ` John MacFarlane
       [not found]                 ` <m236m5y4qa.fsf-Kg0TIO5PyJpkhmErBYysHMpsVdM05VCzQjotyikrkNS67hWjmhPcHA/vqy67L5BpjQwYZcTdm+3YtjvyW6yDsg==@public.gmane.org>
  1 sibling, 1 reply; 11+ messages in thread
From: John MacFarlane @ 2019-04-26  0:45 UTC (permalink / raw)
  To: Alberto Simoes, pandoc-discuss


Works fine for me (pandoc 2.7.2):

 % pandoc -t html
\newcommand{\exi}[1]{#1^{(i)}} 
\newcommand{\ex}[2]{#1^{(#2)}}
\newcommand{\yhat}{\hat{y}} 

$\exi{x}$ 

$\ex{1}{2}$

$\yhat$
^D
<p><span class="math inline"><em>x</em><sup>(<em>i</em>)</sup></span></p>
<p><span class="math inline">1<sup>(2)</sup></span></p>
<p><span class="math inline"><em>ŷ</em></span></p>

Do you get different results with the same command?

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/m236m5y4qa.fsf%40nat-tvwna-inside-visitornet101-10-25-115-77.princeton.org.
For more options, visit https://groups.google.com/d/optout.


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

* Re: LaTeX Macros from External File
       [not found]                 ` <m236m5y4qa.fsf-Kg0TIO5PyJpkhmErBYysHMpsVdM05VCzQjotyikrkNS67hWjmhPcHA/vqy67L5BpjQwYZcTdm+3YtjvyW6yDsg==@public.gmane.org>
@ 2019-04-26  8:44                   ` Alberto Simões
       [not found]                     ` <CAAkRyrt80T0O-bCBGirQwAUM5oA_Ooxpg=41Jp9NyKNrkQ8vTg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 11+ messages in thread
From: Alberto Simões @ 2019-04-26  8:44 UTC (permalink / raw)
  To: John MacFarlane; +Cc: pandoc-discuss

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

Hi, John

the problem is that I am using the equation (and eqnarray) environments, to
get the formulas numbered.

Do you know if there is a way to make that work there too?
Thank you

On Fri, Apr 26, 2019 at 1:45 AM John MacFarlane <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org> wrote:

>
> Works fine for me (pandoc 2.7.2):
>
>  % pandoc -t html
> \newcommand{\exi}[1]{#1^{(i)}}
> \newcommand{\ex}[2]{#1^{(#2)}}
> \newcommand{\yhat}{\hat{y}}
>
> $\exi{x}$
>
> $\ex{1}{2}$
>
> $\yhat$
> ^D
> <p><span class="math inline"><em>x</em><sup>(<em>i</em>)</sup></span></p>
> <p><span class="math inline">1<sup>(2)</sup></span></p>
> <p><span class="math inline"><em>ŷ</em></span></p>
>
> Do you get different results with the same command?
>
>

-- 
Alberto Simões

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CAAkRyrt80T0O-bCBGirQwAUM5oA_Ooxpg%3D41Jp9NyKNrkQ8vTg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #2: Type: text/html, Size: 2794 bytes --]

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

* Re: LaTeX Macros from External File
       [not found]                     ` <CAAkRyrt80T0O-bCBGirQwAUM5oA_Ooxpg=41Jp9NyKNrkQ8vTg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2019-04-28 20:05                       ` Alberto Simoes
       [not found]                         ` <03c33657-2843-46b2-a074-eca3173938cc-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 11+ messages in thread
From: Alberto Simoes @ 2019-04-28 20:05 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 2080 bytes --]

Hi

I just found out that if I add in the top of my generated HTML file using 
MathJAX the macros as:


\(
\newcommand{\exi}[1]{#1^{(i)}}
\newcommand{\ex}[2]{#1^{(#2)}}
\newcommand{\yhat}{\hat{y}}
\newcommand{\Yhat}{\hat{Y}}

\newcommand{\dZ}{{\,d\!Z}}
\newcommand{\dz}{{\,d\!z}}
\newcommand{\dw}{{\,d\!w}}
\newcommand{\db}{{\,d\!b}}
\)

then all my macros are correctly, even when inside a equation or eqnarray 
environment.
It would be very interesting to have a way to feed math macros to the HTML 
output (I know I can put it on the template, and probably will be my 
current approach).

Cheers

On Friday, April 26, 2019 at 9:45:07 AM UTC+1, Alberto Simoes wrote:
>
> Hi, John
>
> the problem is that I am using the equation (and eqnarray) environments, 
> to get the formulas numbered.
>
> Do you know if there is a way to make that work there too?
> Thank you
>
> On Fri, Apr 26, 2019 at 1:45 AM John MacFarlane <...> wrote:
>
>>
>> Works fine for me (pandoc 2.7.2):
>>
>>  % pandoc -t html
>> \newcommand{\exi}[1]{#1^{(i)}} 
>> \newcommand{\ex}[2]{#1^{(#2)}}
>> \newcommand{\yhat}{\hat{y}} 
>>
>> $\exi{x}$ 
>>
>> $\ex{1}{2}$
>>
>> $\yhat$
>> ^D
>> <p><span class="math inline"><em>x</em><sup>(<em>i</em>)</sup></span></p>
>> <p><span class="math inline">1<sup>(2)</sup></span></p>
>> <p><span class="math inline"><em>ŷ</em></span></p>
>>
>> Do you get different results with the same command?
>>
>>
>
> -- 
> Alberto Simões
>

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/03c33657-2843-46b2-a074-eca3173938cc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #1.2: Type: text/html, Size: 3486 bytes --]

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

* Re: LaTeX Macros from External File
       [not found]                         ` <03c33657-2843-46b2-a074-eca3173938cc-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2019-04-29 18:55                           ` BPJ
       [not found]                             ` <CADAJKhAMSptqwy2NGVufupe0G0YGnXd=qV+jd1489XyxiH259g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 11+ messages in thread
From: BPJ @ 2019-04-29 18:55 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

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

See

https://pandoc.org/MANUAL.html#option--include-in-header

or try

````````markdown
---
header-includes:
  - |
    ````{=html}
    <!-- whatever you need here -->
    ````
````````

You can't use both methods at the same time though since the option
overrides the metadata.


Den sön 28 apr. 2019 22:06Alberto Simoes <hashashin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> skrev:

> Hi
>
> I just found out that if I add in the top of my generated HTML file using
> MathJAX the macros as:
>
>
> \(
> \newcommand{\exi}[1]{#1^{(i)}}
> \newcommand{\ex}[2]{#1^{(#2)}}
> \newcommand{\yhat}{\hat{y}}
> \newcommand{\Yhat}{\hat{Y}}
>
> \newcommand{\dZ}{{\,d\!Z}}
> \newcommand{\dz}{{\,d\!z}}
> \newcommand{\dw}{{\,d\!w}}
> \newcommand{\db}{{\,d\!b}}
> \)
>
> then all my macros are correctly, even when inside a equation or eqnarray
> environment.
> It would be very interesting to have a way to feed math macros to the HTML
> output (I know I can put it on the template, and probably will be my
> current approach).
>
> Cheers
>
> On Friday, April 26, 2019 at 9:45:07 AM UTC+1, Alberto Simoes wrote:
>>
>> Hi, John
>>
>> the problem is that I am using the equation (and eqnarray) environments,
>> to get the formulas numbered.
>>
>> Do you know if there is a way to make that work there too?
>> Thank you
>>
>> On Fri, Apr 26, 2019 at 1:45 AM John MacFarlane <...> wrote:
>>
>>>
>>> Works fine for me (pandoc 2.7.2):
>>>
>>>  % pandoc -t html
>>> \newcommand{\exi}[1]{#1^{(i)}}
>>> \newcommand{\ex}[2]{#1^{(#2)}}
>>> \newcommand{\yhat}{\hat{y}}
>>>
>>> $\exi{x}$
>>>
>>> $\ex{1}{2}$
>>>
>>> $\yhat$
>>> ^D
>>> <p><span class="math inline"><em>x</em><sup>(<em>i</em>)</sup></span></p>
>>> <p><span class="math inline">1<sup>(2)</sup></span></p>
>>> <p><span class="math inline"><em>ŷ</em></span></p>
>>>
>>> Do you get different results with the same command?
>>>
>>>
>>
>> --
>> Alberto Simões
>>
> --
> You received this message because you are subscribed to the Google Groups
> "pandoc-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pandoc-discuss/03c33657-2843-46b2-a074-eca3173938cc%40googlegroups.com
> <https://groups.google.com/d/msgid/pandoc-discuss/03c33657-2843-46b2-a074-eca3173938cc%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CADAJKhAMSptqwy2NGVufupe0G0YGnXd%3DqV%2Bjd1489XyxiH259g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #2: Type: text/html, Size: 5708 bytes --]

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

* Re: LaTeX Macros from External File
       [not found]                             ` <CADAJKhAMSptqwy2NGVufupe0G0YGnXd=qV+jd1489XyxiH259g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2019-04-30 14:15                               ` Alberto Simões
  0 siblings, 0 replies; 11+ messages in thread
From: Alberto Simões @ 2019-04-30 14:15 UTC (permalink / raw)
  To: pandoc-discuss

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

Hi

-B should be a way to go (main problem is needing to put \( \) around)
Another option would be if the syntax used for templates support file
inclusion (didn't search for the documentation yet).

Thank you!
Alberto

On Mon, Apr 29, 2019 at 7:55 PM BPJ <melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:

> See
>
> https://pandoc.org/MANUAL.html#option--include-in-header
>
> or try
>
> ````````markdown
> ---
> header-includes:
>   - |
>     ````{=html}
>     <!-- whatever you need here -->
>     ````
> ````````
>
> You can't use both methods at the same time though since the option
> overrides the metadata.
>
>
> Den sön 28 apr. 2019 22:06Alberto Simoes <hashashin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> skrev:
>
>> Hi
>>
>> I just found out that if I add in the top of my generated HTML file using
>> MathJAX the macros as:
>>
>>
>> \(
>> \newcommand{\exi}[1]{#1^{(i)}}
>> \newcommand{\ex}[2]{#1^{(#2)}}
>> \newcommand{\yhat}{\hat{y}}
>> \newcommand{\Yhat}{\hat{Y}}
>>
>> \newcommand{\dZ}{{\,d\!Z}}
>> \newcommand{\dz}{{\,d\!z}}
>> \newcommand{\dw}{{\,d\!w}}
>> \newcommand{\db}{{\,d\!b}}
>> \)
>>
>> then all my macros are correctly, even when inside a equation or eqnarray
>> environment.
>> It would be very interesting to have a way to feed math macros to the
>> HTML output (I know I can put it on the template, and probably will be my
>> current approach).
>>
>> Cheers
>>
>> On Friday, April 26, 2019 at 9:45:07 AM UTC+1, Alberto Simoes wrote:
>>>
>>> Hi, John
>>>
>>> the problem is that I am using the equation (and eqnarray) environments,
>>> to get the formulas numbered.
>>>
>>> Do you know if there is a way to make that work there too?
>>> Thank you
>>>
>>> On Fri, Apr 26, 2019 at 1:45 AM John MacFarlane <...> wrote:
>>>
>>>>
>>>> Works fine for me (pandoc 2.7.2):
>>>>
>>>>  % pandoc -t html
>>>> \newcommand{\exi}[1]{#1^{(i)}}
>>>> \newcommand{\ex}[2]{#1^{(#2)}}
>>>> \newcommand{\yhat}{\hat{y}}
>>>>
>>>> $\exi{x}$
>>>>
>>>> $\ex{1}{2}$
>>>>
>>>> $\yhat$
>>>> ^D
>>>> <p><span class="math
>>>> inline"><em>x</em><sup>(<em>i</em>)</sup></span></p>
>>>> <p><span class="math inline">1<sup>(2)</sup></span></p>
>>>> <p><span class="math inline"><em>ŷ</em></span></p>
>>>>
>>>> Do you get different results with the same command?
>>>>
>>>>
>>>
>>> --
>>> Alberto Simões
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "pandoc-discuss" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>> To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/pandoc-discuss/03c33657-2843-46b2-a074-eca3173938cc%40googlegroups.com
>> <https://groups.google.com/d/msgid/pandoc-discuss/03c33657-2843-46b2-a074-eca3173938cc%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "pandoc-discuss" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/pandoc-discuss/RSuE59nEJ20/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pandoc-discuss/CADAJKhAMSptqwy2NGVufupe0G0YGnXd%3DqV%2Bjd1489XyxiH259g%40mail.gmail.com
> <https://groups.google.com/d/msgid/pandoc-discuss/CADAJKhAMSptqwy2NGVufupe0G0YGnXd%3DqV%2Bjd1489XyxiH259g%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Alberto Simões

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CAAkRyrvQhwTopTwh85Zz18meyUgAeQBX2DiAVk8NGCqrtB1Jnw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #2: Type: text/html, Size: 8266 bytes --]

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

end of thread, other threads:[~2019-04-30 14:15 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-21 20:27 LaTeX Macros from External File Alberto Simoes
     [not found] ` <f2870a3c-cdc1-4ede-bb88-8875a94537ab-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2019-04-22 13:22   ` BPJ
     [not found]     ` <CADAJKhDvc-WkrgyqP=Ahoz1YgVZLEGnw58Fya6mW=fgw13mfkA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-04-22 15:52       ` John MacFarlane
2019-04-25 19:33       ` Alberto Simoes
     [not found]         ` <70bd63af-7ad0-4c24-8531-a0c3ac418ff1-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2019-04-25 20:02           ` Alberto Simoes
     [not found]             ` <2572e66c-d943-4899-98c7-90fbed4b7aaa-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2019-04-25 20:41               ` Alberto Simoes
2019-04-26  0:45               ` John MacFarlane
     [not found]                 ` <m236m5y4qa.fsf-Kg0TIO5PyJpkhmErBYysHMpsVdM05VCzQjotyikrkNS67hWjmhPcHA/vqy67L5BpjQwYZcTdm+3YtjvyW6yDsg==@public.gmane.org>
2019-04-26  8:44                   ` Alberto Simões
     [not found]                     ` <CAAkRyrt80T0O-bCBGirQwAUM5oA_Ooxpg=41Jp9NyKNrkQ8vTg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-04-28 20:05                       ` Alberto Simoes
     [not found]                         ` <03c33657-2843-46b2-a074-eca3173938cc-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2019-04-29 18:55                           ` BPJ
     [not found]                             ` <CADAJKhAMSptqwy2NGVufupe0G0YGnXd=qV+jd1489XyxiH259g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-04-30 14:15                               ` Alberto Simões

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 NNTP newsgroup(s).