Giter VIP home page Giter VIP logo

ox-latex-subfigure's Introduction

How

(package-initialize)
(use-package ox-latex-subfigure
  :init
  (setq org-latex-prefer-user-labels t)
  :load-path "~/Dropbox/ProjectWeekends/lisp/ox-latex-subfigure/"
  :config (require 'ox-latex-subfigure))

; (add-to-list 'org-latex-caption-above 'subfigure) ; If you want the caption above the figure
#+LATEX_HEADER: \usepackage{subcaption}
#+NAME: fig:hello
#+CAPTION: Use figure/subfigure instead of tabular, remember to set =:environment=
#+ATTR_LATEX: :environment subfigure :width 0.4\textwidth :align c
| [[~/Desktop/figure_1.png]] | <<fig:hello_subfigure>> tttttt |
| zzzzz                      | [[~/Desktop/figure_1.png]]     |

Ordinary linking works as usual [[fig:hello]]; internal org-mode linking also work [[fig:hello_subfigure]] if one has org-latex-prefer-user-labels set to t.

\begin{figure}[!htb]
\centering
\begin{subfigure}[c]{0.4\textwidth}
\includegraphics[width=.9\linewidth]{/Users/link/Desktop/figure_1.png}
\caption{zzzzz}
\end{subfigure}
\begin{subfigure}[c]{0.4\textwidth}
\includegraphics[width=.9\linewidth]{/Users/link/Desktop/figure_1.png}
\caption{\label{fig:hello_subfigure} tttttt}
\end{subfigure}
\caption{\label{fig:hello}
Use figure/subfigure instead of tabular, remember to set \texttt{:environment}}
\end{figure}
#+CAPTION: Plot.
#+ATTR_LATEX: :environment subfigure :width 0.475\textwidth :align c
| [[file:ynglg_k0104.svg]] |
| <<fig-0104>>                                   |
| keepaspectratio,height=\textheight,width=0.98\linewidth             |
\begin{figure}[htbp]
\centering
\begin{subfigure}[c]{0.475\textwidth}\centering
\includesvg[keepaspectratio,height=\textheight,width=0.98\linewidth]{ynglg_k0104}
\caption{\label{fig-0104}}
\end{subfigure}
\caption{Plot.}

\end{figure}

Contributions

  • @eoma for org-mode 9 compatibility
  • Edgar <[email protected]>
    • SVG support
    • Options (width etc)

License

GPL

ox-latex-subfigure's People

Contributors

linktohack avatar eoma avatar diadochos avatar gregoryschwartz avatar tdehaeze avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.