Multilingual Wiki Documentation

You are currently using syntax.
In an attempt to improve PlantUML documentation...
Please do not use this website for your own diagrams.
You can click here and use the online server here for your own documentation.

Wiki Toc    View page history    Add new chapter    Reorder page    Raw


LaTeX

LaTeX Support in PlantUML

PlantUMLバージョン7997以降では、Tikzパッケージを利用して ダイアグラムをLaTeX形式で出力することができるようになりました。

ただし、これはベータ版の機能であり、正常に動作しない部分もあるかもしれません。誰にも利用されない機能に時間を割く余裕はないため、ユーザからのバグ報告を待っています。

コマンドライン-tlatexフラグを使用するか、Antタスクformat="latex"を使用してください。

LaTeX出力を直接他のLaTeXドキュメントに埋め込みたい場合は、-tlatex:nopreambleを 使用してください。この場合PlantUMLは、プリアンブル無しでtikz画像のみを出力します。

Embedding in LaTeX Documents

If you're aiming to incorporate the LaTeX output directly within another LaTeX document, employ the -tlatex:nopreamble flag. By doing so, PlantUML will output only the tikz-picture component, excluding the document preamble, facilitating a seamless integration into your existing LaTeX files.

If you want to incorporate the LaTeX output directly within another LaTeX document, use option -tlatex:nopreamble. PlantUML will output only the tikz-picture component, excluding the document preamble, facilitating a seamless integration into your existing LaTeX files.
WARNING
 This translation need to be updated. 
WARNING

As of version 7997, PlantUML has introduced the feature to generate diagrams directly into LaTeX, leveraging the capabilities of the Tikz package.

Beta Version Notice

Please be aware that this functionality is currently in beta. While it adds a promising direction for PlantUML, it might contain bugs or unsupported features. We encourage users to actively report any issues encountered on first forum (Q&A) thread listed below to help us improve this feature based on actual user feedback and needs.

How to Use LaTeX Generation

To use LaTeX generation, apply the following settings in your PlantUML environment:
  • Use the -tlatex flag when operating through the command line.
  • Set format="latex" when configuring the Ant task.

Embedding in LaTeX Documents

If you want to incorporate the LaTeX output directly within another LaTeX document, use option -tlatex:nopreamble. PlantUML will output only the tikz-picture component, excluding the document preamble, facilitating a seamless integration into your existing LaTeX files.

クラス図の例

Class diagram example

@startuml
class Subscriber {
subscriberId
}

class AccumUsage {
subscriberId
}

class IpSession {
ipAddress
specificData
sapcOriginStateId
apnId
}

Subscriber "1" -[#blue]-> "1..*" IpSession
Subscriber "1" --> "0..1" AccumUsage
@enduml

オンラインで結果を確認 (TODO: #362)

WARNING
 This translation need to be updated. 
WARNING

@startuml
class Subscriber {
  subscriberId
}

class AccumUsage {
  subscriberId
}

class IpSession {
  ipAddress
  specificData
  sapcOriginStateId
  apnId
}

Subscriber "1" -[#blue]-> "1..*" IpSession
Subscriber "1" --> "0..1" AccumUsage
@enduml

シーケンス図の例

Sequence diagram example

@startuml
Bob -> Alice: hello
return Ok
@enduml

オンラインで結果を確認 (TODO: #362)

(TODO: #362 provide some examples in Overleaf)
WARNING
 This translation need to be updated. 
WARNING

@startuml
Bob -> Alice: hello
return Ok
@enduml

(TODO: #362 provide some examples in Overleaf)

Creating Links in LaTeX with the hyperref Package

When utilizing the hyperref package in your LaTeX documents, you have the ability to craft links that lead to defined anchors within the same LaTeX/PDF document. In the PlantUML example below, notice that the second and last links point to a specific resource within the LaTeX document:

@startuml
participant Bob   [[http://www.yahoo.com]]
participant Alice [[latex://resource-interaction]]
Bob -> Alice :    [[http://www.google.com]] hello
Bob -> Alice :    [[latex://resource-interaction]] interact
@enduml

For a detailed discussion and related queries, see the second Q&A thread below.

Links

  • Q&A 1798: Latex TikZ support
  • Q&A 3558: export to TikZ loses links
  • Q&A 10761: Latex export limitations (font size, hyperlinks, PNG in header, scaling image to page)
  • Q&A 10788: How to set Latex Font Size
  • Latex PlantUML package (Oliver Kopp 2018-2023): home, Github, CTAN
  • Stackoverflow 71409448 PlantUML in Latex
    • Extra idea: use Markdown with Pandoc (LaTeX runs under the hood to generate PDF files): PlantUML diagrams work fine
  • TeX Exchange 428174: Can I use the plantUML language in LaTeX? Yes, and prerequisites to install are listed


Please report any bugs to plantuml@gmail.com or here.
This website is still in beta testing.