Comments (13)
The hook/filter function only does search/replace etc at table level at the moment. I'd like to have a better approach actually.
Anyway can you post here a minimal example with actual and desired result?
from ox-latex-subfigure.
** Output with actual configuration
#+begin_src emacs-lisp
(setq org-latex-tables-centered nil)
#+end_src
#+LATEX_HEADER: \makeatletter
#+LATEX_HEADER: \g@addto@macro@floatboxreset\centering
#+LATEX_HEADER: \makeatother
#+CAPTION[short caption]: NORMAL FIGURE
#+LABEL: fig:figure
[[~/thesis/figure/a.pdf]]
BECOMES:
\begin{figure}[!htbp]
\centering
\includegraphics{/home/mcg/thesis/figure/a.pdf}
\caption[short caption]{\label{fig:figure}
long caption}
\end{figure}
#+CAPTION[short caption]: SUBFIGURE
#+LABEL: fig:subfigure
#+ATTR_LATEX: :environment subfigure :width 0.49\linewidth :align b
| subcation a) | subcaption b) |
| [[/thesis/figure/a.pdf]] | [[/thesis/figure/b.pdf]] |
BECOMES (no \centering)
\begin{figure}[!htbp]
\caption[short caption]{\label{fig:subfigure}
long caption}
\begin{subfigure}[b]{0.49\linewidth}
\includegraphics{/home/mcg/thesis/figure/a.pdf}
\caption{subcation a)}
\end{subfigure}
\begin{subfigure}[b]{0.49\linewidth}
\includegraphics{/home/mcg/thesis/figure/b.pdf}
\caption{subcaption b)}
\end{subfigure}
\end{figure}
** Desired output
Only with org-latex-tables-centered enabled I get the right output - but that is not an option for me...
#+begin_src emacs-lisp
(setq org-latex-tables-centered t)
#+end_src
#+CAPTION[short caption]: long caption
#+LABEL: fig:subfigure
#+ATTR_LATEX: :environment subfigure :width 0.49\linewidth :align b
| subcation a) | subcaption b) |
| [[/thesis/figure/a.pdf]] | [[/thesis/figure/b.pdf]] |
\begin{figure}[!htbp]
\caption[short caption]{\label{fig:subfigure}
long caption}
\centering
\begin{subfigure}[b]{0.49\linewidth}
\includegraphics{/home/mcg/thesis/figure/a.pdf}
\caption{subcation a)}
\end{subfigure}
\begin{subfigure}[b]{0.49\linewidth}
\includegraphics{/home/mcg/thesis/figure/b.pdf}
\caption{subcaption b)}
\end{subfigure}
\end{figure}
As I said, for me it would be enough to use centering for all cases, no need for a condition. I know mine is a special case, as usually you would just turn on org-latex-tables-centered. But that option conflicts with threeparttable...
So any indication on how to modify the code for my use case would be welcome if you do not want to include another option. For now, I just do not understand why \g@addto@macro@floatboxreset\centering does not center it anyway.
from ox-latex-subfigure.
I see, let's try to replace the default value here https://github.com/linktohack/ox-latex-subfigure/blob/master/ox-latex-subfigure.el#L31 from (centering "")
to (centering "\\centering\n")
to see if it works for you...
from ox-latex-subfigure.
\centering now gets inserted. Thank you!
But I notice now that this was not even causing the problem,
My graph gets off center, because one is wider than the other, and
apparantly within the subfigure environment it gets left aligned.
Which brings me to another question: (or should I open a new issue?)
Do you think it would be possible to somehow include several :width
statements, for each subfigure, to get different sized subfigures? This
came up now, as until now all subfigures were of the same width...)
Or is that too complicated to implement?
All the best,
On 07/03/16 22:34, Quang-Linh LE wrote:
I see, let's try to replace the default value here
https://github.com/linktohack/ox-latex-subfigure/blob/master/ox-latex-subfigure.el#L31
from |(centering "")| to |(centering "\centering\n")| to see if it
works for you...—
Reply to this email directly or view it on GitHub
#3 (comment).
from ox-latex-subfigure.
It's not too complicated to include a list of width etc but then it will be a little messy. A cleaner solution maybe just include a LaTeX fragment/block?
from ox-latex-subfigure.
I kind of found a solution to off-centered figures, just now:
Adding \centering in front of the file:link in the table adds \centering within the subfigure environment, which also resolves my problem for now and could (for my case again) be the default behaviour.
And you are right; for the more specific cases then I will take the LaTeX code block...
((string-match "^\begin{subfigure}({(.?)})?({(.?)})?" row)
Could I add \n \centering\n" in this line to make it default? But where? Thanks again...
from ox-latex-subfigure.
Glad you find a solution. You can insert after this line, (and before %s
)
ox-latex-subfigure/ox-latex-subfigure.el
Line 79 in 9749ee1
from ox-latex-subfigure.
Everything working, nice! Thank you very much again once more...
from ox-latex-subfigure.
Nice, you may also interested in https://github.com/linktohack/synorg, a syntex-like feature but work directly with org mode...
from ox-latex-subfigure.
That looks fine; I have a look these days - does it also work with external pdf viewer (evince)? - just curious, if not the internal one is fine...
from ox-latex-subfigure.
You need to configure the AUCTeX to use Evince as an external viewer, but it should. Working fine for me with Skim on OSX (there are some limitations though...)
from ox-latex-subfigure.
OK - I think I have that configured already... I'll sure give it a try,
that's been bothering me for a long time to always have to search in
the org-mode / pdf...
On 07/03/16 23:55, Quang-Linh LE wrote:
You need to configure the AUCTeX to use Evince as an external viewer,
but it should. Working fine for me with Skim on OSX (there is some
limits though...)—
Reply to this email directly or view it on GitHub
#3 (comment).
from ox-latex-subfigure.
OK, cool, I'm closing this
from ox-latex-subfigure.
Related Issues (13)
- exporting to table HOT 10
- Add file header. HOT 1
- Setting subfigure width HOT 4
- Add this package to MELPA HOT 4
- A little bit better README, too? HOT 3
- Additionnal \end{figure} HOT 11
- Caption / shortcaption export not working HOT 3
- Default subfigure options HOT 4
- `\centering` below figure if not `org-latex-caption-above`
- Export breaks with wrong-type-argument integer-or-marker-p nil HOT 2
- ox-latex-subfigure stopped working in org-mode 9. HOT 10
- brakes table.el HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ox-latex-subfigure.