How do I use Pandoc's extensions correctly?












2














This is in my .md document:



![Step 1](Slide1.png){ width=100px }  
![Step 2](Slide2.png){ width=100px }
![Step 3](Slide3.png){ width=100px }
![Step 4](Slide4.png){ width=100px }
![Step 5](Slide5.png){ width=100px }
![Step 6](Slide6.png){ width=100px }
![Step 7](Slide7.png){ width=100px }
![Step 8](Slide8.png){ width=100px }


This is how I use Pandoc:



pandoc foo.md -f markdown+link_attributes -s -o foo.pdf


The link_attributes are completely ignored, and { width=100px } appears as plaintext after every image.



What is the correct way of setting image size in Pandoc markdown?










share|improve this question





























    2














    This is in my .md document:



    ![Step 1](Slide1.png){ width=100px }  
    ![Step 2](Slide2.png){ width=100px }
    ![Step 3](Slide3.png){ width=100px }
    ![Step 4](Slide4.png){ width=100px }
    ![Step 5](Slide5.png){ width=100px }
    ![Step 6](Slide6.png){ width=100px }
    ![Step 7](Slide7.png){ width=100px }
    ![Step 8](Slide8.png){ width=100px }


    This is how I use Pandoc:



    pandoc foo.md -f markdown+link_attributes -s -o foo.pdf


    The link_attributes are completely ignored, and { width=100px } appears as plaintext after every image.



    What is the correct way of setting image size in Pandoc markdown?










    share|improve this question



























      2












      2








      2


      1





      This is in my .md document:



      ![Step 1](Slide1.png){ width=100px }  
      ![Step 2](Slide2.png){ width=100px }
      ![Step 3](Slide3.png){ width=100px }
      ![Step 4](Slide4.png){ width=100px }
      ![Step 5](Slide5.png){ width=100px }
      ![Step 6](Slide6.png){ width=100px }
      ![Step 7](Slide7.png){ width=100px }
      ![Step 8](Slide8.png){ width=100px }


      This is how I use Pandoc:



      pandoc foo.md -f markdown+link_attributes -s -o foo.pdf


      The link_attributes are completely ignored, and { width=100px } appears as plaintext after every image.



      What is the correct way of setting image size in Pandoc markdown?










      share|improve this question















      This is in my .md document:



      ![Step 1](Slide1.png){ width=100px }  
      ![Step 2](Slide2.png){ width=100px }
      ![Step 3](Slide3.png){ width=100px }
      ![Step 4](Slide4.png){ width=100px }
      ![Step 5](Slide5.png){ width=100px }
      ![Step 6](Slide6.png){ width=100px }
      ![Step 7](Slide7.png){ width=100px }
      ![Step 8](Slide8.png){ width=100px }


      This is how I use Pandoc:



      pandoc foo.md -f markdown+link_attributes -s -o foo.pdf


      The link_attributes are completely ignored, and { width=100px } appears as plaintext after every image.



      What is the correct way of setting image size in Pandoc markdown?







      markdown pandoc






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Dec 14 '18 at 23:26









      Kurt Pfeifle

      9,19713555




      9,19713555










      asked Nov 13 '17 at 22:18









      JMC

      112




      112






















          1 Answer
          1






          active

          oldest

          votes


















          0














          As far as I can see, you are using the width parameter correctly. An alternative way supported by Pandoc is to use percent ('%') instead of pixels ('px'):



          ![Step 1](Slide1.png){ width=13% }  


          Which Pandoc version are you using? Now, 2 years after your OP, the current Pandoc is v2.5. And it produces the correct result:



          cat foo.md

          ![Step 1](Slide1.png){ width=100px }
          ![Step 2](Slide1.png){ width=600px }
          ![Step 3](Slide1.png){ width=66% }


          No need even to specify -f markdown+link_attributes -s:



          pandoc         
          -o foo.pdf
          foo.md


          This is a screenshot from the result:



          enter image description here






          share|improve this answer























            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "3"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1268057%2fhow-do-i-use-pandocs-extensions-correctly%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            As far as I can see, you are using the width parameter correctly. An alternative way supported by Pandoc is to use percent ('%') instead of pixels ('px'):



            ![Step 1](Slide1.png){ width=13% }  


            Which Pandoc version are you using? Now, 2 years after your OP, the current Pandoc is v2.5. And it produces the correct result:



            cat foo.md

            ![Step 1](Slide1.png){ width=100px }
            ![Step 2](Slide1.png){ width=600px }
            ![Step 3](Slide1.png){ width=66% }


            No need even to specify -f markdown+link_attributes -s:



            pandoc         
            -o foo.pdf
            foo.md


            This is a screenshot from the result:



            enter image description here






            share|improve this answer




























              0














              As far as I can see, you are using the width parameter correctly. An alternative way supported by Pandoc is to use percent ('%') instead of pixels ('px'):



              ![Step 1](Slide1.png){ width=13% }  


              Which Pandoc version are you using? Now, 2 years after your OP, the current Pandoc is v2.5. And it produces the correct result:



              cat foo.md

              ![Step 1](Slide1.png){ width=100px }
              ![Step 2](Slide1.png){ width=600px }
              ![Step 3](Slide1.png){ width=66% }


              No need even to specify -f markdown+link_attributes -s:



              pandoc         
              -o foo.pdf
              foo.md


              This is a screenshot from the result:



              enter image description here






              share|improve this answer


























                0












                0








                0






                As far as I can see, you are using the width parameter correctly. An alternative way supported by Pandoc is to use percent ('%') instead of pixels ('px'):



                ![Step 1](Slide1.png){ width=13% }  


                Which Pandoc version are you using? Now, 2 years after your OP, the current Pandoc is v2.5. And it produces the correct result:



                cat foo.md

                ![Step 1](Slide1.png){ width=100px }
                ![Step 2](Slide1.png){ width=600px }
                ![Step 3](Slide1.png){ width=66% }


                No need even to specify -f markdown+link_attributes -s:



                pandoc         
                -o foo.pdf
                foo.md


                This is a screenshot from the result:



                enter image description here






                share|improve this answer














                As far as I can see, you are using the width parameter correctly. An alternative way supported by Pandoc is to use percent ('%') instead of pixels ('px'):



                ![Step 1](Slide1.png){ width=13% }  


                Which Pandoc version are you using? Now, 2 years after your OP, the current Pandoc is v2.5. And it produces the correct result:



                cat foo.md

                ![Step 1](Slide1.png){ width=100px }
                ![Step 2](Slide1.png){ width=600px }
                ![Step 3](Slide1.png){ width=66% }


                No need even to specify -f markdown+link_attributes -s:



                pandoc         
                -o foo.pdf
                foo.md


                This is a screenshot from the result:



                enter image description here







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Dec 15 '18 at 18:46

























                answered Dec 14 '18 at 23:25









                Kurt Pfeifle

                9,19713555




                9,19713555






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Super User!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.





                    Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                    Please pay close attention to the following guidance:


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1268057%2fhow-do-i-use-pandocs-extensions-correctly%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Plaza Victoria

                    Brian Clough

                    Cáceres