0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

typstでpdf形式の図を入れる

Last updated at Posted at 2025-02-17

はじめに

LaTeXではjpg画像やpng画像と同じ記法でpdf形式の図も挿入することが可能ですが,現在のところTypstではそのようなことはできません.そこで,Typstでpdf形式の図を埋め込む方法を説明します.

方法

muchpdf というライブラリを用いることでpdf形式の図を挿入することが可能です.muchpdf を使用する際には,#import "@preview/muchpdf:0.1.0": muchpdf でインポートします.以下のコードをコンパイルします.

#import "@preview/muchpdf:0.1.0": muchpdf

画像を挿入するよ.
#figure(
  muchpdf(
    read("figure/sine_wave.pdf", encoding: none),
  width: 10cm,
  ),
  caption: [
    sine wave.
  ]
)
画像を挿入したよ.

出力結果は以下の通りです.
#figure()を使うことで中央揃えやキャプションの設定などを用いることができます.

image.png

参考文献

0
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?