emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Tikz ugly hack
@ 2022-10-26  8:52 edgar
  2022-10-26  9:58 ` Fraga, Eric
  0 siblings, 1 reply; 3+ messages in thread
From: edgar @ 2022-10-26  8:52 UTC (permalink / raw)
  To: emacs-orgmode

Dear Org users,

I just want to share a way to combine Tikz (LaTeX) with figures (svg, 
png...). This may be needed to add elements (e.g. annotations) to your 
figure. The figure may still be exported with other back-ends (without 
annotations). If you know of a better way of doing this, please, let me 
know. Thanks.

#+latex_header: \usepackage{adjustbox,tikz}
#+latex_header: \newcommand*{\DrawGrid}{\draw[step=.2cm,help lines] 
(current bounding box.south west) grid (current bounding box.north 
east);}
#+latex_header: \newcommand*{\DrawBoundingBox}[2]{% 
https://tex.stackexchange.com/a/542819
#+latex_header:     \draw [red, very thick, rounded corners]
#+latex_header:     ([shift={(#1)}]current bounding box.south west)
#+latex_header:     rectangle
#+latex_header:     ([shift={(#2)}]current bounding box.north east);}
#+begin_export latex
\begin{tikzpicture}
   % left bottom right top
   \node {\adjustbox{height=0.7\textheight,trim=45.6mm 0mm 155mm 20mm, 
clip=true}{
#+end_export
   #+attr_latex: :height "" :width "" :options "" :center nil
   [[file:../diagram.svg]]
#+begin_export latex
   }};
   \DrawBoundingBox{5.7cm,0.71cm}{-0.1cm,-3.6cm}
   % \DrawGrid
\end{tikzpicture}
#+end_export


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-10-28  8:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-26  8:52 Tikz ugly hack edgar
2022-10-26  9:58 ` Fraga, Eric
2022-10-28  8:45   ` edgar

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).