<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>markdown | Thought splinters</title>
    <link>https://notes.peter-baumgartner.net/tag/markdown/</link>
      <atom:link href="https://notes.peter-baumgartner.net/tag/markdown/index.xml" rel="self" type="application/rss+xml" />
    <description>markdown</description>
    <generator>Wowchemy (https://wowchemy.com)</generator><language>en-us</language><copyright>CC BY-SA 4.0</copyright><lastBuildDate>Fri, 14 May 2021 00:00:00 +0000</lastBuildDate>
    <image>
      <url>https://notes.peter-baumgartner.net/media/icon_huab1e86cf5cbc1139acf672dc60b9d7d0_5213_512x512_fill_lanczos_center_2.png</url>
      <title>markdown</title>
      <link>https://notes.peter-baumgartner.net/tag/markdown/</link>
    </image>
    
    <item>
      <title>Images in Different File Formats</title>
      <link>https://notes.peter-baumgartner.net/2021/05/14/images-in-different-file-formats/</link>
      <pubDate>Fri, 14 May 2021 00:00:00 +0000</pubDate>
      <guid>https://notes.peter-baumgartner.net/2021/05/14/images-in-different-file-formats/</guid>
      <description>&lt;p&gt;I have investigated the different methods for inserting images into various file formats and conversion procedures.&lt;/p&gt;



&lt;h2 id=&#34;image-handling-in-rmd-md-and-rmarkdown-files&#34;&gt;Image handling in .Rmd, .md and .Rmarkdown files&lt;a href=&#34;#image-handling-in-rmd-md-and-rmarkdown-files&#34;&gt;&lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
&lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
&lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
&lt;/svg&gt;&lt;/a&gt;
&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;At first I looked on the various options for &lt;a href=&#34;https://notes.peter-baumgartner.net/2021/05/05/images-from-rmd-to-html-format/&#34;&gt;handling of images in .Rmd files&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Then &amp;ndash; as a contrast program &amp;ndash; I tested the outcomes of &lt;a href=&#34;https://notes.peter-baumgartner.net/2021/05/06/images-in-md-files/&#34;&gt;image handling procedures in .md files&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;And finally I investigated the &lt;a href=&#34;https://notes.peter-baumgartner.net/2021/05/07/images-in-rmarkdown-files/&#34;&gt;image procedures in.Rmarkdown files&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;



&lt;h2 id=&#34;observed-results&#34;&gt;Observed results&lt;a href=&#34;#observed-results&#34;&gt;&lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
&lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
&lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
&lt;/svg&gt;&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;The situation is complex and not easy to grasp. But on a meta-level, the case is pretty straightforward: The decision for a file format is much more important than the details in image handling.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;&lt;code&gt;.Rmd&lt;/code&gt;&lt;/strong&gt;: The window provided via Visual R Markdown provides all its great features only in .Rmd files. With the new page bundle feature in Hugo some disadvantages of .Rmd file disappear: As every file is in its own folder the several files produced by the conversion process do not hamper anymore. But .Rmd files loose some of the nice features of the Academic theme, e.g., the table of contents on the ride side. Also the chunk option &lt;code&gt;fig.align&lt;/code&gt; does not work with the Academic theme. To date I could not find &amp;amp; solve the annoying problem.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;&lt;code&gt;.Rmarkdown&lt;/code&gt;&lt;/strong&gt;: It turns out that &lt;strong&gt;.Rmarkdown files have the greatest advantages&lt;/strong&gt;. They have now almost the same features of R Markdown (writing and applying R code, using references and bibliography), but provides also the benefits of the (Academic) theme via the Goldmark renderer. Yes, you can&amp;rsquo;t use the full functionality of the Visual R Markdown window for including images but you could use instead the Hugo figure shortcode.&lt;sup id=&#34;fnref:1&#34;&gt;&lt;a href=&#34;#fn:1&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;So the situation is pretty straightforward: The Hugo figure shortcode is for all different file formats a good solution. In the case of .Rmd files they have to be embedded in an HTML-chunk as &lt;a href=&#34;https://notes.peter-baumgartner.net/2021/05/05/images-from-rmd-to-html-format#code-in-html-chunk&#34;&gt;demonstrated in the .Rmd post&lt;/a&gt;.&lt;/p&gt;



&lt;h2 id=&#34;additional-tip&#34;&gt;Additional tip&lt;a href=&#34;#additional-tip&#34;&gt;&lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
&lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
&lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
&lt;/svg&gt;&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;RStudio markdown snippet do not work in .md files. I do not understand why not. Ok, there is no R programming code but it coud be used for other (text) snippets. RStudio markdown snippet do work with .Rmarkdown files. So I have prepared an snippet to include the &lt;a href=&#34;https://gohugo.io/content-management/shortcodes/#figure&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Hugo figure shortcode&lt;/a&gt; syntax and saved under &amp;lsquo;ff&amp;rsquo;. So I just need to type &lt;code&gt;ff + SHIFT-Tab&lt;/code&gt; to get a template with all the parameters .&lt;/p&gt;
&lt;p&gt;&lt;span class=&#39;Z3988&#39; title=&#39;url_ver=Z39.88-2004&amp;amp;ctx_ver=Z39.88-2004&amp;amp;rfr_id=info%3Asid%2Fzotero.org%3A2&amp;amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Adc&amp;amp;rft.type=blogPost&amp;amp;rft.title=Images%20in%20Different%20File%20Formats&amp;amp;rft.source=Thought%20splinters&amp;amp;rft.rights=CC%20BY-SA%204.0&amp;amp;rft.description=I%20have%20investigated%20the%20different%20methods%20for%20inserting%20images%20into%20various%20file%20formats%20and%20conversion%20procedures.%20The%20situation%20is%20complex%20and%20not%20easy%20to%20grasp.%20But%20on%20a%20meta-level,%20the%20case%20is%20pretty%20straightforward:%20The%20decision%20for%20a%20file%20format%20is%20much%20more%20important%20than%20the%20details%20in%20image%20handling.&amp;amp;rft.identifier=https%3A%2F%2Fnotes.peter-baumgartner.net%2F2021%2F05%2F14%2Fimages-in-different-file-formats&amp;amp;rft.aufirst=Peter&amp;amp;rft.aulast=Baumgartner&amp;amp;rft.au=Peter%20Baumgartner&amp;amp;rft.date=2021-05-14&amp;amp;rft.language=en&#39;&gt;&lt;/span&gt;&lt;/p&gt;
&lt;section class=&#34;footnotes&#34; role=&#34;doc-endnotes&#34;&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id=&#34;fn:1&#34; role=&#34;doc-endnote&#34;&gt;
&lt;p&gt;At the moment I do not know if using the &lt;code&gt;figure&lt;/code&gt; shortcode results in some processing penalties. At least I read and experienced it myself that with many images the standard time-out parameter for Netlify has to be set much higher than the standard 10 seconds. &lt;a href=&#34;#fnref:1&#34; class=&#34;footnote-backref&#34; role=&#34;doc-backlink&#34;&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/section&gt;
</description>
    </item>
    
    <item>
      <title>Images: From R Markdown to HTML format</title>
      <link>https://notes.peter-baumgartner.net/2021/05/05/images-from-rmd-to-html-format/</link>
      <pubDate>Wed, 05 May 2021 00:00:00 +0000</pubDate>
      <guid>https://notes.peter-baumgartner.net/2021/05/05/images-from-rmd-to-html-format/</guid>
      <description>
&lt;script src=&#34;https://notes.peter-baumgartner.net/2021/05/05/images-from-rmd-to-html-format/index.en_files/header-attrs/header-attrs.js&#34;&gt;&lt;/script&gt;

&lt;div id=&#34;TOC&#34;&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;#introduction&#34;&gt;Introduction&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#using-r-chunk-with-knitr&#34;&gt;Using r chunk with &lt;code&gt;knitr&lt;/code&gt;&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;#example&#34;&gt;Example&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#code-in-r-chunk&#34;&gt;Code in R Chunk&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#code-in-html&#34;&gt;Code in HTML&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#css&#34;&gt;CSS&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#summary&#34;&gt;Summary&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#markdown-via-addins-insert-image&#34;&gt;Markdown via Addins ‘Insert Image’&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;#example-1&#34;&gt;Example&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#code-in-markdown&#34;&gt;Code in markdown&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#code-in-html-1&#34;&gt;Code in HTML&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#css-1&#34;&gt;CSS&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#summary-1&#34;&gt;Summary&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#visual-r-markdown-via-menu-insert&#34;&gt;Visual R Markdown via Menu ‘Insert …’&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;#example-2&#34;&gt;Example&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#code-in-markdown-1&#34;&gt;Code in markdown&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#code-in-html-2&#34;&gt;Code in HTML&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#css-2&#34;&gt;CSS&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#summary-2&#34;&gt;Summary&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#hugo-figure-shortcut&#34;&gt;Hugo figure shortcut&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;#example-3&#34;&gt;Example&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#code-in-html-chunk&#34;&gt;Code in HTML chunk&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#css-3&#34;&gt;CSS&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#summary-3&#34;&gt;Summary&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#results-and-conclusion&#34;&gt;Results and Conclusion&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;

&lt;div id=&#34;introduction&#34; class=&#34;section level2&#34;&gt;
&lt;h2&gt;Introduction&lt;/h2&gt;
&lt;p&gt;This article is the first of a series of posts to investigate methods of inserting figures into different markdown formats. The resulting code depends on how images are included and the conversion tool they have to undergo. And — at least I think — also somewhat on the theme in use. In my case it is the blog widget of the &lt;code&gt;starter-academic&lt;/code&gt; theme.&lt;/p&gt;
&lt;p&gt;Here I look at the process chain from Rmd via &lt;a href=&#34;https://pandoc.org/&#34;&gt;Pandoc&lt;/a&gt; to HTML. I will inspect inserting images with the following methods:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;R chunk code via &lt;code&gt;knitr::include_graphics()&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;‘Insert Image’ window via blogdown Addins&lt;/li&gt;
&lt;li&gt;‘Image …’ window vial Visual R Markdown&lt;/li&gt;
&lt;li&gt;Hugo shortcode&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Of course, you can always include HTML instead of markdown code, but this case is not of interest here as there are no changes during the conversion process.&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;using-r-chunk-with-knitr&#34; class=&#34;section level2&#34;&gt;
&lt;h2&gt;Using r chunk with &lt;code&gt;knitr&lt;/code&gt;&lt;/h2&gt;
&lt;p&gt;You can include external images with the &lt;a href=&#34;https://www.rdocumentation.org/packages/knitr/versions/1.33/topics/include_graphics&#34;&gt;knitr function &lt;code&gt;include_graphics()&lt;/code&gt;&lt;/a&gt;. There are &lt;a href=&#34;https://yihui.org/knitr/options/#plots&#34;&gt;many chunk options&lt;/a&gt; to specify the resulting figure, but not all are useful for external images.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Use &lt;code&gt;out.width&lt;/code&gt; and &lt;code&gt;out.height&lt;/code&gt; (not &lt;code&gt;fig.width&lt;/code&gt; or &lt;code&gt;fig.height&lt;/code&gt;, they are for R-generated plots)&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;out.extra&lt;/code&gt; to add CSS styles (see for details &lt;a href=&#34;http://zevross.com/blog/2017/06/19/tips-and-tricks-for-working-with-images-and-figures-in-r-markdown-documents/#style-your-image-environment-with-css&#34;&gt;Style your image environment with CSS&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;If &lt;code&gt;fig.cap&lt;/code&gt; is provided without &lt;code&gt;fig.alt&lt;/code&gt;, it will also function as alternative text, which is usually not desired.&lt;/li&gt;
&lt;li&gt;Use &lt;a href=&#34;https://bookdown.org/yihui/rmarkdown-cookbook/output-hooks.html&#34;&gt;output hooks&lt;/a&gt; if you want even more control.&lt;/li&gt;
&lt;/ul&gt;
&lt;div id=&#34;example&#34; class=&#34;section level3&#34;&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;div class=&#34;figure&#34; style=&#34;text-align: center&#34;&gt;&lt;span id=&#34;fig:img-with-knitr&#34;&gt;&lt;/span&gt;
&lt;img src=&#34;images/my-image.png&#34; alt=&#34;Alternative text for figure 1&#34; width=&#34;50%&#34; /&gt;
&lt;p class=&#34;caption&#34;&gt;
Figure 1: Caption for figure 1
&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;&lt;div class=&#34;alert alert-warning&#34;&gt;
  &lt;div&gt;
    The &lt;code&gt;fig.align&lt;/code&gt; parameter generally works correctly, but not in this theme. It always centers to a 10 (instead 0f 12) column width. Left and right alignments do not work at all. I could not find and solve the problem.
  &lt;/div&gt;
&lt;/div&gt;
&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;code-in-r-chunk&#34; class=&#34;section level3&#34;&gt;
&lt;h3&gt;Code in R Chunk&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;```
{r img-with-knitr, echo=FALSE, fig.align=&amp;#39;center&amp;#39;, out.width=&amp;#39;50%&amp;#39;, fig.cap=&amp;#39;Caption for figure 1&amp;#39;, fig.alt=&amp;#39;Alternative text for figure 1&amp;#39;}
knitr::include_graphics(&amp;quot;images/my-image.png&amp;quot;)
```&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div id=&#34;code-in-html&#34; class=&#34;section level3&#34;&gt;
&lt;h3&gt;Code in HTML&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;```
&amp;lt;div class=&amp;quot;figure&amp;quot; style=&amp;quot;text-align: center&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;fig:img-with-knitr&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;
    &amp;lt;img src=&amp;quot;images/my-image.png&amp;quot; alt=&amp;quot;Alternative text for figure 1&amp;quot; width=&amp;quot;50%&amp;quot;&amp;gt;
    &amp;lt;p class=&amp;quot;caption&amp;quot;&amp;gt;
        Figure 1: Caption for figure 1
    &amp;lt;/p&amp;gt;
&amp;lt;/div&amp;gt;
```&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;It is a stand-alone feature of &lt;code&gt;knitr&lt;/code&gt; to provide automatically generated figure numbers that you can reference via their id. The id is generated from the chunk name with the pattern &lt;code&gt;fig:&amp;lt;chunk name&amp;gt;&lt;/code&gt;. The figure 1 above can be referenced with &lt;code&gt;\@ref(fig:img-with-knitr)&lt;/code&gt;. Like this:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;For more details see Figure &lt;a href=&#34;#fig:img-with-knitr&#34;&gt;1&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;div class=&#34;alert alert-note&#34;&gt;
  &lt;div&gt;
    But in that case, you cannot use other methods to insert figures with numbers as &lt;code&gt;knitr&lt;/code&gt; will not be aware of them.
  &lt;/div&gt;
&lt;/div&gt;
&lt;/p&gt;
&lt;p&gt;The relevant selectors for CSS styles are &lt;code&gt;div.figure&lt;/code&gt; and &lt;code&gt;p.caption&lt;/code&gt;. We will see that these styles are consistent with all the other methods provided by RStudio windows. But Hugo’s figure shortcode uses the HTML tags &lt;code&gt;figure&lt;/code&gt; and &lt;code&gt;figcaption&lt;/code&gt;. In the &lt;a href=&#34;https://bookdown.org/yihui/rmarkdown-cookbook/hook-html5.html&#34;&gt;R Markdown Coobook&lt;/a&gt; is a work around expained how you can produce these Hugo HTML tags with &lt;code&gt;knitr&lt;/code&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;css&#34; class=&#34;section level3&#34;&gt;
&lt;h3&gt;CSS&lt;/h3&gt;
&lt;p&gt;The CSS style I have used to display the image:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;img {
        border: 1px;
        border-style: groove;
        box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px  rgba(0, 0, 0, 0.19);
}

p.caption {
    text-align: center;
    margin-top: -0.5rem;
    margin-bottom: 0.5rem;
    font-size: smaller;
}&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div id=&#34;summary&#34; class=&#34;section level3&#34;&gt;
&lt;h3&gt;Summary&lt;/h3&gt;
&lt;p&gt;Using the &lt;code&gt;knitr&lt;/code&gt; function &lt;code&gt;include_graphics()&lt;/code&gt; for external images provides a rich set of image attributes (tags). It is also very flexible, especially if you are using the more complex possibilities like programming the output chunk hook.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Caption&lt;/strong&gt;: yes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Format of caption&lt;/strong&gt;: no&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Caption automatically numbered&lt;/strong&gt;: yes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Alt&lt;/strong&gt;: yes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Title&lt;/strong&gt;: no&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Tooltip&lt;/strong&gt;: no&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Width/Height&lt;/strong&gt;: yes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Link to&lt;/strong&gt;: no&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;ID&lt;/strong&gt;: yes (format: &#34;fig:&amp;lt;chunk name&amp;gt;)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Classes&lt;/strong&gt;: yes (with &lt;code&gt;out.extra&lt;/code&gt;, example: &lt;code&gt;out.extra=&#39;class=&#34;border shadowed&#34;&#39;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;CSS style&lt;/strong&gt;: yes (with out.extra, example: &lt;code&gt;out.extra=&#39;style=&#34;background-color: #9ecff7; padding:10px; display: inline-block;&#34;&#39;&lt;/code&gt; See blog post &lt;a href=&#34;http://zevross.com/blog/2017/06/19/tips-and-tricks-for-working-with-images-and-figures-in-r-markdown-documents/&#34;&gt;Tips and tricks for working with images and figures in R Markdown documents&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Other&lt;/strong&gt; (key=value): no&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&#34;markdown-via-addins-insert-image&#34; class=&#34;section level2&#34;&gt;
&lt;h2&gt;Markdown via Addins ‘Insert Image’&lt;/h2&gt;
&lt;p&gt;&lt;img src=&#34;images/adding-external-window-with-rstudio-addin-min.png&#34; /&gt;&lt;/p&gt;
&lt;p&gt;The possibilities of RStudio Addins window for &lt;code&gt;blogdown&lt;/code&gt; are sparse. But it has one big advantage: The addin helps user to provide the correct file path and copies the image to the right place.&lt;/p&gt;
&lt;p&gt;The RStudio Addins window for &lt;code&gt;blogdown&lt;/code&gt; package allows only width / height arguments and alternative text. The content of the ‘alt’-attribute is in the final HTML code converted to the caption, &lt;a href=&#34;https://blog.spotibo.com/difference-between-alt-text-and-title-text/&#34;&gt;which is not correct&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;The alternate text should describe what you can see on the image in case the image does not appear (e.g., is blocked) or the user applies a screen reader. ‘Alt’ text is also rendered by search engines. Every picture should have a corresponding ‘alt’ attribute The caption by contrast is not so important. It provides additional information and appears under the image explaining the content to reader who are able to see the picture.&lt;/p&gt;
&lt;div id=&#34;example-1&#34; class=&#34;section level3&#34;&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;div class=&#34;figure&#34;&gt;
&lt;img src=&#34;images/my-image.png&#34; style=&#34;width:100.0%&#34; alt=&#34;&#34; /&gt;
&lt;p class=&#34;caption&#34;&gt;&lt;strong&gt;Figure 2:&lt;/strong&gt; Caption for this figure 2&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;&lt;div class=&#34;alert alert-warning&#34;&gt;
  &lt;div&gt;
    You can’t use the Addins ‘Insert Image’ in Visual R Markdown mode because it protects the conversion by adding a backslash in front of the squared brackets: &lt;code&gt;![Alt text](images/my-image.png)&lt;/code&gt;.
  &lt;/div&gt;
&lt;/div&gt;
&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;code-in-markdown&#34; class=&#34;section level3&#34;&gt;
&lt;h3&gt;Code in markdown&lt;/h3&gt;
&lt;p&gt;RStudio Addins window produces the following markdown code:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;![**Figure 2:** Caption for this figure 2](images/my-image.png){width=100%}&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I think starting with the RStudio version 1.4 (January 2021) the RStudio Addin window is superseded by the the &lt;a href=&#34;https://rstudio.github.io/visual-markdown-editing/#/&#34;&gt;Visual R Markdown&lt;/a&gt; window (see &lt;a href=&#34;#visual-r-markdown-via-menu-insert&#34;&gt;next section&lt;/a&gt;). If you are turning on the visual editor you can always enhance the rudimentary markdown of the addin window with all the features of Visual R Markdown.&lt;/p&gt;
&lt;p&gt;For this improvement you need to&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;turn on Visual RStudio Markdown;&lt;/li&gt;
&lt;li&gt;select the image which markdown you want to enhance;&lt;/li&gt;
&lt;li&gt;click into the small round button with the three points to open up the dialog window;&lt;/li&gt;
&lt;li&gt;correct or add the desired content for the attributes (there is more under the “Attributes” tab);&lt;/li&gt;
&lt;li&gt;close the window;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you want to work with markdown directly you may turn off Visual RStudio Markdown.&lt;/p&gt;
&lt;div class=&#34;figure&#34;&gt;
&lt;img src=&#34;images/enhancing-markdown-with-visual-r-markdown-commented-min.png&#34; alt=&#34;&#34; /&gt;
&lt;p class=&#34;caption&#34;&gt;Screenshot of the Visual RStudio Markdown window&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&#34;code-in-html-1&#34; class=&#34;section level3&#34;&gt;
&lt;h3&gt;Code in HTML&lt;/h3&gt;
&lt;p&gt;Here I am referring to the RStudio Addin without enhancement from the Visual R Markdown window.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;div class=&amp;quot;figure&amp;quot;&amp;gt;
    &amp;lt;img src=&amp;quot;images/my-image.png&amp;quot; alt=&amp;quot;&amp;quot;&amp;gt;
    &amp;lt;p class=&amp;quot;caption&amp;quot;&amp;gt;&amp;lt;strong&amp;gt;Figure 2:&amp;lt;/strong&amp;gt; Caption for this figure 1           
    &amp;lt;/p&amp;gt;
&amp;lt;/div&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;As you can see: The &lt;code&gt;alt&lt;/code&gt; attribute is empty, although I have filled it out!&lt;/p&gt;
&lt;p&gt;&lt;div class=&#34;alert alert-note&#34;&gt;
  &lt;div&gt;
    If you do not provide text for the &lt;code&gt;alt&lt;/code&gt; (= capture) attributes then there is no &lt;code&gt;div.figure&lt;/code&gt; and &lt;code&gt;p.caption&lt;/code&gt; class. In this case there is only the &lt;code&gt;img&lt;/code&gt; tag as you can see with the image under the header &lt;a href=&#34;#markdown-via-addins-insert-image&#34;&gt;Markdown via Addins ‘Insert Image’&lt;/a&gt;.
  &lt;/div&gt;
&lt;/div&gt;
&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;css-1&#34; class=&#34;section level3&#34;&gt;
&lt;h3&gt;CSS&lt;/h3&gt;
&lt;p&gt;The conversion to HTML produced exactly the same classes as in the result with the &lt;code&gt;knitr&lt;/code&gt; image inclusion (see the &lt;a href=&#34;#css&#34;&gt;CSS code under the knitr section&lt;/a&gt;).&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;summary-1&#34; class=&#34;section level3&#34;&gt;
&lt;h3&gt;Summary&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Caption&lt;/strong&gt;: yes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Format of caption&lt;/strong&gt;: yes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Caption automatically numbered&lt;/strong&gt;: no&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Alt&lt;/strong&gt;: no&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Title&lt;/strong&gt;: no&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Tooltip&lt;/strong&gt;: no&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Width/Height&lt;/strong&gt;: yes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Link to&lt;/strong&gt;: no&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;ID&lt;/strong&gt;: no&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Classes&lt;/strong&gt;: no&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;CSS style&lt;/strong&gt;: no&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Other&lt;/strong&gt; (key=value): no&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&#34;visual-r-markdown-via-menu-insert&#34; class=&#34;section level2&#34;&gt;
&lt;h2&gt;Visual R Markdown via Menu ‘Insert …’&lt;/h2&gt;
&lt;p&gt;&lt;img src=&#34;images/image-dialog-window-side-by-side-min.png&#34; /&gt;&lt;/p&gt;
&lt;p&gt;After you have turned on Visual R Markdown you can load the image window via the Menu &lt;code&gt;&#39;Insert &#39; -&amp;gt; &#39;Image…&#39;&lt;/code&gt; or shortcut ⇧⌘I. For an overview I put in the picture above both parts of the window side by side. You can see that it offers a very complete list of image attributes.&lt;/p&gt;
&lt;p&gt;&lt;div class=&#34;alert alert-warning&#34;&gt;
  &lt;div&gt;
    If you do not include text in the “Caption/Alt” field then no HTML code for the &lt;code&gt;div.figure&lt;/code&gt; and &lt;code&gt;p.caption&lt;/code&gt; classes will be produced and the appropriate CSS styles cannot be applied.
  &lt;/div&gt;
&lt;/div&gt;
&lt;/p&gt;
&lt;div id=&#34;example-2&#34; class=&#34;section level3&#34;&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;div class=&#34;figure&#34;&gt;
&lt;img src=&#34;images/my-image.png&#34; title=&#34;title text and tooltip&#34; id=&#34;figure3&#34; alt=&#34;here comes a description for blind people, screen readers and search engines&#34; alt=&#34;&#34; /&gt;
&lt;p class=&#34;caption&#34;&gt;Figure 3: Caption for this figure&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;Even in this enhanced window is the wrong mixture of ‘Caption’ and ‘Alt’ attributes offered. But there is a work around with the ‘Other’-field as I have shown in the screenshot.&lt;/p&gt;
&lt;p&gt;&lt;div class=&#34;alert alert-note&#34;&gt;
  &lt;div&gt;
    Fill in the field “Caption/Alt” &lt;strong&gt;and&lt;/strong&gt; add the &lt;code&gt;alt&lt;/code&gt; attribute in the field “Others”. After the conversion to HTML the former constitutes the caption and the later the alternative text.
  &lt;/div&gt;
&lt;/div&gt;
&lt;/p&gt;
&lt;p&gt;If you click on the inserted image and call the window again, then a slightly different window appears where fields for width and height are added and can be changed. This addition appears under the image as well by just clicking on the image.&lt;/p&gt;
&lt;div class=&#34;figure&#34;&gt;
&lt;img src=&#34;images/width-height-fields-after-image-inclusion-min.png&#34; id=&#34;width-height-added&#34; alt=&#34;Width and height field added after the image was included into the .Rmd page. Left: changed window, right: after click into the inserted window.&#34; alt=&#34;&#34; /&gt;
&lt;p class=&#34;caption&#34;&gt;Width and height field added after the image was included into the .Rmd page&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&#34;code-in-markdown-1&#34; class=&#34;section level3&#34;&gt;
&lt;h3&gt;Code in markdown&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;![Figure 3: Caption for this figure](images/my-image.png &amp;quot;title text and tooltip&amp;quot;){#figure3 alt=&amp;quot;here comes a description for blind people, screen readers and search engines}&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In addition to the standard markdown code all the other attributes are added inside curly brackets.&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;code-in-html-2&#34; class=&#34;section level3&#34;&gt;
&lt;h3&gt;Code in HTML&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;div class=&amp;quot;figure&amp;quot;&amp;gt;
    &amp;lt;img src=&amp;quot;images/my-image.png&amp;quot; title=&amp;quot;title text and tooltip&amp;quot; id=&amp;quot;figure3&amp;quot;
    alt=&amp;quot;here comes a description for blind people, screen readers and search engines&amp;quot;&amp;gt;
    &amp;lt;p class=&amp;quot;caption&amp;quot;&amp;gt;
        Figure 3: Caption for this figure
    &amp;lt;/p&amp;gt;
&amp;lt;/div&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div id=&#34;css-2&#34; class=&#34;section level3&#34;&gt;
&lt;h3&gt;CSS&lt;/h3&gt;
&lt;p&gt;The conversion to HTML produced exactly the same classes as in the result with the other two methods &lt;a href=&#34;#css&#34;&gt;&lt;code&gt;knitr&lt;/code&gt; image inclusion&lt;/a&gt; and &lt;a href=&#34;#css-1&#34;&gt;Addins ‘Insert Image’&lt;/a&gt;).&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;summary-2&#34; class=&#34;section level3&#34;&gt;
&lt;h3&gt;Summary&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Caption&lt;/strong&gt;: yes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Format of caption&lt;/strong&gt;: no&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Caption automatically numbered&lt;/strong&gt;: no&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Alt&lt;/strong&gt;: no&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Title&lt;/strong&gt;: yes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Tooltip&lt;/strong&gt;: yes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Width/Height&lt;/strong&gt;: yes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Link to&lt;/strong&gt;: yes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;ID&lt;/strong&gt;: yes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Classes&lt;/strong&gt;: yes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;CSS style&lt;/strong&gt;: yes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Other&lt;/strong&gt; (key=value): yes&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&#34;hugo-figure-shortcut&#34; class=&#34;section level2&#34;&gt;
&lt;h2&gt;Hugo figure shortcut&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;You cannot simply write {{&amp;lt; shortcode &amp;gt;}} in R Markdown, because Pandoc is not aware of Hugo shortcodes, and may convert special characters so that Hugo can no longer recognize the shortcodes (e.g. &amp;lt; will be converted to &amp;lt;).&lt;a href=&#34;#fn1&#34; class=&#34;footnote-ref&#34; id=&#34;fnref1&#34;&gt;&lt;sup&gt;1&lt;/sup&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;With &lt;a href=&#34;https://gohugo.io/getting-started/configuration-markup/#blackfriday&#34;&gt;Blackfriday&lt;/a&gt; as default Markdown rendering engine I used to use for shortcodes the &lt;code&gt;blogdown::shortcode()&lt;/code&gt; function. But after Hugo v0.60 the default Markdown rendering engine changed to &lt;a href=&#34;https://gohugo.io/getting-started/configuration-markup/#goldmark&#34;&gt;Goldmark&lt;/a&gt;. In the above quoted man page for the shortcode() function there is a also special note on this issue:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Since Hugo v0.60, Hugo has switched its default Markdown rendering engine to Goldmark. One consequence is that shortcodes may fail to render. You may enable the unsafe option in the configuration file: &lt;a href=&#34;https://gohugo.io/getting-started/configuration-markup/#goldmark&#34; class=&#34;uri&#34;&gt;https://gohugo.io/getting-started/configuration-markup/#goldmark&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I couldn’t understand this remark as for me all the Hugo shortcodes works well. But to apply it more easily I use pure HTML code chunks to prevent a conversion by Pandoc. This has the advantage that I can include Hugo’s shortcode syntax without any changes.&lt;/p&gt;
&lt;div id=&#34;example-3&#34; class=&#34;section level3&#34;&gt;
&lt;h3&gt;Example&lt;/h3&gt;














&lt;figure  id=&#34;figure-shortcut-figure&#34;&gt;
  &lt;div class=&#34;d-flex justify-content-center&#34;&gt;
    &lt;div class=&#34;w-100&#34; &gt;
        &lt;img alt=&#34;My alt text&#34; srcset=&#34;
               /2021/05/05/images-from-rmd-to-html-format/images/my-image_huf81a7faf920bb11d47d82b059b9dc0cf_20503_1061e20606536f4413fb34665581822b.png 400w,
               /2021/05/05/images-from-rmd-to-html-format/images/my-image_huf81a7faf920bb11d47d82b059b9dc0cf_20503_c4c18b47561549b1147ccf6dd152b5f0.png 760w,
               /2021/05/05/images-from-rmd-to-html-format/images/my-image_huf81a7faf920bb11d47d82b059b9dc0cf_20503_1200x1200_fit_lanczos_2.png 1200w&#34;
               src=&#34;https://notes.peter-baumgartner.net/2021/05/05/images-from-rmd-to-html-format/images/my-image_huf81a7faf920bb11d47d82b059b9dc0cf_20503_1061e20606536f4413fb34665581822b.png&#34;
               width=&#34;754&#34;
               height=&#34;226&#34;
               loading=&#34;lazy&#34; data-zoomable /&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;figcaption data-pre=&#34;Figure&amp;nbsp;&#34; data-post=&#34;:&amp;nbsp;&#34; class=&#34;numbered&#34;&gt;
      My caption text
    &lt;/figcaption&gt;&lt;/figure&gt;
&lt;/div&gt;
&lt;div id=&#34;code-in-html-chunk&#34; class=&#34;section level3&#34;&gt;
&lt;h3&gt;Code in HTML chunk&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;```{=html}
{{&amp;lt; figure src=&amp;quot;images/my-image.png&amp;quot; class=&amp;quot;center&amp;quot; alt=&amp;quot;My alt text&amp;quot; caption=&amp;quot;My title text&amp;quot; id=&amp;quot;shortcut-figure&amp;quot; numbered=&amp;quot;true&amp;quot; &amp;gt;}}
```&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The &lt;code&gt;id&lt;/code&gt; and &lt;code&gt;numbered&lt;/code&gt; attributes are not provided by but they are a &lt;a href=&#34;https://wowchemy.com/docs/content/writing-markdown-latex/#single-image&#34;&gt;feature from the academic theme&lt;/a&gt;.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;If you do not use &lt;code&gt;id&lt;/code&gt; explicitly then Hugo generates an ID with the “figure-” followed by the caption text (e.g., &lt;code&gt;id=&#34;figure-my-caption-text&#34;&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;You can see that the numbering systems starts from scratch, e.g., it does not account for the &lt;code&gt;knitr&lt;/code&gt; chunks. The same is true vice versa.&lt;/li&gt;
&lt;li&gt;Besides the already mentioned attributes Hugo also features &lt;code&gt;target&lt;/code&gt;, &lt;code&gt;rel&lt;/code&gt; and attribution (&lt;code&gt;attr&lt;/code&gt; = text; &lt;code&gt;attrlink&lt;/code&gt; = link).&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div id=&#34;css-3&#34; class=&#34;section level3&#34;&gt;
&lt;h3&gt;CSS&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;```{=html}
&amp;lt;figure id=&amp;quot;figure-shortcut-figure&amp;quot;&amp;gt;
  &amp;lt;div class=&amp;quot;d-flex justify-content-center&amp;quot;&amp;gt;
    &amp;lt;div class=&amp;quot;w-100&amp;quot;&amp;gt;
        &amp;lt;img alt=&amp;quot;My alt text&amp;quot; srcset=&amp;quot;
               /post/images-from-rmd-to-html-format/images/my-image_huf81a7faf920bb11d47d82b059b9dc0cf_20503_1061e20606536f4413fb34665581822b.png 400w,
               /post/images-from-rmd-to-html-format/images/my-image_huf81a7faf920bb11d47d82b059b9dc0cf_20503_c4c18b47561549b1147ccf6dd152b5f0.png 760w,
               /post/images-from-rmd-to-html-format/images/my-image_huf81a7faf920bb11d47d82b059b9dc0cf_20503_1200x1200_fit_lanczos_2.png 1200w&amp;quot; src=&amp;quot;/post/images-from-rmd-to-html-format/images/my-image_huf81a7faf920bb11d47d82b059b9dc0cf_20503_1061e20606536f4413fb34665581822b.png&amp;quot; width=&amp;quot;754&amp;quot; height=&amp;quot;226&amp;quot; loading=&amp;quot;lazy&amp;quot; data-zoomable=&amp;quot;&amp;quot; class=&amp;quot;medium-zoom-image&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;
  &amp;lt;/div&amp;gt;
  &amp;lt;figcaption data-pre=&amp;quot;Figure&amp;amp;nbsp;&amp;quot; data-post=&amp;quot;:&amp;amp;nbsp;&amp;quot; class=&amp;quot;numbered&amp;quot;&amp;gt;
      My caption text
  &amp;lt;/figcaption&amp;gt;
&amp;lt;/figure&amp;gt;

```&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The produced HTML is pretty complex, but here we are just interested in the two relevant tags for CSS styling: &lt;code&gt;&amp;lt;figure&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;figcaption&amp;gt;&lt;/code&gt;. These two HTML tag are different to the code produced by other methods of inserting images. So maybe it would be a good idea to style both variants the same way.&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;summary-3&#34; class=&#34;section level3&#34;&gt;
&lt;h3&gt;Summary&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Caption&lt;/strong&gt;: yes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Format of caption&lt;/strong&gt;: no&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Caption automatically numbered&lt;/strong&gt;: yes (Academic theme)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Alt&lt;/strong&gt;: yes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Title&lt;/strong&gt;: no&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Tooltip&lt;/strong&gt;: no (zoomable)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Width/Height&lt;/strong&gt;: yes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Link to&lt;/strong&gt;: yes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;ID&lt;/strong&gt;: yes (Academic theme)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Classes&lt;/strong&gt;: yes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;CSS style&lt;/strong&gt;: yes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Other&lt;/strong&gt; (key=value): no&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&#34;results-and-conclusion&#34; class=&#34;section level2&#34;&gt;
&lt;h2&gt;Results and Conclusion&lt;/h2&gt;
&lt;table&gt;
&lt;caption&gt;Table: Features of different method of inserting images in Rmd files converting to HTML&lt;/caption&gt;
&lt;colgroup&gt;
&lt;col width=&#34;15%&#34; /&gt;
&lt;col width=&#34;8%&#34; /&gt;
&lt;col width=&#34;8%&#34; /&gt;
&lt;col width=&#34;9%&#34; /&gt;
&lt;col width=&#34;8%&#34; /&gt;
&lt;col width=&#34;51%&#34; /&gt;
&lt;/colgroup&gt;
&lt;thead&gt;
&lt;tr class=&#34;header&#34;&gt;
&lt;th&gt;Attribute&lt;/th&gt;
&lt;th align=&#34;center&#34;&gt;knitr&lt;/th&gt;
&lt;th align=&#34;center&#34;&gt;Addin&lt;/th&gt;
&lt;th align=&#34;center&#34;&gt;Visual&lt;/th&gt;
&lt;th align=&#34;center&#34;&gt;Hugo&lt;/th&gt;
&lt;th&gt;Remark&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr class=&#34;odd&#34;&gt;
&lt;td&gt;Caption&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;✅&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;✅&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;✅&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;✅&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&#34;even&#34;&gt;
&lt;td&gt;C. format&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;❌ &lt;sup&gt;2&lt;/sup&gt;&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;✅&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;❌&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;❌ &lt;sup&gt;2&lt;/sup&gt;&lt;/td&gt;
&lt;td&gt;&lt;sup&gt;2&lt;/sup&gt; standard = bold&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&#34;odd&#34;&gt;
&lt;td&gt;C.numbered&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;✅&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;❌&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;❌&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;✅ &lt;sup&gt;3&lt;/sup&gt;&lt;/td&gt;
&lt;td&gt;&lt;sup&gt;3&lt;/sup&gt; via ‘Academic’ theme&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&#34;even&#34;&gt;
&lt;td&gt;Alt&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;✅&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;❌&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;✅ &lt;sup&gt;4&lt;/sup&gt;&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;✅&lt;/td&gt;
&lt;td&gt;&lt;sup&gt;4&lt;/sup&gt; via ‘Other’-field&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&#34;odd&#34;&gt;
&lt;td&gt;Title&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;❌&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;❌&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;✅&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;❌&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&#34;even&#34;&gt;
&lt;td&gt;Tooltip&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;❌&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;❌&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;✅&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;❌&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&#34;odd&#34;&gt;
&lt;td&gt;Width/Height&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;✅&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;✅&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;✅&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;✅&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&#34;even&#34;&gt;
&lt;td&gt;Link to&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;❌&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;❌&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;✅&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;✅&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&#34;odd&#34;&gt;
&lt;td&gt;ID&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;✅ &lt;sup&gt;5&lt;/sup&gt;&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;❌&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;✅&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;✅ &lt;sup&gt;6&lt;/sup&gt;&lt;/td&gt;
&lt;td&gt;&lt;p&gt;&lt;sup&gt;5&lt;/sup&gt; &lt;code&gt;fig:&amp;lt;chunk name&amp;gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;sup&gt;6&lt;/sup&gt; &lt;code&gt;figure-&amp;lt;caption text&amp;gt;&lt;/code&gt; or ‘Academic’ theme&lt;/p&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&#34;even&#34;&gt;
&lt;td&gt;CSS&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;✅&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;❌&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;✅&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;✅&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&#34;odd&#34;&gt;
&lt;td&gt;Other&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;❌&lt;sup&gt;1&lt;/sup&gt;&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;❌&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;✅ &lt;sup&gt;7&lt;/sup&gt;&lt;/td&gt;
&lt;td align=&#34;center&#34;&gt;✅ &lt;sup&gt;8&lt;/sup&gt;&lt;/td&gt;
&lt;td&gt;&lt;p&gt;&lt;sup&gt;1&lt;/sup&gt;via output chunk arbitrary HTML code!&lt;/p&gt;
&lt;p&gt;&lt;sup&gt;7&lt;/sup&gt; free choice!&lt;/p&gt;
&lt;p&gt;&lt;sup&gt;8&lt;/sup&gt; &lt;code&gt;target&lt;/code&gt;, &lt;code&gt;rel&lt;/code&gt;, &lt;code&gt;attr&lt;/code&gt;, &lt;code&gt;attrlink&lt;/code&gt;&lt;/p&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;If we take into account that code produced by the RStudio Addin window can be improved at any time with the Visual R Markdown window then all the four offered methods are pretty similar. But keep in mind that advantages on the one hand are often counter acted by disadvantages on other areas. So — for instance — provides the conversion via Pandoc many advantages but looses also some features of Hugo or the applied theme.&lt;/p&gt;
&lt;p&gt;To sum up this this little investigation I see three patterns of decisions criteria:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;One big difference is the possibility to number the figures automatically. The Addin and Visual R Markdown windows do not provide this feature.&lt;/li&gt;
&lt;li&gt;On the other hand filling in the window fields is — especially for people who are not so comfortable with HTML or Markdown code — easier.&lt;/li&gt;
&lt;li&gt;Another decision criteria could be consistency: If you are using R chunks (which is the major reason to use the .Rmd format!) and want to be consistent throughout the file, then the decision for the &lt;code&gt;knitr&lt;/code&gt; method is obvious.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;But let’s see what the other file format are producing. For people using different methods&lt;a href=&#34;#fn2&#34; class=&#34;footnote-ref&#34; id=&#34;fnref2&#34;&gt;&lt;sup&gt;2&lt;/sup&gt;&lt;/a&gt; for their posts perhaps the comparison inside one file format is not sufficient. Perhaps there is a method not ideal when considered only one file format but has a higher consistency when looked all file format together.&lt;/p&gt;
&lt;span class=&#39;Z3988&#39; title=&#39;url_ver=Z39.88-2004&amp;amp;ctx_ver=Z39.88-2004&amp;amp;rfr_id=info%3Asid%2Fzotero.org%3A2&amp;amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Adc&amp;amp;rft.type=blogPost&amp;amp;rft.title=Images:%20From%20R%20Markdown%20to%20HTML%20format&amp;amp;rft.source=Thought%20splinters&amp;amp;rft.rights=CC%20BY-SA%204.0&amp;amp;rft.description=The%20post%20investigates%20different%20methods%20to%20include%20images%20in%20%60.Rmd%60%20files%20and%20how%20they%20are%20treated%20in%20the%20%60blogdown%60%20conversion%20process%20to%20HTML.&amp;amp;rft.identifier=https%3A%2F%2Fnotes.peter-baumgartner.net%2F2021%2F05%2F05%2Fimages-from-rmd-to-html-format&amp;amp;rft.aufirst=Peter&amp;amp;rft.aulast=Baumgartner&amp;amp;rft.au=Peter%20Baumgartner&amp;amp;rft.date=2021-05-05&amp;amp;rft.language=en&#39;&gt;&lt;/span&gt; 
&lt;/div&gt;
&lt;div class=&#34;footnotes&#34;&gt;
&lt;hr /&gt;
&lt;ol&gt;
&lt;li id=&#34;fn1&#34;&gt;&lt;p&gt;Helper functions to write Hugo shortcodes using the R syntax&lt;a href=&#34;#fnref1&#34; class=&#34;footnote-back&#34;&gt;↩︎&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li id=&#34;fn2&#34;&gt;&lt;p&gt;As with blogdown version 1.3 not all files are automatically rendered, one could choose a different file and conversion format for every post separately. This requires (1) deleting those files produced by the conversion process in the folder of the post under consideration (2) renaming the file ending of the main file and kniting/rendering the new file format again.&lt;a href=&#34;#fnref2&#34; class=&#34;footnote-back&#34;&gt;↩︎&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
</description>
    </item>
    
    <item>
      <title>Comments in Markdown</title>
      <link>https://notes.peter-baumgartner.net/2019/06/02/comments-in-markdown/</link>
      <pubDate>Sun, 02 Jun 2019 00:00:00 +0000</pubDate>
      <guid>https://notes.peter-baumgartner.net/2019/06/02/comments-in-markdown/</guid>
      <description>&lt;p&gt;In reworking this &lt;code&gt;docdock-theme,&lt;/code&gt; I wanted to document the reasons for my changes and how I have done it. But I didn&amp;rsquo;t know how to write comments in markdown.&lt;/p&gt;
&lt;p&gt;Yes, one could use a normal HTML-comment, but you still can see the comment in the source code.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;!-- 
This is a comment inside a code chunk, so that you can see it on the page.

Multiline comments are allowed as well 
--&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Look at the source code, and you will see the text example below this line.&lt;/p&gt;
&lt;!-- 
This is a real HTML-content. It is not visible on the page but in the source code!

Multiline comments are allowed as well 
--&gt;
&lt;p&gt;Searching in &lt;code&gt;Stack Overflow&lt;/code&gt; I came finally up with the following &lt;a href=&#34;https://stackoverflow.com/questions/4823468/comments-in-markdown&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;solution&lt;/a&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&#34;language-{markdown}&#34;&gt;[comment]: # (This text is a comment! But written in a code junk, so that you can see how it is done.)

[comment]: # (This text is a comment! Multiline comments are allowed as far as long there is no line break. This text is a comment! Multiline comments are allowed as long as there is no line break. This text is a comment!  Multiline comments are allowed as long as there is no line break. )
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You can&amp;rsquo;t see the result of this last code example not even in the source code. The comment is hidden by definition :wink: But you can inspect the original text file on my &lt;code&gt;GitHub&lt;/code&gt; repository. Just click on the &lt;code&gt;Edit page&lt;/code&gt; link in the top right corner of this page.&lt;/p&gt;
&lt;p&gt;There are also other possibilities, but the above solution with &lt;code&gt;comment:&lt;/code&gt; written in square brackets and the &lt;code&gt;#&lt;/code&gt; - sign followed by the comment written inside round brackets is the most portable version.&lt;/p&gt;
&lt;p&gt;&lt;span class=&#39;Z3988&#39; title=&#39;url_ver=Z39.88-2004&amp;amp;ctx_ver=Z39.88-2004&amp;amp;rfr_id=info%3Asid%2Fzotero.org%3A2&amp;amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Adc&amp;amp;rft.type=blogPost&amp;amp;rft.title=Comments%20in%20Markdown%20::%20Open%20Science%20Education&amp;amp;rft.source=Comments%20in%20Markdown&amp;amp;rft.rights=CC%20BY-SA%204.0&amp;amp;rft.description=How%20to%20write%20comments%20in%20markdown?&amp;amp;rft.identifier=https%3A%2F%2Fnotes.peter-baumgartner.net%2F2019%2F06%2F02%2Fcomments-in-markdown&amp;amp;rft.aufirst=Peter&amp;amp;rft.aulast=Baumgartner&amp;amp;rft.au=Peter%20Baumgartner&amp;amp;rft.date=&amp;amp;rft.language=en&#39;&gt;&lt;/span&gt;&lt;/p&gt;
</description>
    </item>
    
  </channel>
</rss>
