{{- $links := slice -}}
{{- $page := . -}}
{{- $pdf := .Params.pdf -}}
{{- if not $pdf }}
{{- with .Resources.Match "{paper,journal}/*.pdf" }}
{{- range first 1 . }}
{{- $pdf = .RelPermalink -}}
{{- end }}
{{- end }}
{{- end -}}
{{- with $pdf }}{{ $links = $links | append (printf "PDF" .) }}{{ end -}}
{{- $poster := .Params.poster -}}
{{- if not $poster }}
{{- with .Resources.Match "poster/*.pdf" }}
{{- range first 1 . }}
{{- $poster = .RelPermalink -}}
{{- end }}
{{- end }}
{{- end -}}
{{- with $poster }}{{ $links = $links | append (printf "Poster" .) }}{{ end -}}
{{- $talk := .Params.talk -}}
{{- if not $talk }}
{{- with .Resources.Match "talk/*.pdf" }}
{{- range first 1 . }}
{{- $talk = .RelPermalink -}}
{{- end }}
{{- end }}
{{- end -}}
{{- with $talk }}{{ $links = $links | append (printf "Slides" .) }}{{ end -}}
{{- with .Params.video }}{{ $links = $links | append (printf "Video" .) }}{{ end -}}
{{- with .Params.code }}{{ $links = $links | append (printf "Code" .) }}{{ end -}}
{{- with .Params.doi }}{{ $links = $links | append (printf "DOI" .) }}{{ end -}}
{{- $matlab := .GetPage "matlab" -}}
{{- with $matlab }}{{ $links = $links | append (printf "Matlab" .RelPermalink) }}{{ end -}}
{{- $python := .GetPage "python" -}}
{{- with $python }}{{ $links = $links | append (printf "Python" .RelPermalink) }}{{ end -}}
{{- $tikz := .GetPage "tikz" -}}
{{- with $tikz }}{{ $links = $links | append (printf "TikZ Figures" .RelPermalink) }}{{ end -}}
{{ partial "research/link-row.html" (dict "links" $links "class" "pub-links-centered") }}