Why are there extra arrowheads in the exported pdf?

original svg file:
pipeline_sar_adc_block_diagram|0x0

code:

#figure(
  image("pipeline_sar_adc_block_diagram.svg", width: 80%),
  caption: [Pipeline SAR ADC Block Diagram],
) <pipeline_sar_adc_block_diagram>

preview:

exported pdf:

Where on earth did those two arrowheads come from?
Was it the svg or typst?

reproduced in typst online:


https://typst.app/project/r2rzWLawDTR6qoL5VXTD3x

I downloaded the SVG file from your project and opened it in Inkscape, and these arrows show up, so I assume it’s the SVG. (Edit, would be interesting why the arrowheads don’t show up in Tinymist, and/or if this is particularly unusual SVG code leading to this different treatment)

2 Likes

I learned from the Chinese community that the svg might contain HTML Foreign Object format. Hence those object are only visible in certain svg viewers.

I think it’s SVG with embedded SVG doesn't export correctly to PDF · Issue #5174 · typst/typst · GitHub.

pipeline_sar_adc_block_diagram.svg
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- 由 Microsoft Visio, SVG Export 生成 pipeline_sar_adc_block_diagram.svg pipeline_sar_adc_block_diagram -->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ev="http://www.w3.org/2001/xml-events"
		xmlns:v="http://schemas.microsoft.com/visio/2003/SVGExtensions/" width="9.7564in" height="4.17189in"
		viewBox="0 0 702.461 300.376" xml:space="preserve" color-interpolation-filters="sRGB" class="st14">
	<v:documentProperties v:langID="2052" v:metric="true" v:viewMarkup="false">
		<v:userDefs>
			<v:ud v:nameU="msvNoAutoConnect" v:val="VT0(1):26"/>
		</v:userDefs>
	</v:documentProperties>

	<style type="text/css">
	<![CDATA[
		.st1 {fill:#ffffff;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-width:3}
		.st2 {fill:#000000;font-family:宋体;font-size:1.99999em}
		.st3 {fill:#000000;fill-opacity:1;stroke:#000000;stroke-opacity:1;stroke-width:0.54347826086957}
		.st4 {fill:none;marker-end:url(#mrkr13-10);stroke:none;stroke-linecap:round;stroke-linejoin:round;stroke-width:3}
		.st5 {font-size:1em}
		.st6 {marker-end:url(#mrkr13-10);stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-width:3}
		.st7 {fill:#ffffff;stroke:none;stroke-linecap:butt;stroke-width:7.2}
		.st8 {fill:#000000;font-family:宋体;font-size:1.16666em}
		.st9 {fill:#000000;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-width:3}
		.st10 {stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-width:3}
		.st11 {marker-end:url(#mrkr13-58);stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-width:3}
		.st12 {fill:#000000;font-family:宋体;font-size:1.00001em}
		.st13 {fill:none;stroke:none;stroke-linecap:round;stroke-linejoin:round;stroke-width:0.75}
		.st14 {fill:none;fill-rule:evenodd;font-size:12px;overflow:visible;stroke-linecap:square;stroke-miterlimit:3}
	]]>
	</style>

	<defs id="Markers">
		<g id="lend13">
			<path d="M 3 1 L 0 0 L 3 -1 L 3 1 " style="stroke:none"/>
		</g>
		<marker id="mrkr13-10" class="st3" v:arrowType="13" v:arrowSize="2" v:setback="5.52" refX="-5.52" orient="auto"
				markerUnits="strokeWidth" overflow="visible">
			<use xlink:href="#lend13" transform="scale(-1.84,-1.84) "/>
		</marker>
		<marker id="mrkr13-58" class="st3" v:arrowType="13" v:arrowSize="2" v:setback="0" refX="-0" orient="auto"
				markerUnits="strokeWidth" overflow="visible">
			<use xlink:href="#lend13" transform="scale(-1.84,-1.84) "/>
		</marker>
	</defs>
	<g v:mID="5" v:index="3" v:groupContext="foregroundPage">
		<title>pipeline_sar_adc_block_diagram</title>
		<v:pageProperties v:drawingScale="0.0393701" v:pageScale="0.0393701" v:drawingUnits="24" v:shadowOffsetX="8.50394"
				v:shadowOffsetY="-8.50394"/>
		<v:layer v:name="连接线" v:index="0"/>
		<g id="shape1-1" v:mID="1" v:groupContext="shape" transform="translate(19.5,-19.5)">
			<title>矩形.13</title>
			<desc>Data Retiming / Digital Error Calibration</desc>
			<v:userDefs>
				<v:ud v:nameU="visVersion" v:val="VT0(15):26"/>
			</v:userDefs>
			<v:textBlock v:margins="rect(4,4,4,4)" v:tabSpace="42.5197"/>
			<v:textRect cx="326.906" cy="257.857" width="653.82" height="85.0394"/>
			<rect x="0" y="215.337" width="653.811" height="85.0394" class="st1"/>
			<text x="80.9" y="265.06" class="st2" v:langID="2052"><v:paragraph v:horizAlign="1"/><v:tabList/>Data Retiming / Digital Error Calibration</text>		</g>
		<g id="shape5-4" v:mID="5" v:groupContext="shape" transform="translate(47.8465,-147.059)">
			<title>矩形</title>
			<desc>S&#38;H</desc>
			<v:userDefs>
				<v:ud v:nameU="visVersion" v:val="VT0(15):26"/>
			</v:userDefs>
			<v:textBlock v:margins="rect(4,4,4,4)" v:tabSpace="42.5197"/>
			<v:textRect cx="56.6929" cy="257.857" width="113.39" height="85.0394"/>
			<rect x="0" y="215.337" width="113.386" height="85.0394" class="st1"/>
			<text x="38.69" y="265.06" class="st2" v:langID="2052"><v:paragraph v:horizAlign="1"/><v:tabList/>S&#38;H</text>		</g>
		<g id="shape6-7" v:mID="6" v:groupContext="shape" transform="translate(445.879,-155.562) scale(-1,1)">
			<title>旋转三角形.132</title>
			<desc>8</desc>
			<v:userDefs>
				<v:ud v:nameU="visVersion" v:val="VT0(15):26"/>
			</v:userDefs>
			<v:textBlock v:margins="rect(4,4,4,4)" v:tabSpace="42.5197"/>
			<v:textRect cx="28.3465" cy="266.36" width="56.7" height="40.8189"/>
			<path d="M56.69 232.34 L0 266.36 L56.69 300.38 L56.69 232.34 Z" class="st1"/>
			<text x="-34.35" y="273.56" transform="scale(-1,1)" class="st2" v:langID="2052"><v:paragraph v:horizAlign="1"/><v:tabList/>8</text>		</g>
		<g id="group25-12" transform="translate(217.925,-147.059)" v:mID="25" v:groupContext="group">
			<title>工作表.25</title>
			<g id="shape9-13" v:mID="9" v:groupContext="shape" transform="translate(113.386,0) scale(-1,1)">
				<title>箭头总汇.139</title>
				<v:userDefs>
					<v:ud v:nameU="visVersion" v:prompt="" v:val="VT0(15):26"/>
				</v:userDefs>
				<path d="M0 300.38 L56.69 300.38 L113.39 257.86 L56.69 215.34 L0 215.34 L0 300.38 Z" class="st1"/>
			</g>
			<g id="shape18-16" v:mID="18" v:groupContext="shape" transform="translate(44.8831,-5.66798)">
				<title>工作表.18</title>
				<desc>Stage 1 SAR</desc>
				<v:textBlock v:margins="rect(4,4,4,4)" v:tabSpace="42.5197"/>
				<v:textRect cx="35.4331" cy="264.943" width="70.87" height="70.8661"/>
				<rect x="0" y="229.51" width="70.8661" height="70.8661" class="st4"/>
				<text x="5.43" y="257.74" class="st2" v:langID="2052"><v:paragraph v:horizAlign="1"/><v:tabList/>Stage<v:newlineChar/><tspan
							x="5.43" dy="1.2em" class="st5">1 SAR</tspan></text>			</g>
		</g>
		<g id="group26-21" transform="translate(501.39,-147.059)" v:mID="26" v:groupContext="group">
			<title>工作表.26</title>
			<g id="shape7-22" v:mID="7" v:groupContext="shape" transform="translate(113.386,0) scale(-1,1)">
				<title>箭头总汇.136</title>
				<v:userDefs>
					<v:ud v:nameU="visVersion" v:prompt="" v:val="VT0(15):26"/>
				</v:userDefs>
				<path d="M0 300.38 L56.69 300.38 L113.39 257.86 L56.69 215.34 L0 215.34 L0 300.38 Z" class="st1"/>
			</g>
			<g id="shape22-25" v:mID="22" v:groupContext="shape" transform="translate(42.5197,-7.08531)">
				<title>工作表.22</title>
				<desc>Stage 2 SAR</desc>
				<v:textBlock v:margins="rect(4,4,4,4)" v:tabSpace="42.5197"/>
				<v:textRect cx="35.4331" cy="264.943" width="70.87" height="70.8661"/>
				<rect x="0" y="229.51" width="70.8661" height="70.8661" class="st4"/>
				<text x="5.43" y="257.74" class="st2" v:langID="2052"><v:paragraph v:horizAlign="1"/><v:tabList/>Stage<v:newlineChar/><tspan
							x="5.43" dy="1.2em" class="st5">2 SAR</tspan></text>			</g>
		</g>
		<g id="shape29-30" v:mID="29" v:groupContext="shape" v:layerMember="0" transform="translate(331.311,-189.579)">
			<title>动态连接线.29</title>
			<desc>7 bits</desc>
			<v:textBlock v:margins="rect(4,4,4,4)" v:tabSpace="42.5197"/>
			<v:textRect cx="28.3465" cy="328.723" width="70" height="24.8035"/>
			<path d="M0 300.38 L28.35 300.38 L28.35 368.86" class="st6"/>
			<rect v:rectContext="textBkgnd" x="7.3466" y="320.323" width="41.9996" height="16.8" class="st7"/>
			<text x="7.35" y="332.92" class="st8" v:langID="2052"><v:paragraph v:horizAlign="1"/><v:tabList/>7 bits</text>		</g>
		<g id="shape30-37" v:mID="30" v:groupContext="shape" v:layerMember="0" transform="translate(445.879,-182.491)">
			<title>动态连接线.30</title>
			<path d="M0 293.29 L38.95 293.29" class="st6"/>
		</g>
		<g id="shape31-42" v:mID="31" v:groupContext="shape" transform="translate(182.492,-187.329)">
			<title>DOT</title>
			<path d="M0 298.13 A2.25 2.25 0 0 1 4.5 298.13 A2.25 2.25 0 1 1 0 298.13 Z" class="st9"/>
		</g>
		<g id="shape32-45" v:mID="32" v:groupContext="shape" v:layerMember="0" transform="translate(186.992,-182.492)">
			<title>动态连接线</title>
			<path d="M0 293.29 L14.37 293.29" class="st6"/>
		</g>
		<g id="shape33-50" v:mID="33" v:groupContext="shape" v:layerMember="0" transform="translate(161.232,-182.492)">
			<title>动态连接线.33</title>
			<path d="M0 293.29 L21.26 293.29" class="st10"/>
		</g>
		<g id="shape34-53" v:mID="34" v:groupContext="shape" v:layerMember="0" transform="translate(184.742,-197.79)">
			<title>动态连接线.34</title>
			<path d="M0 306.34 L0 233.25 L193.81 233.25 L193.81 308.59 L204.44 308.59" class="st11"/>
		</g>
		<g id="shape35-59" v:mID="35" v:groupContext="shape" v:layerMember="0" transform="translate(614.776,-189.579)">
			<title>动态连接线.35</title>
			<desc>9 bits</desc>
			<v:textBlock v:margins="rect(4,4,4,4)" v:tabSpace="42.5197"/>
			<v:textRect cx="39.685" cy="323.054" width="60" height="22.4037"/>
			<path d="M0 300.38 L39.69 300.38 L39.69 368.86" class="st6"/>
			<rect v:rectContext="textBkgnd" x="21.6846" y="315.854" width="36.0011" height="14.4001" class="st7"/>
			<text x="21.68" y="326.65" class="st12" v:langID="2052"><v:paragraph v:horizAlign="1"/><v:tabList/>9 bits</text>		</g>
		<g id="shape36-66" v:mID="36" v:groupContext="shape" v:layerMember="0" transform="translate(20.126,-197.008)">
			<title>动态连接线.36</title>
			<path d="M0 307.46 L11.16 307.46" class="st6"/>
		</g>
		<g id="shape37-71" v:mID="37" v:groupContext="shape" transform="translate(18,-191.339)">
			<title>工作表.37</title>
			<desc>Vin</desc>
			<v:textBlock v:margins="rect(4,4,4,4)" v:tabSpace="42.5197"/>
			<v:textRect cx="14.1732" cy="290.376" width="28.35" height="20"/>
			<rect x="0" y="280.376" width="28.3465" height="20" class="st13"/>
			<text x="5.17" y="293.98" class="st12" v:langID="2052"><v:paragraph v:horizAlign="1"/><v:tabList/>Vin</text>		</g>
	</g>
</svg>
1 Like

It might be, but I still don’t get how font issues could lead to extra arrowheads.

Probably need to ask some SVG/PDF nerds.