* newcommand with optional argument @ 2019-08-02 20:27 Umut Acar [not found] ` <53d8f342-01c5-421c-854f-65685c34bfee-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> 0 siblings, 1 reply; 4+ messages in thread From: Umut Acar @ 2019-08-02 20:27 UTC (permalink / raw) To: pandoc-discuss [-- Attachment #1.1: Type: text/plain, Size: 707 bytes --] I am translating LaTeX to html and would like to be able to define a new command with an optional argument and use it. For example ``` \newcommand{\ittakestwo}[2][defaultone]{#2} ... \ittakestwo[to]{tango} will eval to "tango" ``` Is this possible? I wasn't able to make it work... -- Umut -- 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 view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/53d8f342-01c5-421c-854f-65685c34bfee%40googlegroups.com. [-- Attachment #1.2: Type: text/html, Size: 1144 bytes --] ^ permalink raw reply [flat|nested] 4+ messages in thread
[parent not found: <53d8f342-01c5-421c-854f-65685c34bfee-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>]
* Re: newcommand with optional argument [not found] ` <53d8f342-01c5-421c-854f-65685c34bfee-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> @ 2019-08-03 16:57 ` BP Jonsson 2019-08-05 4:11 ` John MacFarlane 1 sibling, 0 replies; 4+ messages in thread From: BP Jonsson @ 2019-08-03 16:57 UTC (permalink / raw) To: pandoc-discuss [-- Attachment #1: Type: text/plain, Size: 1549 bytes --] The syntax is `\newcommand{\commandname}[2][default value for optional argument]{definition}`. The default value may be empty, that is `[]`. Den fre 2 aug. 2019 22:27Umut Acar <umutacar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> skrev: > I am translating LaTeX to html and would like to be able to define a new > command with an optional argument and use it. For example > ``` > \newcommand{\ittakestwo}[2][defaultone]{#2} > > ... > > \ittakestwo[to]{tango} will eval to "tango" > ``` > Is this possible? I wasn't able to make it work... > > -- Umut > > -- > 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 view this discussion on the web visit > https://groups.google.com/d/msgid/pandoc-discuss/53d8f342-01c5-421c-854f-65685c34bfee%40googlegroups.com > <https://groups.google.com/d/msgid/pandoc-discuss/53d8f342-01c5-421c-854f-65685c34bfee%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- 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 view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CAFC_yuTpBMuXhhy1z1AqA91MFDX7BEfqY-_juiLN49votV0Yxw%40mail.gmail.com. [-- Attachment #2: Type: text/html, Size: 2422 bytes --] ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: newcommand with optional argument [not found] ` <53d8f342-01c5-421c-854f-65685c34bfee-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> 2019-08-03 16:57 ` BP Jonsson @ 2019-08-05 4:11 ` John MacFarlane [not found] ` <m2v9vcgsje.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org> 1 sibling, 1 reply; 4+ messages in thread From: John MacFarlane @ 2019-08-05 4:11 UTC (permalink / raw) To: Umut Acar, pandoc-discuss This looks like a bug to me. Pandoc should be able to handle this sort of \newcommand. Can you submit a bug report on our GitHub tracker, with a simple test case and the expected output? Umut Acar <umutacar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes: > I am translating LaTeX to html and would like to be able to define a new > command with an optional argument and use it. For example > ``` > \newcommand{\ittakestwo}[2][defaultone]{#2} > > ... > > \ittakestwo[to]{tango} will eval to "tango" > ``` > Is this possible? I wasn't able to make it work... > > -- Umut ^ permalink raw reply [flat|nested] 4+ messages in thread
[parent not found: <m2v9vcgsje.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>]
* Re: newcommand with optional argument [not found] ` <m2v9vcgsje.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org> @ 2019-08-10 7:19 ` Umut Acar 0 siblings, 0 replies; 4+ messages in thread From: Umut Acar @ 2019-08-10 7:19 UTC (permalink / raw) To: pandoc-discuss [-- Attachment #1.1: Type: text/plain, Size: 1155 bytes --] Just did. Thank you! On Monday, August 5, 2019 at 7:12:03 AM UTC+3, John MacFarlane wrote: > > > This looks like a bug to me. Pandoc should be able to > handle this sort of \newcommand. Can you submit a bug > report on our GitHub tracker, with a simple test case > and the expected output? > > Umut Acar <umut...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org <javascript:>> writes: > > > I am translating LaTeX to html and would like to be able to define a new > > command with an optional argument and use it. For example > > ``` > > \newcommand{\ittakestwo}[2][defaultone]{#2} > > > > ... > > > > \ittakestwo[to]{tango} will eval to "tango" > > ``` > > Is this possible? I wasn't able to make it work... > > > > -- Umut > > -- 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 view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/03b34772-cdf3-4131-a67b-9c045447e0cc%40googlegroups.com. [-- Attachment #1.2: Type: text/html, Size: 1912 bytes --] ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-08-10 7:19 UTC | newest] Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2019-08-02 20:27 newcommand with optional argument Umut Acar [not found] ` <53d8f342-01c5-421c-854f-65685c34bfee-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> 2019-08-03 16:57 ` BP Jonsson 2019-08-05 4:11 ` John MacFarlane [not found] ` <m2v9vcgsje.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org> 2019-08-10 7:19 ` Umut Acar
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).