* any way to set max size of images when converting to pdf
@ 2022-02-02 21:18 koi
[not found] ` <d2c311eb-430f-46a3-a332-0e8ff3bef555n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
0 siblings, 1 reply; 8+ messages in thread
From: koi @ 2022-02-02 21:18 UTC (permalink / raw)
To: pandoc-discuss
[-- Attachment #1.1: Type: text/plain, Size: 786 bytes --]
i generally convert md to pdf and add screenshots to md files which comes
out to be soo big in rendered pdf is there any way or hack so that i could
specify some thing in header.tex file etc so that sizes of all images get
limited by a specified limit
yes i know about ![](img.png){width=50%) thing but it is not desireable as
it cause issues with other markdown viewers
--
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/d2c311eb-430f-46a3-a332-0e8ff3bef555n%40googlegroups.com.
[-- Attachment #1.2: Type: text/html, Size: 1092 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: any way to set max size of images when converting to pdf
[not found] ` <d2c311eb-430f-46a3-a332-0e8ff3bef555n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2022-02-03 0:33 ` John MacFarlane
[not found] ` <yh480k1r0kn60g.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
0 siblings, 1 reply; 8+ messages in thread
From: John MacFarlane @ 2022-02-03 0:33 UTC (permalink / raw)
To: koi, pandoc-discuss
The default LaTeX template already contains this code
which limits images to page width:
% Scale images if necessary, so that they will not overflow the page
% margins by default, and it is still possible to overwrite the defaults
% using explicit options in \includegraphics[width, height, ...]{}
\setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}
You could perhaps use this approach with, say, 3in instead of
\maxwidth?
koi <aneeqasifscent-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:
> i generally convert md to pdf and add screenshots to md files which comes
> out to be soo big in rendered pdf is there any way or hack so that i could
> specify some thing in header.tex file etc so that sizes of all images get
> limited by a specified limit
> yes i know about ![](img.png){width=50%) thing but it is not desireable as
> it cause issues with other markdown viewers
>
> --
> 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/d2c311eb-430f-46a3-a332-0e8ff3bef555n%40googlegroups.com.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: any way to set max size of images when converting to pdf
[not found] ` <yh480k1r0kn60g.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
@ 2022-02-03 8:18 ` koi
[not found] ` <b3f61f7b-d308-44c1-aac4-723ae6e1e636n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2022-02-03 8:37 ` koi
2022-02-03 8:48 ` koi
2 siblings, 1 reply; 8+ messages in thread
From: koi @ 2022-02-03 8:18 UTC (permalink / raw)
To: pandoc-discuss
[-- Attachment #1.1: Type: text/plain, Size: 2173 bytes --]
thanks Jhon for kind help
I tried this but i am getting following error
*command*: pandoc -H head.tex -s --toc -V geometry:"left=3cm, right=3cm"
Intro.md -o out.pdf
Error producing PDF.
! Undefined control sequence.
\Gin@@ewidth ->\1
00
l.97 ...926ccfb5cf22660c94dd1053318fe9b4f5ea7.png}
On Thursday, 3 February 2022 at 5:34:12 am UTC+5 John MacFarlane wrote:
>
> The default LaTeX template already contains this code
> which limits images to page width:
>
> % Scale images if necessary, so that they will not overflow the page
> % margins by default, and it is still possible to overwrite the defaults
> % using explicit options in \includegraphics[width, height, ...]{}
> \setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}
>
> You could perhaps use this approach with, say, 3in instead of
> \maxwidth?
>
> koi <aneeqas...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:
>
> > i generally convert md to pdf and add screenshots to md files which
> comes
> > out to be soo big in rendered pdf is there any way or hack so that i
> could
> > specify some thing in header.tex file etc so that sizes of all images
> get
> > limited by a specified limit
> > yes i know about ![](img.png){width=50%) thing but it is not desireable
> as
> > it cause issues with other markdown viewers
> >
> > --
> > 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/d2c311eb-430f-46a3-a332-0e8ff3bef555n%40googlegroups.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/b3f61f7b-d308-44c1-aac4-723ae6e1e636n%40googlegroups.com.
[-- Attachment #1.2: Type: text/html, Size: 3468 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: any way to set max size of images when converting to pdf
[not found] ` <yh480k1r0kn60g.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
2022-02-03 8:18 ` koi
@ 2022-02-03 8:37 ` koi
2022-02-03 8:48 ` koi
2 siblings, 0 replies; 8+ messages in thread
From: koi @ 2022-02-03 8:37 UTC (permalink / raw)
To: pandoc-discuss
[-- Attachment #1.1: Type: text/plain, Size: 1977 bytes --]
i am using
\setkeys{Gin}{width=\2in,height=\2in,keepaspectratio}
in heat.tex file and getting error as i mentioned
On Thursday, 3 February 2022 at 5:34:12 am UTC+5 John MacFarlane wrote:
>
> The default LaTeX template already contains this code
> which limits images to page width:
>
> % Scale images if necessary, so that they will not overflow the page
> % margins by default, and it is still possible to overwrite the defaults
> % using explicit options in \includegraphics[width, height, ...]{}
> \setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}
>
> You could perhaps use this approach with, say, 3in instead of
> \maxwidth?
>
> koi <aneeqas...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:
>
> > i generally convert md to pdf and add screenshots to md files which
> comes
> > out to be soo big in rendered pdf is there any way or hack so that i
> could
> > specify some thing in header.tex file etc so that sizes of all images
> get
> > limited by a specified limit
> > yes i know about ![](img.png){width=50%) thing but it is not desireable
> as
> > it cause issues with other markdown viewers
> >
> > --
> > 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/d2c311eb-430f-46a3-a332-0e8ff3bef555n%40googlegroups.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/b0b03dd3-23bd-4c10-9f7d-4b7e1268f675n%40googlegroups.com.
[-- Attachment #1.2: Type: text/html, Size: 3114 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: any way to set max size of images when converting to pdf
[not found] ` <yh480k1r0kn60g.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
2022-02-03 8:18 ` koi
2022-02-03 8:37 ` koi
@ 2022-02-03 8:48 ` koi
[not found] ` <ec1538e2-e3a0-42c0-80d8-85fd23d57ae8n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2 siblings, 1 reply; 8+ messages in thread
From: koi @ 2022-02-03 8:48 UTC (permalink / raw)
To: pandoc-discuss
[-- Attachment #1.1: Type: text/plain, Size: 2089 bytes --]
i just basically want to impliment this
![test image](test.jpg){width=90%} <-------
without doing this in markdown file but instead defining some settings in
some other file and using it with pandoc while compiling md to pdf
On Thursday, 3 February 2022 at 5:34:12 am UTC+5 John MacFarlane wrote:
>
> The default LaTeX template already contains this code
> which limits images to page width:
>
> % Scale images if necessary, so that they will not overflow the page
> % margins by default, and it is still possible to overwrite the defaults
> % using explicit options in \includegraphics[width, height, ...]{}
> \setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}
>
> You could perhaps use this approach with, say, 3in instead of
> \maxwidth?
>
> koi <aneeqas...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:
>
> > i generally convert md to pdf and add screenshots to md files which
> comes
> > out to be soo big in rendered pdf is there any way or hack so that i
> could
> > specify some thing in header.tex file etc so that sizes of all images
> get
> > limited by a specified limit
> > yes i know about ![](img.png){width=50%) thing but it is not desireable
> as
> > it cause issues with other markdown viewers
> >
> > --
> > 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/d2c311eb-430f-46a3-a332-0e8ff3bef555n%40googlegroups.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/ec1538e2-e3a0-42c0-80d8-85fd23d57ae8n%40googlegroups.com.
[-- Attachment #1.2: Type: text/html, Size: 3332 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: any way to set max size of images when converting to pdf
[not found] ` <ec1538e2-e3a0-42c0-80d8-85fd23d57ae8n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2022-02-03 9:23 ` Albert Krewinkel
0 siblings, 0 replies; 8+ messages in thread
From: Albert Krewinkel @ 2022-02-03 9:23 UTC (permalink / raw)
To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw; +Cc: koi
koi <aneeqasifscent-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:
> i just basically want to impliment this
>
> ![test image](test.jpg){width=90%} <-------
>
> without doing this in markdown file but instead defining some settings
> in some other file and using it with pandoc while compiling md to pdf
Lua filters lend themselves to this. Put the following code into a file
and pass that file to pandoc via a `--lua-filter` command line
parameter.
``` lua
function Image (img)
img.attributes.width = img.attributes.width or '90%'
return img
end
```
--
Albert Krewinkel
GPG: 8eed e3e2 e8c5 6f18 81fe e836 388d c0b2 1f63 1124
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: any way to set max size of images when converting to pdf
[not found] ` <b3f61f7b-d308-44c1-aac4-723ae6e1e636n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2022-02-03 16:29 ` John MacFarlane
[not found] ` <m21r0j52y9.fsf-jF64zX8BO0+FqBokazbCQ6OPv3vYUT2dxr7GGTnW70NeoWH0uzbU5w@public.gmane.org>
0 siblings, 1 reply; 8+ messages in thread
From: John MacFarlane @ 2022-02-03 16:29 UTC (permalink / raw)
To: koi, pandoc-discuss
you want width=2in not =\2in
and similarly for height.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: any way to set max size of images when converting to pdf
[not found] ` <m21r0j52y9.fsf-jF64zX8BO0+FqBokazbCQ6OPv3vYUT2dxr7GGTnW70NeoWH0uzbU5w@public.gmane.org>
@ 2022-02-04 12:08 ` koi
0 siblings, 0 replies; 8+ messages in thread
From: koi @ 2022-02-04 12:08 UTC (permalink / raw)
To: pandoc-discuss
[-- Attachment #1.1: Type: text/plain, Size: 647 bytes --]
is there any similar way to center all images to page by using any -H
header file of lua filter ?
On Thursday, 3 February 2022 at 9:29:35 pm UTC+5 John MacFarlane wrote:
>
> you want width=2in not =\2in
> and similarly for height.
>
--
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/3336236b-d4e3-4382-8386-ce9410f311f2n%40googlegroups.com.
[-- Attachment #1.2: Type: text/html, Size: 1157 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2022-02-04 12:08 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-02 21:18 any way to set max size of images when converting to pdf koi
[not found] ` <d2c311eb-430f-46a3-a332-0e8ff3bef555n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2022-02-03 0:33 ` John MacFarlane
[not found] ` <yh480k1r0kn60g.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
2022-02-03 8:18 ` koi
[not found] ` <b3f61f7b-d308-44c1-aac4-723ae6e1e636n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2022-02-03 16:29 ` John MacFarlane
[not found] ` <m21r0j52y9.fsf-jF64zX8BO0+FqBokazbCQ6OPv3vYUT2dxr7GGTnW70NeoWH0uzbU5w@public.gmane.org>
2022-02-04 12:08 ` koi
2022-02-03 8:37 ` koi
2022-02-03 8:48 ` koi
[not found] ` <ec1538e2-e3a0-42c0-80d8-85fd23d57ae8n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2022-02-03 9:23 ` Albert Krewinkel
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).