@@ -420,14 +420,22 @@ General writer options
420420: Print a system default data file. Files in the user data directory
421421 are ignored.
422422
423+`--dpi`=*NUMBER*
424+: Specify the dpi (dots per inch) value for conversion from pixels
425+ to inch/centimeters and vice versa. The default is 96dpi.
426+ Technically, the correct term would be ppi (pixels per inch).
427+
423428`--no-wrap`
424429
425430: Disable text wrapping in output. By default, text is wrapped
426− appropriately for the output format.
431+ appropriately for the output format. This affects only the
432+ generated source code, not the layout on the rendered page.
427433
428434`--columns=`*NUMBER*
429435
430436: Specify length of lines in characters (for text wrapping).
437+ This affects only the generated source code, not the layout on
438+ the rendered page.
431439
432440`--toc`, `--table-of-contents`
433441
@@ -2634,6 +2642,53 @@ nonbreaking space after the image:
26342642
26352643 \
26362644
2645+#### Extension: `common_link_attributes` ####
2646+
2647+Attributes can be set on images:
2648+
2649+ An inline {#id .class width=30 height=20px}
2650+ and a reference ![image][ref] with attributes.
2651+
2652+ [ref]: foo.jpg "optional title" {#id .class key=val key2="val 2"}
2653+
2654+(This syntax is compatible with [PHP Markdown Extra] when only `#id`
2655+and `.class` are used.)
2656+
2657+For HTML and EPUB, all attributes except `width` and `height` (but
2658+including `srcset` and `sizes`) are passed through as is. The other
2659+writers ignore attributes that are not supported by their output
2660+format.
2661+
2662+The `width` and `height` attributes on images are treated specially. When
2663+used without a unit, the unit is assumed to be pixels. However, any of
2664+the following unit identifiers can be used: `px`, `cm`, `mm`, `in`, `inch`
2665+and `%`. There must not be any spaces between the number and the unit.
2666+For example:
2667+
2668+```
2669+{width=50%}
2670+```
2671+
2672+- Dimensions are converted to inches for output in page-based formats like
2673+ LaTeX. Dimensions are converted to pixels for output in HTML-like
2674+ formats. Use the `--dpi` option to specify the number of pixels per
2675+ inch. The default is 96dpi.
2676+- The `%` unit is generally relative to some available space.
2677+ For example the above example will render to
2678+ `<img href="file.jpg" style="width: 50%;" />` (HTML),
2679+ `\includegraphics[width=0.5\textwidth]{file.jpg}` (LaTeX), or
2680+ `\externalfigure[file.jpg][width=0.5\textwidth]` (ConTeXt).
2681+- Some output formats have a notion of a class
2682+ ([ConTeXt](http://wiki.contextgarden.net/Using_Graphics#Multiple_Image_Settings))
2683+ or a unique identifier (LaTeX `\caption`), or both (HTML).
2684+- When no `width` or `height` attributes are specified, the fallback
2685+ is to look at the image resolution and the dpi metadata embedded in
2686+ the image file.
2687+
2688+Note that while attributes are also parsed on links, pandoc's internal
2689+document model provides nowhere to put them, so they are presently
2690+just ignored.
2691+
26372692
26382693Footnotes
26392694---------
@@ -2908,9 +2963,15 @@ letters are omitted.
29082963
29092964#### Extension: `link_attributes` ####
29102965
2911−Parses multimarkdown style key-value attributes on link and image references.
2912−Note that pandoc's internal document model provides nowhere to put
2913−these, so they are presently just ignored.
2966+Parses multimarkdown style key-value attributes on link
2967+and image references. (Since pandoc's internal document model
2968+provides nowhere to put these for links, they are presently just
2969+ignored, but they work for images.)
2970+
2971+ This is a reference ![image][ref] with multimarkdown attributes.
2972+
2973+ [ref]: http://path.to/image "Image title" width=20px height=30px
2974+ id=myId class="myClass1 myClass2"
29142975
29152976#### Extension: `mmd_header_identifiers` ####
29162977
@@ -2953,7 +3014,8 @@ variants are supported:
29533014`markdown_phpextra` (PHP Markdown Extra)
29543015: `footnotes`, `pipe_tables`, `raw_html`, `markdown_attribute`,
29553016 `fenced_code_blocks`, `definition_lists`, `intraword_underscores`,
2956− `header_attributes`, `abbreviations`, `shortcut_reference_links`.
3017+ `header_attributes`, `common_link_attributes`, `abbreviations`,
3018+ `shortcut_reference_links`.
29573019
29583020`markdown_github` (GitHub-flavored Markdown)
29593021: `pipe_tables`, `raw_html`, `tex_math_single_backslash`,