FYI I've implemented this approach at https://github.com/chrisjsewell/ipypublish#latex-metadata-tags :)
On Thursday, 23 March 2017 21:03:56 UTC, Thales Maia wrote: > > I appreciate your concern! > > I found this old blog which tries to workaround this problem editing cell > metadata, which I think not to be a problem. > http://blog.juliusschulz.de/blog/ultimate-ipython-notebook > > The problem is that it doesn't work and I can't find a good reference to > build jinja2 template for nbconvert and fix it! > I will try your suggestion and reply with the results. > > Thanks > > Em quarta-feira, 22 de março de 2017 14:36:06 UTC-3, Mike Pacer escreveu: >> >> Hi Thales, >> >> I've been thinking about this and the best solution I can think of would >> be to save the figures to disk, and explicitly invoke them with the >> traditional >> >> \begin{figure} >> … >> \caption{ \label{fig:your-label} your caption.}} >> \end{figure} >> >> I think should be able to do this with a simple markdown LaTeX >> invocation, but it may require using a nbconvert raw cell. >> >> Note: this won't look good in the browser itself, but it will work on >> export. >> >> Other than that, this is something that we've been talking about how to >> implement for a while. The current thought is that we might want to create >> a new IPython Figure class that allows you to programmatically set this >> kind of metadata so that it is attached directly to your outputs. >> >> In terms of equations, you should be able to specify a label inside the >> equation \begin{equation} \label{eq:your-label} … \end{equation}. However, >> specifying a ref in line is somewhat more challenging. The problem is that >> MathJax (what we use in the notebook browser to display maths) only >> (ostensibly) surfaces math mode via its commands. As a result of that, >> everything that is captured by LaTeX that isn't a `\begin{blah}…\end{blah}` >> command is automatically assumed to be in math mode, and I do not believe >> that `\ref` (or better `\autoref` since we use the `hyperref` package in >> the default template) work inside math mode. I'll try to think about a >> better way to solve this…maybe using something like the data-attribute >> trick we use for citations (e.g., <a data-cite="pacer2015">(Pacer, >> 2015)</a>), because this should be possible. >> >> Cheers, >> M >> >> >> On Tue, Mar 21, 2017 at 1:17 PM, Thales Maia <[email protected]> wrote: >> >>> Hi, >>> >>> I'm intending to use jupyter for all my writing needs, but I'm having >>> lot of trouble exporting to latex for my students. >>> I've made a tplx (jinja2) template to export my notebook and is working, >>> but I'm having trouble to cross-reference my figures when exporting. >>> >>> I need to set \label{fig:x} so latex can found it. Can someone please >>> point a doc where I can found a solution? >>> I also have the same problem with equation and reference. >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Project Jupyter" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to [email protected]. >>> To post to this group, send email to [email protected]. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/jupyter/79c2cdaf-a076-4a7e-a28c-f44a4d285e4f%40googlegroups.com >>> >>> <https://groups.google.com/d/msgid/jupyter/79c2cdaf-a076-4a7e-a28c-f44a4d285e4f%40googlegroups.com?utm_medium=email&utm_source=footer> >>> . >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> -- You received this message because you are subscribed to the Google Groups "Project Jupyter" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jupyter/d6781862-78c4-4685-922d-ce3d5f7c35a5%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
