From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/31667 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Jan_St=C3=BChler?= Newsgroups: gmane.text.pandoc Subject: Re: Image references in a column break after one character Date: Sat, 29 Oct 2022 14:40:15 -0700 (PDT) Message-ID: References: <22b620a8-4869-4cd8-b040-a4c55d0ae521n@googlegroups.com> <9B3E6EF5-B9D2-47AF-BF28-DC2F06E54D55@gmail.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_12639_1635967037.1667079615927" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38686"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBDXJPMHQZ4FRBQN362NAMGQEU33L2LI-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Sat Oct 29 23:40:21 2022 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-ot1-f58.google.com ([209.85.210.58]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1ootYy-0009uZ-NW for gtp-pandoc-discuss@m.gmane-mx.org; Sat, 29 Oct 2022 23:40:20 +0200 Original-Received: by mail-ot1-f58.google.com with SMTP id cy25-20020a056830699900b00661acac3847sf4386170otb.17 for ; Sat, 29 Oct 2022 14:40:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:x-original-sender :mime-version:subject:references:in-reply-to:message-id:to:from:date :sender:from:to:cc:subject:date:message-id:reply-to; bh=lk5oirDoHesBUDs+v+psTEzyFlwuY+KIx7B77IhvLLo=; b=L/j5lFQPaG/ekMhXkzeI3TlU9MNtkQvrH9ey4MC5szezOkCRhXFOOQ7OnfqYXMzvIR Y6ssS5JAVkFeO3pUvGVz3+hsMbfhhGJpmMtYVPH98GybZWzS/y/QVVpa8dqrAoZNnP/C BrZs9cBoZ4u6dSLACBnoTmvvXW36LfJa1aJ821FFeMFyJrahg5Om0SzvZh3NXikNMimk ky3/+xx03BbF7IO3qtrbahKDLZBw9hipgv3yw5XA+B9ZoIL8DS85BvUFE3N/TPv7KJQ4 PFmnblITxfuOf/LBhlGNksVFNZjyzN/F82msXb3jmjhGMezPFjVa+D994jdHEO1g4bP5 2xJw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:x-original-sender :mime-version:subject:references:in-reply-to:message-id:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=lk5oirDoHesBUDs+v+psTEzyFlwuY+KIx7B77IhvLLo=; b=c3eeYR+0loQQ/PhZQtp58l8FAL8ZXfjCE1XBW13gwRuUFQCeRIRLcy9Wok7PV4hF8a 1S4cYmJBbwz/pL0W9YmXgd3klvh1EWJyhrRTF3dUEBN8HJCGFkYGl0PiBKZCh6YUX829 nkW5iZTHTOij7zeDXZxhsUJed0uqhwmxuJrmmaHNCK5/fkKwhP6IGDAknI5DvcDcxDuM aG75t83Ln7Of4yhvHzrOAORcfoJAtssM8ljHKGHQRAPzyN9rRyGe7wWLXxAwLzAh+4MU E0r5bAkOUMv6jy6f+5TrJ5C4Y36uADKDvLAdH/8OXKU2H5tUgVPUeMfnEBS999Gv24rH j0Uw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence:reply-to :x-original-sender:mime-version:subject:references:in-reply-to :message-id:to:from:date:x-gm-message-state:sender:from:to:cc :subject:date:message-id:reply-to; bh=lk5oirDoHesBUDs+v+psTEzyFlwuY+KIx7B77IhvLLo=; b=UDWNvjs6NssCLzSQiIoDufJl1EkxK/HlXux4epbDLYlegXRndWT+tQdUBvgmjSbqKK rjR7lvARGJUmg2KJ8eMN8GKI8ePL2N0V0Yxz4gq02P7ixaxzWaiF1GW9YDJe2hiryD+1 WzhZUhk9WSEFAbcsC0f5UCET1qHe6XnnAcs+Zj80sKZzYy+Ek0nP3GGM2c/2pggYj4jt RWMDffrEdbkhZ8KjG0r+W9XB4uWgA/w+i3YlEFJAUILmMlBlW0J0VGZdALz1N5VRltug XaOfETuPDquLjuZIvbEBQP8a5eBQeHLS+t4GwiMhadASEqhzr8lzxLX+Hp2IDS3tcfna nFaw== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: ACrzQf3r+MfnSX2Y6e2rFk+DmYAceB3mqjfQG/g0ImYkRUZxQDIl6ffT 7o673BuQ09nkcAvetLnX0rs= X-Google-Smtp-Source: AMsMyM7v3AZwcly4iIHhMk317uT2BYKNJckciRySwyCuvMAkah2WXp5ud5RcTkETVcyETMqfwQLOow== X-Received: by 2002:a05:6830:6384:b0:661:bee5:73ce with SMTP id ch4-20020a056830638400b00661bee573cemr2896282otb.343.1667079619625; Sat, 29 Oct 2022 14:40:19 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:6830:3687:b0:61c:e180:124e with SMTP id bk7-20020a056830368700b0061ce180124els1050278otb.7.-pod-prod-gmail; Sat, 29 Oct 2022 14:40:17 -0700 (PDT) X-Received: by 2002:a05:6830:2f9:b0:661:9e22:58f9 with SMTP id r25-20020a05683002f900b006619e2258f9mr2799720ote.350.1667079616797; Sat, 29 Oct 2022 14:40:16 -0700 (PDT) In-Reply-To: <9B3E6EF5-B9D2-47AF-BF28-DC2F06E54D55-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> X-Original-Sender: jan.stuehler-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org Precedence: list Mailing-list: list pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org; contact pandoc-discuss+owners-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org List-ID: X-Google-Group-Id: 1007024079513 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Xref: news.gmane.io gmane.text.pandoc:31667 Archived-At: ------=_Part_12639_1635967037.1667079615927 Content-Type: multipart/alternative; boundary="----=_Part_12640_122951610.1667079615927" ------=_Part_12640_122951610.1667079615927 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thank you very much, fiddlosopher. I'll try with a lua filter which sets=20 all column width to an equal size: ```lua function myfunction(el) -- divide 1 by number of columns -- subtract some spacing equalwidth =3D (1 / #el.colspecs) - 0.01 -- print(equalwidth) -- walk through colspecs for idx, _ in ipairs(el.colspecs) do -- set width per column table.insert(el.colspecs[idx], equalwidth) end -- return Table element return el end return {{ Table =3D myfunction }} ``` fiddlosopher schrieb am Montag, 24. Oktober 2022 um 06:12:47 UTC+2: > Pandoc tries to preserve the relative column widths in the original table= .=20 > If you have table with a very narrow second column, pandoc will reproduce= =20 > that in a grid table (since the colmun widths in this format matter). > > One possible workaround would be to use a Lua filter to adjsut the column= =20 > widths of Table elements after they are parsed. > > Another would be to alter the column widths of the source table. > > > > > On Oct 23, 2022, at 3:25 AM, Jan St=C3=BChler wro= te: > >=20 > > Hello group. > >=20 > > I have been using > > ``` > > pandoc --reference-links --extract-media=3Ddir -o file.md file.docx > > ``` > > on a set of documents, each of those documents has many tables.=20 > Especially those tables which have "only" images in the right column,=20 > pandoc will break the image reference after one character. The image=20 > references can therefore not be found when converting the document back t= o=20 > docx. > >=20 > > ``` > > +------------------------+---+-----------------------------------------= -+ > >=20 > > | If the Home Screen is | ! | | > >=20 > > | locked, the | [ | | > >=20 > > | Examination button is | ] | | > >=20 > > | dimmed. Please first | [ | | > >=20 > > | click on Unlock and | 4 | | > >=20 > > | then click on | 8 | | > >=20 > > | Examination, | ] | | > >=20 > > +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D+=3D=3D=3D+=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D+ > >=20 > > ``` > > I do not have that problem when passing `--wrap=3Dnone` to markdown, bu= t=20 > then all the lines in vim are unmanageably long. > >=20 > > `wrap=3Dpreserver|auto|none` with or without `--columns=3Dx` does not= =20 > resolve the one-character breaking issue. > >=20 > > Also, converting to `-t gfm` first and then converting `-f gfm -t=20 > markdown` still creates one-character line breaks. > >=20 > > Is there any way to define a minimum column width? > >=20 > > --=20 > > You received this message because you are subscribed to the Google=20 > Groups "pandoc-discuss" group. > > To unsubscribe from this group and stop receiving emails from it, send= =20 > an email to pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To view this discussion on the web visit=20 > https://groups.google.com/d/msgid/pandoc-discuss/22b620a8-4869-4cd8-b040-= a4c55d0ae521n%40googlegroups.com > . > > --=20 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 e= mail 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/ae1809d9-1873-4a18-abcd-8e76a7f38bf9n%40googlegroups.com. ------=_Part_12640_122951610.1667079615927 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thank you very much, fiddlosopher. I'll try with a lua filter which se= ts all column width to an equal size:
```lua
function myfunction(el)
    --= divide 1 by number of columns
    -- subtract some spacing    equalwidth =3D (1 / #el.colspecs) - 0.01
    --= print(equalwidth)
    -- walk through colspecs
  &nbs= p; for idx, _ in ipairs(el.colspecs) do
        -- s= et width per column
        table.insert(el.colspecs= [idx], equalwidth)
    end
    -- return Table el= ement
    return el
end

return {{ Table =3D myfuncti= on }}
```

fiddlosopher schrieb am Montag, 24. Oktober = 2022 um 06:12:47 UTC+2:
Pandoc tries to preserve the relative column widths in the ori= ginal table. If you have table with a very narrow second column, pandoc w= ill reproduce that in a grid table (since the colmun widths in this format = matter).

One possible workaround would be to use a Lua filter to adjsut the colu= mn widths of Table elements after they are parsed.

Another would be to alter the column widths of the source table.



> On Oct 23, 2022, at 3:25 AM, Jan St=C3=BChler <jan.st...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>=20
> Hello group.
>=20
> I have been using
> ```
> pandoc --reference-links --extract-media=3Ddir -o file.md file.doc= x
> ```
> on a set of documents, each of those documents has many tables. Es= pecially those tables which have "only" images in the right colum= n, pandoc will break the image reference after one character. The image re= ferences can therefore not be found when converting the document back to do= cx.
>=20
> ```
> +------------------------+---+------------------------------------= ------+
>=20
> | If the Home Screen is | ! | = |
>=20
> | locked, the | [ | = |
>=20
> | Examination button is | ] | = |
>=20
> | dimmed. Please first | [ | = |
>=20
> | click on Unlock and | 4 | = |
>=20
> | then click on | 8 | = |
>=20
> | Examination, | ] | = |
>=20
> +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D+=3D=3D=3D+=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D+
>=20
> ```
> I do not have that problem when passing `--wrap=3Dnone` to markdow= n, but then all the lines in vim are unmanageably long.
>=20
> `wrap=3Dpreserver|auto|none` with or without `--columns=3Dx` does= not resolve the one-character breaking issue.
>=20
> Also, converting to `-t gfm` first and then converting `-f gfm -t = markdown` still creates one-character line breaks.
>=20
> Is there any way to define a minimum column width?
>=20
> --=20
> 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..= .@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/22b620a8-4= 869-4cd8-b040-a4c55d0ae521n%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups &= quot;pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to pand= oc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d= /msgid/pandoc-discuss/ae1809d9-1873-4a18-abcd-8e76a7f38bf9n%40googlegroups.= com.
------=_Part_12640_122951610.1667079615927-- ------=_Part_12639_1635967037.1667079615927--