From: mr vicky <v.lonly007-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: pandoc-discuss <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Subject: Re: tagging codes detecting
Date: Sat, 12 Feb 2022 03:08:39 -0800 (PST) [thread overview]
Message-ID: <2c88932a-2358-4cbb-af16-aa6a4dc025c3n@googlegroups.com> (raw)
In-Reply-To: <CADAJKhAPXai=vE-4iUYd6eWa01+PXcc7er7aPuE-szhziJzkqQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
[-- Attachment #1.1: Type: text/plain, Size: 10824 bytes --]
@BP
so i have to create .lua file with this code and point out lua file in
command line ?
by the way i used --webtex in command and its convert epub without any
error but i dont know for what purpose pandoc using --webtex command
may be it is ignoring those type characters or may be i am wrong about that
On Saturday, February 12, 2022 at 3:27:48 PM UTC+5 BP wrote:
> This is probably because Pandoc expects text between dollar signs `$...$`
> and
> `$$...$$` to be TeX math and fails to interpret some text which ended up
> between two dollar signs as such.
>
> <https://pandoc.org/MANUAL.html#extension-tex_math_dollars>
>
> Alternatively it may be that pandoc expects text between backslash escaped
> parentheses `\(...\)`/`\\(...\\)` or square brackets `\[...\]`/`\\[...\']`
> to be
> TeX math, but I believe those extensions are not enabled by default.
>
> <https://pandoc.org/MANUAL.html#extension-tex_math_single_backslash>
>
> <https://pandoc.org/MANUAL.html#extension-tex_math_double_backslash>
>
> In this case the solution, unless you intended to include TeX math
> somewhere
> in your document, is to disable those extensions by including
>
> -f
> markdown-tex_math_dollars-tex_math_single_backslash-tex_math_double_backslash
>
> in your pandoc command line, or modifying any existing --from, -f,
> --read or -r option accordingly.
>
> Yet another alternative may be that you have TeX code in your document
> which
> needs to be marked as code. For that a slightly modified filter provides a
> solution:
>
> local format2class = {
> html = 'html',
> tex = 'latex',
> latex = 'latex'
> }
> local code_for = {
> RawInline = pandoc.Code,
> RawBlock = pandoc.CodeBlock
> }
> local function raw2code (elem)
> local class = format2class[elem.format]
> if class then
> return code_for[elem.tag](elem.text, { class = class })
> end
> return nil
> end
> return {
> {
> RawInline = raw2code,
> RawBlock = raw2code
> }
> }
>
> Den lör 12 feb. 2022 07:54mr vicky <v.lon...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> skrev:
>
>> @BP
>> i am getting this error but its giving only in this book not in other
>> book evan i am using your raw2code.lua file in my command and its working
>> fine in other book but in this book still getting some tags error
>> here you can check
>>
>> pandoc -o Functional_Programming_in_C__Second_Edition.epub
>> Functional_Programming_in_C__Second_Edition.md --lua-filter=raw2code.lua
>> [WARNING] Could not convert TeX math "Entering {op}");       T t =
>> f();       log.LogTrace(, rendering as TeX:
>> "Entering {op}");       T t = f();      
>> ^
>> unexpected '"'
>> expecting "%", "\\label", "\\tag", "\\nonumber", whitespace,
>> "\\bangle", "\\brace", "\\brack", "\\choose", "\\displaystyle",
>> "\\textstyle", "\\scriptstyle", "\\scriptscriptstyle", "{",
>> "\\operatorname", letter, digit, ".", "!", "'", "''", "'''", "''''", "*",
>> "+", ",", "-", ".", "/", ":", ":=", ";", "<", "=", ">", "?", "@", "~", "_",
>> "^", "\\left", "\\", "\\hyperref" or end of input
>> [WARNING] Could not convert TeX math "{s} should be lower case");
>> Validator<string> ShouldBeOfLength(int n)   => s => (s.Length == n)    
>>   ? Valid(s)       : Error(, rendering as TeX:
>> "{s} should be lower case"); Validator<s
>> ^
>> unexpected '"'
>> expecting "%", "\\label", "\\tag", "\\nonumber", whitespace,
>> "\\bangle", "\\brace", "\\brack", "\\choose", "\\displaystyle",
>> "\\textstyle", "\\scriptstyle", "\\scriptscriptstyle", "{",
>> "\\operatorname", letter, digit, ".", "!", "'", "''", "'''", "''''", "*",
>> "+", ",", "-", ".", "/", ":", ":=", ";", "<", "=", ">", "?", "@", "~", "_",
>> "^", "\\left", "\\", "\\hyperref" or end of input
>> [WARNING] Could not convert TeX math "{name} -> {t}"),       onError:
>> ex => WriteLine(, rendering as TeX:
>> "{name} -> {t}"),       onError: ex => W
>> ^
>> unexpected '"'
>> expecting "%", "\\label", "\\tag", "\\nonumber", whitespace,
>> "\\bangle", "\\brace", "\\brack", "\\choose", "\\displaystyle",
>> "\\textstyle", "\\scriptstyle", "\\scriptscriptstyle", "{",
>> "\\operatorname", letter, digit, ".", "!", "'", "''", "'''", "''''", "*",
>> "+", ",", "-", ".", "/", ":", ":=", ";", "<", "=", ">", "?", "@", "~", "_",
>> "^", "\\left", "\\", "\\hyperref" or end of input
>> [WARNING] Could not convert TeX math "Received '{msg}'; Sending 'PING'");
>>   Task.Delay(500).Wait();   pong.Tell("PING"); }); pong = Agent.Start(0,
>> (int count, string msg) => {   int newCount = count + 1;   string nextMsg
>> = (newCount < 5) ? "PONG" : "STOP";   logger.Tell(, rendering as TeX:
>> "Received '{msg}'; Sending 'PING'");   T
>> ^
>> unexpected '"'
>> expecting "%", "\\label", "\\tag", "\\nonumber", whitespace,
>> "\\bangle", "\\brace", "\\brack", "\\choose", "\\displaystyle",
>> "\\textstyle", "\\scriptstyle", "\\scriptscriptstyle", "{",
>> "\\operatorname", letter, digit, ".", "!", "'", "''", "'''", "''''", "*",
>> "+", ",", "-", ".", "/", ":", ":=", ";", "<", "=", ">", "?", "@", "~", "_",
>> "^", "\\left", "\\", "\\hyperref" or end of input
>> [WARNING] This document format requires a nonempty <title> element.
>> Defaulting to 'Functional_Programming_in_C__Second_Edition' as the
>> title.
>> To specify a title, use 'title' in metadata or --metadata title="...".
>> PS C:\Users\Hp\Downloads\Compressed
>>
>> On Friday, February 11, 2022 at 1:06:13 AM UTC+5 BP wrote:
>>
>>> This filter will convert all raw HTML to code in backticks, with syntax
>>> highlighting. Save it as raw2code.lua and include --lua-filter=raw2code.lua
>>> on the pandoc command line.
>>>
>>> local code_for = {
>>> RawInline = pandoc.Code,
>>> RawBlock = pandoc.CodeBlock
>>> }
>>> local function raw2code (elem)
>>> if 'html' == elem.format then
>>> return code_for[elem.tag](elem.text, { class = 'html' })
>>> end
>>> return nil
>>> end
>>> return {
>>> {
>>> RawInline = raw2code,
>>> RawBlock = raw2code
>>> }
>>> }
>>>
>>>
>>>
>>>
>>>
>>>
>>> Den tors 10 feb. 2022 14:24William Lupton <wlu...-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org>
>>> skrev:
>>>
>>>> If you simply want to ignore all raw HTML elements then I think that a
>>>> lua filter that ignores all RawInlines (perhaps only those with
>>>> format="html") will work for you. But if some HTML elements need to retain
>>>> their HTML meaning then more logic will be needed. For example, this
>>>> document:
>>>>
>>>> % cat raw.md
>>>> This is <b>bold</b> text.
>>>>
>>>> gives this HTML:
>>>>
>>>> % pandoc raw.md
>>>> <p>This is <b>bold</b> text.</p>
>>>>
>>>> ...but with this filter:
>>>>
>>>> % cat raw.lua
>>>> function RawInline(raw)
>>>> if (raw.format == 'html') then
>>>> return {}
>>>> end
>>>> end
>>>>
>>>> ...it gives this:
>>>>
>>>> % pandoc raw.md -L raw.lua
>>>> <p>This is bold text.</p>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> On Thu, 10 Feb 2022 at 12:49, mr vicky <v.lon...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>>>>
>>>>> so before convert to epub file i have to edit md file and find all
>>>>> tags and add these backticks ?
>>>>> there is no option in pandoc to ignore tags inside book ?
>>>>>
>>>>> On Thursday, February 10, 2022 at 5:37:27 PM UTC+5 Joost wrote:
>>>>>
>>>>>> On Thu, 10 Feb 2022, at 11:27, mr vicky wrote:
>>>>>> > hello
>>>>>> > i am converting md to epub file but that md file is programming
>>>>>> book
>>>>>> > where is some codes written inside but when i convert it to epub
>>>>>> then
>>>>>> > its auto detecting these tags and making very bad epub file with
>>>>>> page
>>>>>> > breaks and some other kind of coding elements
>>>>>> [...]
>>>>>> > there is any option to ignore programming codes while converting to
>>>>>> epub file ?
>>>>>>
>>>>>> Note that Markdown allows you to include HTML elements, so whenever
>>>>>> you write e.g. <h1> directly, Pandoc assums that's what you're doing and
>>>>>> will put an <h1> tag in the html (or epub) output.
>>>>>>
>>>>>> You'll want to mark the tags as code, which you can do with
>>>>>> backticks: `<h1>`.
>>>>>>
>>>>>> HTH
>>>>>>
>>>>>> --
>>>>>> Joost Kremers
>>>>>> Life has its moments
>>>>>>
>>>>> --
>>>>> 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-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>>>>> To view this discussion on the web visit
>>>>> https://groups.google.com/d/msgid/pandoc-discuss/3806ef68-3553-4e8e-8b04-bf7cc4226e7cn%40googlegroups.com
>>>>> <https://groups.google.com/d/msgid/pandoc-discuss/3806ef68-3553-4e8e-8b04-bf7cc4226e7cn%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-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>>>>
>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/pandoc-discuss/CAEe_xxjC3As4wO0e4uz6PtVzakK7jaC89rUKKb_BiUwHpbh%3D7Q%40mail.gmail.com
>>>> <https://groups.google.com/d/msgid/pandoc-discuss/CAEe_xxjC3As4wO0e4uz6PtVzakK7jaC89rUKKb_BiUwHpbh%3D7Q%40mail.gmail.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-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>>
> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/pandoc-discuss/ce37255c-e07f-4f47-958c-81069eb0b870n%40googlegroups.com
>> <https://groups.google.com/d/msgid/pandoc-discuss/ce37255c-e07f-4f47-958c-81069eb0b870n%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/2c88932a-2358-4cbb-af16-aa6a4dc025c3n%40googlegroups.com.
[-- Attachment #1.2: Type: text/html, Size: 18545 bytes --]
next prev parent reply other threads:[~2022-02-12 11:08 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-10 10:27 mr vicky
[not found] ` <0801754e-c412-4e23-89a0-6b7bad4fff64n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2022-02-10 12:37 ` Joost
[not found] ` <58f09215-7a45-4f1c-ae7b-f651faaed294-jFIJ+Wc5/Vo7lZ9V/NTDHw@public.gmane.org>
2022-02-10 12:49 ` mr vicky
[not found] ` <3806ef68-3553-4e8e-8b04-bf7cc4226e7cn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2022-02-10 13:23 ` William Lupton
[not found] ` <CAEe_xxjC3As4wO0e4uz6PtVzakK7jaC89rUKKb_BiUwHpbh=7Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2022-02-10 20:06 ` BPJ
[not found] ` <CADAJKhDhA7kP2JfM9tXDc=pmmjP7BA5dGgnVE2T=2b1dmF3MFw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2022-02-12 6:53 ` mr vicky
[not found] ` <ce37255c-e07f-4f47-958c-81069eb0b870n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2022-02-12 10:27 ` BPJ
[not found] ` <CADAJKhAPXai=vE-4iUYd6eWa01+PXcc7er7aPuE-szhziJzkqQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2022-02-12 11:08 ` mr vicky [this message]
[not found] ` <2c88932a-2358-4cbb-af16-aa6a4dc025c3n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2022-02-12 11:48 ` BPJ
[not found] ` <CADAJKhB-n2j6NC2Ysu8bbw6464PNnyXhDqCmu8GTqz1yr0gkUg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2022-02-12 12:52 ` mr vicky
[not found] ` <6d897324-3d5d-426a-93a3-80140989c6acn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2022-02-12 16:54 ` BPJ
[not found] ` <CADAJKhCKx_eaQ-b-PQf5NC9xQtU6c+k+qGcNGZMK5HP7nq9CHg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2022-02-16 11:17 ` mr vicky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2c88932a-2358-4cbb-af16-aa6a4dc025c3n@googlegroups.com \
--to=v.lonly007-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).