public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* Unable to use longdivision package with LaTeX
@ 2023-12-09 15:39 R (Chandra) Chandrasekhar
       [not found] ` <d9e637b2-06d5-4085-9b56-4ba80c9a0299-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: R (Chandra) Chandrasekhar @ 2023-12-09 15:39 UTC (permalink / raw)
  To: pandoc-discuss

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

Dear Folks,

The .tex file below compiles with lualatex without murmur:

---
\documentclass{article}
\usepackage{longdivision}
\begin{document}
\longdivision{516}{27}
\end{document}
---

and the result is attached as longdivision.png.

However, when I compile the equivalent markdown file, md-ld.md,

===
---
title: "Test of long division"
date: 2023-12-09
header-includes:
   - \usepackage{longdivision}
---

This is a test of long division.

$$
\longdivision{516}{27}
$$
===

using

pandoc --from markdown --to latex --pdf-engine lualatex --standalone 
--output md-ld.pdf md-ld.md

I get the error message

---
Error producing PDF.
! LaTeX cmd Error: Command '\longdivision' already defined.

For immediate help type H <return>.
  ...

l.192 }
---

If I leave out the longdivision package, and use the same command line, 
it compiles, but the output of the long division is not correct and is 
shown in the image pdf-from-pandoc.png.

Can someone please tell me which package is "already defining" the 
\longdivision command, and also how I might get the desired result from 
the .md file?

Thanks.

Chandra
2023-12-09

-- 
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/d9e637b2-06d5-4085-9b56-4ba80c9a0299%40gmail.com.

[-- Attachment #2: longdivision.png --]
[-- Type: image/png, Size: 6810 bytes --]

[-- Attachment #3: pdf-from-pandoc.png --]
[-- Type: image/png, Size: 1587 bytes --]

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

* Re: Unable to use longdivision package with LaTeX
       [not found] ` <d9e637b2-06d5-4085-9b56-4ba80c9a0299-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2023-12-09 19:55   ` Bastien DUMONT
  2023-12-10  5:31     ` R (Chandra) Chandrasekhar
  0 siblings, 1 reply; 3+ messages in thread
From: Bastien DUMONT @ 2023-12-09 19:55 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

You can answer your question by searching for files containing "\longdivision" in your TeX installation (the texmf/ or texmf-dist/ directory). In this case, the package "unicode-math" already defines \longdivision as a long division rule (the Unicode x027CC character, if I understand well).

The long-term solution would be to ask the developpers of longdivision to provide an alias when the macro is already defined. For now, one possible workaround is to place a copy of longdivision.sty in the same folder as the MD file and to replace \longdivision with e.g. \mylongdivision in the following line:

\NewDocumentCommand \longdivision { omm } {

Then, you will be able to use \mylongdivision in your document instead of \longdivision.

Of course, you can also remove \usepackage{unicode-math} from your template if you are sure that you don't need it.

Le Saturday 09 December 2023 à 09:09:50PM, R (Chandra) Chandrasekhar a écrit :
> Dear Folks,
> 
> The .tex file below compiles with lualatex without murmur:
> 
> ---
> \documentclass{article}
> \usepackage{longdivision}
> \begin{document}
> \longdivision{516}{27}
> \end{document}
> ---
> 
> and the result is attached as longdivision.png.
> 
> However, when I compile the equivalent markdown file, md-ld.md,
> 
> ===
> ---
> title: "Test of long division"
> date: 2023-12-09
> header-includes:
>   - \usepackage{longdivision}
> ---
> 
> This is a test of long division.
> 
> $$
> \longdivision{516}{27}
> $$
> ===
> 
> using
> 
> pandoc --from markdown --to latex --pdf-engine lualatex --standalone
> --output md-ld.pdf md-ld.md
> 
> I get the error message
> 
> ---
> Error producing PDF.
> ! LaTeX cmd Error: Command '\longdivision' already defined.
> 
> For immediate help type H <return>.
>  ...
> 
> l.192 }
> ---
> 
> If I leave out the longdivision package, and use the same command line, it
> compiles, but the output of the long division is not correct and is shown in
> the image pdf-from-pandoc.png.
> 
> Can someone please tell me which package is "already defining" the
> \longdivision command, and also how I might get the desired result from the
> .md file?
> 
> Thanks.
> 
> Chandra
> 2023-12-09
> 
> -- 
> 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/d9e637b2-06d5-4085-9b56-4ba80c9a0299%40gmail.com.



-- 
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/ZXTGM7kGnjzIksH2%40localhost.


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

* Re: Unable to use longdivision package with LaTeX
  2023-12-09 19:55   ` Bastien DUMONT
@ 2023-12-10  5:31     ` R (Chandra) Chandrasekhar
  0 siblings, 0 replies; 3+ messages in thread
From: R (Chandra) Chandrasekhar @ 2023-12-10  5:31 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

Thanks for that.

I have now found out that if longdivision is invoked _before_ 
unicode-math, there is no error or warning, but the result is wrong.

I have written to the package author describing the behaviour and 
requesting a resolution.

Chandra

On 10/12/2023 01:25, Bastien DUMONT wrote:
> You can answer your question by searching for files containing "\longdivision" in your TeX installation (the texmf/ or texmf-dist/ directory). In this case, the package "unicode-math" already defines \longdivision as a long division rule (the Unicode x027CC character, if I understand well).
> 
> The long-term solution would be to ask the developpers of longdivision to provide an alias when the macro is already defined. For now, one possible workaround is to place a copy of longdivision.sty in the same folder as the MD file and to replace \longdivision with e.g. \mylongdivision in the following line:
> 
> \NewDocumentCommand \longdivision { omm } {
> 
> Then, you will be able to use \mylongdivision in your document instead of \longdivision.
> 
> Of course, you can also remove \usepackage{unicode-math} from your template if you are sure that you don't need it.
> 
> Le Saturday 09 December 2023 à 09:09:50PM, R (Chandra) Chandrasekhar a écrit :
>> Dear Folks,
>>
>> The .tex file below compiles with lualatex without murmur:
>>
>> ---
>> \documentclass{article}
>> \usepackage{longdivision}
>> \begin{document}
>> \longdivision{516}{27}
>> \end{document}
>> ---
>>
>> and the result is attached as longdivision.png.
>>
>> However, when I compile the equivalent markdown file, md-ld.md,
>>
>> ===
>> ---
>> title: "Test of long division"
>> date: 2023-12-09
>> header-includes:
>>    - \usepackage{longdivision}
>> ---
>>
>> This is a test of long division.
>>
>> $$
>> \longdivision{516}{27}
>> $$
>> ===
>>
>> using
>>
>> pandoc --from markdown --to latex --pdf-engine lualatex --standalone
>> --output md-ld.pdf md-ld.md
>>
>> I get the error message
>>
>> ---
>> Error producing PDF.
>> ! LaTeX cmd Error: Command '\longdivision' already defined.
>>
>> For immediate help type H <return>.
>>   ...
>>
>> l.192 }
>> ---
>>
>> If I leave out the longdivision package, and use the same command line, it
>> compiles, but the output of the long division is not correct and is shown in
>> the image pdf-from-pandoc.png.
>>
>> Can someone please tell me which package is "already defining" the
>> \longdivision command, and also how I might get the desired result from the
>> .md file?
>>
>> Thanks.
>>
>> Chandra
>> 2023-12-09
>>
>> -- 
>> 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/d9e637b2-06d5-4085-9b56-4ba80c9a0299%40gmail.com.
> 
> 
> 

-- 
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/39fa8da1-3566-4950-b505-8ae1b8ef235a%40gmail.com.


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

end of thread, other threads:[~2023-12-10  5:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-09 15:39 Unable to use longdivision package with LaTeX R (Chandra) Chandrasekhar
     [not found] ` <d9e637b2-06d5-4085-9b56-4ba80c9a0299-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2023-12-09 19:55   ` Bastien DUMONT
2023-12-10  5:31     ` R (Chandra) Chandrasekhar

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