2017-04-10 30 views
0

如何在生成的pdf中設置圖形或圖像大小?在orgmode中使用dot來創建latex-pdf,我該如何設置grap的大小?

在組織模式使用此代碼:

#+BEGIN_SRC dot :file hallo1_1_1.png 
digraph hallo1_1_1 { 
    A [shape = "circle",style=filled, fillcolor=yellow]; 
    } 
    #+END_SRC 

一個巨大的頁面填充黃色pixeled畫圓。 如何設置圖像大小和分辨率? 謝謝。

+0

讓點在大尺寸上生成形狀,然後在答案中使用'attr_latex'機制縮小它可能會更好。這將避免你觀察到的像素化。但是你可能不得不增加邊界的厚度,否則可能會變得有點不合適。像這樣的東西應該工作:'A [shape =「circle」,width = 10,penwidth = 2,style = filled,fillcolor = yellow];' – Nick

+0

找到解析解決方案:D。 [鏈接 - > StackOverFlow](http://stackoverflow.com/questions/1286813/how-do-i-set-the-resolution-when-converting-dot-files-graphviz-to-images) –

+0

得到解決方案的解決方案找到。 [鏈接 - > StackOverFLow](http://stackoverflow.com/questions/1286813/how-do-i-set-the-resolution-when-converting-dot-files-graphviz-to-images) –

回答

1

您可以隨時添加特定膠乳(或HTML)屬性傳送給源塊的結果:

#+BEGIN_SRC dot :file hallo1_1_1.png 
digraph hallo1_1_1 { 
    A [shape = "circle",style=filled, fillcolor=yellow]; 
    } 
#+END_SRC 

#+attr_latex: :width 2cm 
#+RESULTS: 
[[file:hallo1_1_1.png]] 

文檔here

+0

非常感謝。我永遠不會想到改變PNG的想法。通常,我通過在整個組織文件上運行「c-c e」來生成pdf。在這種情況下,#+ RESULTS部分將不會顯示。謝謝。現在,我只是將#RESULT部分添加到我的「點」片段(如果您知道我的意思)。解決問題 –

+0

您不需要手動添加'#RESULT'節;只需在源代碼塊中輸入「C-c C-c」,它就會出現(你可以點擊圖像鏈接查看它)。 – Juancho

0

您可以在標題中設置dpi選項。

#+headers: :file file.gif :cmdline -Tgif -Gdpi=100 
#+begin_src dot 
digraph g { 
... 
} 
#+end_src 
+0

不幸的是,這並沒有奏效。我無法設置該決議。 –

+0

找到了解決方案解決方案。 [鏈接 - > StackOverFLow] [1] [1]:http://stackoverflow.com/questions/1286813/how-do-i-set-the-resolution-when-converting-dot-files-graphviz-到圖像 –

相關問題