pandoc/test/command/svg.md
John MacFarlane cb7b0a6985 Allow em for image height/width in HTML, LaTeX.
- Export `inEm` from ImageSize [API change].
- Change `showFl` and `show` instance for `Dimension` so
  extra decimal places are omitted.
- Added `Em` as a constructor of `Dimension` [API change].
- Allow `em`, `cm`, `in` to pass through without conversion
  in HTML, LaTeX.

Closes #3450.
2017-05-25 22:48:27 +02:00

5.3 KiB

% pandoc -f latex -t icml
\includegraphics{command/corrupt.svg}
^D
[warning] Could not determine image size for 'command/corrupt.svg': could not determine image type
<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Paragraph">
  <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
    <Rectangle Self="uec" StrokeWeight="0" ItemTransform="1 0 0 1 150 -100">
      <Properties>
        <PathGeometry>
          <GeometryPathType PathOpen="false">
            <PathPointArray>
              <PathPointType Anchor="-150 -100" LeftDirection="-150 -100" RightDirection="-150 -100" />
              <PathPointType Anchor="-150 100" LeftDirection="-150 100" RightDirection="-150 100" />
              <PathPointType Anchor="150 100" LeftDirection="150 100" RightDirection="150 100" />
              <PathPointType Anchor="150 -100" LeftDirection="150 -100" RightDirection="150 -100" />
            </PathPointArray>
          </GeometryPathType>
        </PathGeometry>
      </Properties>
      <Image Self="ue6" ItemTransform="1 0 0 1 -150 -100">
        <Properties>
          <Profile type="string">
            $ID/Embedded
          </Profile>
        </Properties>
        <Link Self="ueb" LinkResourceURI="file:command/corrupt.svg" />
      </Image>
    </Rectangle>
  </CharacterStyleRange>
</ParagraphStyleRange>
% pandoc -f latex -t icml
\includegraphics{command/SVG_logo.svg}
^D
[warning] Could not determine image size for 'command/SVG_logo.svg': could not determine SVG size
<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Paragraph">
  <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
    <Rectangle Self="uec" StrokeWeight="0" ItemTransform="1 0 0 1 150 -100">
      <Properties>
        <PathGeometry>
          <GeometryPathType PathOpen="false">
            <PathPointArray>
              <PathPointType Anchor="-150 -100" LeftDirection="-150 -100" RightDirection="-150 -100" />
              <PathPointType Anchor="-150 100" LeftDirection="-150 100" RightDirection="-150 100" />
              <PathPointType Anchor="150 100" LeftDirection="150 100" RightDirection="150 100" />
              <PathPointType Anchor="150 -100" LeftDirection="150 -100" RightDirection="150 -100" />
            </PathPointArray>
          </GeometryPathType>
        </PathGeometry>
      </Properties>
      <Image Self="ue6" ItemTransform="1 0 0 1 -150 -100">
        <Properties>
          <Profile type="string">
            $ID/Embedded
          </Profile>
        </Properties>
        <Link Self="ueb" LinkResourceURI="file:command/SVG_logo.svg" />
      </Image>
    </Rectangle>
  </CharacterStyleRange>
</ParagraphStyleRange>
% pandoc -f latex -t icml
\includegraphics{command/SVG_logo-without-xml-declaration.svg}
^D
[warning] Could not determine image size for 'command/SVG_logo-without-xml-declaration.svg': could not determine SVG size
<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Paragraph">
  <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
    <Rectangle Self="uec" StrokeWeight="0" ItemTransform="1 0 0 1 150 -100">
      <Properties>
        <PathGeometry>
          <GeometryPathType PathOpen="false">
            <PathPointArray>
              <PathPointType Anchor="-150 -100" LeftDirection="-150 -100" RightDirection="-150 -100" />
              <PathPointType Anchor="-150 100" LeftDirection="-150 100" RightDirection="-150 100" />
              <PathPointType Anchor="150 100" LeftDirection="150 100" RightDirection="150 100" />
              <PathPointType Anchor="150 -100" LeftDirection="150 -100" RightDirection="150 -100" />
            </PathPointArray>
          </GeometryPathType>
        </PathGeometry>
      </Properties>
      <Image Self="ue6" ItemTransform="1 0 0 1 -150 -100">
        <Properties>
          <Profile type="string">
            $ID/Embedded
          </Profile>
        </Properties>
        <Link Self="ueb" LinkResourceURI="file:command/SVG_logo-without-xml-declaration.svg" />
      </Image>
    </Rectangle>
  </CharacterStyleRange>
</ParagraphStyleRange>
% pandoc -f latex -t icml
\includegraphics{command/inkscape-cube.svg}
^D
<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Paragraph">
  <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
    <Rectangle Self="uec" StrokeWeight="0" ItemTransform="1 0 0 1 54.75 -65.25">
      <Properties>
        <PathGeometry>
          <GeometryPathType PathOpen="false">
            <PathPointArray>
              <PathPointType Anchor="-54.75 -65.25" LeftDirection="-54.75 -65.25" RightDirection="-54.75 -65.25" />
              <PathPointType Anchor="-54.75 65.25" LeftDirection="-54.75 65.25" RightDirection="-54.75 65.25" />
              <PathPointType Anchor="54.75 65.25" LeftDirection="54.75 65.25" RightDirection="54.75 65.25" />
              <PathPointType Anchor="54.75 -65.25" LeftDirection="54.75 -65.25" RightDirection="54.75 -65.25" />
            </PathPointArray>
          </GeometryPathType>
        </PathGeometry>
      </Properties>
      <Image Self="ue6" ItemTransform="1 0 0 1 -54.75 -65.25">
        <Properties>
          <Profile type="string">
            $ID/Embedded
          </Profile>
        </Properties>
        <Link Self="ueb" LinkResourceURI="file:command/inkscape-cube.svg" />
      </Image>
    </Rectangle>
  </CharacterStyleRange>
</ParagraphStyleRange>