Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export notebook to latex with citations fail #39

Open
danielcoral opened this issue Nov 24, 2021 · 3 comments
Open

Export notebook to latex with citations fail #39

danielcoral opened this issue Nov 24, 2021 · 3 comments

Comments

@danielcoral
Copy link

danielcoral commented Nov 24, 2021

Hi,

Extremely useful extension, thanks for the hard work. I have an issue with numeric styles (e.g. Vancouver). It all looks fine within JupyterLab, but when I tried exporting the notebook to latex then the first citation is exported correctly, while the rest are not:

In JupyterLab:

Mbatchou J, Barnard L, Backman J, Marcketta A, Kosmicki JA, Ziyatdinov A, et al. Computationally efficient whole-genome regression for quantitative and binary traits. Nat Genet [Internet]. 2021 Jul [cited 2021 Nov 24];53(7):1097–103. Available from: https://www.nature.com/articles/s41588-021-00870-7
2.
Galinsky KJ, Bhatia G, Loh P-R, Georgiev S, Mukherjee S, Patterson NJ, et al. Fast Principal-Component Analysis Reveals Convergent Evolution of ADH1B in Europe and East Asia. The American Journal of Human Genetics [Internet]. 2016 Mar 3 [cited 2021 Nov 24];98(3):456–72. Available from: https://www.sciencedirect.com/science/article/pii/S0002929716000033
3.
Yengo L, Sidorenko J, Kemper KE, Zheng Z, Wood AR, Weedon MN, et al. Meta-analysis of genome-wide association studies for height and body mass index in ∼700000 individuals of European ancestry. Human Molecular Genetics [Internet]. 2018 Oct 15 [cited 2021 Nov 24];27(20):3641–9. Available from: https://doi.org/10.1093/hmg/ddy271

In the latex file:

    \begin{enumerate}
\def\labelenumi{\arabic{enumi}.}
\item
  Mbatchou J, Barnard L, Backman J, Marcketta A, Kosmicki JA, Ziyatdinov
  A, et al. Computationally efficient whole-genome regression for
  quantitative and binary traits. Nat Genet {[}Internet{]}. 2021 Jul
  {[}cited 2021 Nov 24{]};53(7):1097--103. Available from:
  https://www.nature.com/articles/s41588-021-00870-7
\end{enumerate}

\begin{verbatim}
<div class="csl-left-margin">2. </div><div class="csl-right-inline">Galinsky KJ, Bhatia G, Loh P-R, Georgiev S, Mukherjee S, Patterson NJ, et al. Fast Principal-Component Analysis Reveals Convergent Evolution of ADH1B in Europe and East Asia. The American Journal of Human Genetics [Internet]. 2016 Mar 3 [cited 2021 Nov 24];98(3):456–72. Available from: https://www.sciencedirect.com/science/article/pii/S0002929716000033</div>
\end{verbatim}

\begin{verbatim}
<div class="csl-left-margin">3. </div><div class="csl-right-inline">Yengo L, Sidorenko J, Kemper KE, Zheng Z, Wood AR, Weedon MN, et al. Meta-analysis of genome-wide association studies for height and body mass index in ∼700000 individuals of European ancestry. Human Molecular Genetics [Internet]. 2018 Oct 15 [cited 2021 Nov 24];27(20):3641–9. Available from: https://doi.org/10.1093/hmg/ddy271</div>
\end{verbatim}

@krassowski
Copy link
Owner

Thanks for highlighting it! It might be a simple as adding some spacing for consistency - I will look into this. I will also try to fix the latex mode output (which can be enabled in settings but it appears it has some issues).

@krassowski
Copy link
Owner

Hi @danielcoral thank again for engaging here! I now added proper LaTeX support in #42 which was included in newly released version 0.2.0. It can be enabled by following the steps described in README.md: Exporting to LaTeX. Please let me know if this works for you - I'm curious to see how it fares in real world workflows.

@danielcoral
Copy link
Author

danielcoral commented Dec 7, 2021

I've had just the time to test it. The final PDF includes two numberings, like this:

[1] 1. Bulik-Sullivan BK, Loh P-R, Finucane HK, Ripke S, Yang J, Patterson N, et al. LD
Score regression distinguishes confounding from polygenicity in genome-wide association
studies. Nat Genet [Internet]. 2015 Mar [cited 2021 Dec 7];47(3):291–5. Available from:
https://www.nature.com/articles/ng.3211
[2] 2. Ning Z, Pawitan Y, Shen X. High-definition likelihood inference of genetic correlations across
human complex traits. Nat Genet [Internet]. 2020 Aug [cited 2021 Dec 7];52(8):859–64. Available
from: https://www.nature.com/articles/s41588-020-0653-y
[3] 3. Elsworth B, Lyon M, Alexander T, Liu Y, Matthews P, Hallett J, et al. The MRC IEU OpenGWAS data infrastructure [Internet]. 2020 Aug [cited 2021 Dec 7] p. 2020.08.10.244293. Available
from: https://www.biorxiv.org/content/10.1101/2020.08.10.244293v1

I guess this can be easily fixed manually. Really thanks a lot for the work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants