Re: [O] Best practices for dual HTML/LaTeX export for scientific papers
On Thu, Apr 2, 2015 at 10:30 AM, David Dynerman wrote: > Hi all, > > I’m currently trying to use org mode to write a scientific paper. Here is > my wishlist: > > 4) LaTeX and HTML export > > Have you considered just LaTeX export, and then using pdf2htmlEx https://coolwanglu.github.io/pdf2htmlEX/ to convert to HTML? There are many TeX or PDF -> HTML converters, but that one seems to do it flawlessly. -k.
Re: [O] Best practices for dual HTML/LaTeX export for scientific papers
"Charles C. Berry" wrote: > On Thu, 2 Apr 2015, Rasmus wrote: >> David Dynerman writes: >> >>> 2) Figures containing multiple side-by-side figures with subcaptions >>>(e.g. in LaTeX I would use minipage + subcaption) >> >> For LaTeX you can find solution on this list. I would not know how >> to do it in "plain" HTML. That would be the first step to >> a solution. > > You can get part way just by using a table. I guess the most pragmatic answer for now (and maybe later?) would be to use a MACRO call which translate all the bits and pieces correctly for both HTML and LaTeX at least: - using minipage and subcaption (or something else) for LaTeX - using ??? for HTML Best regards, Seb -- Sebastien Vauban
Re: [O] Best practices for dual HTML/LaTeX export for scientific papers
On Thu, 2 Apr 2015, Rasmus wrote: Hi, David Dynerman writes: [snip] 2) Figures containing multiple side-by-side figures with subcaptions (e.g. in LaTeX I would use minipage + subcaption) For LaTeX you can find solution on this list. I would not know how to do it in "plain" HTML. That would be the first step to a solution. You can get part way just by using a table. #+NAME: as-org #+BEGIN_SRC org #+ATTR_LATEX: :environment figure | [[file:./testa.png]] | [[file:./testb.png]] | #+END_SRC #+BEGIN_SRC emacs-lisp :var y=as-org() :wrap latex (org-export-string-as y 'latex t) #+END_SRC #+BEGIN_SRC emacs-lisp :var y=as-org() :wrap html (org-export-string-as y 'html t) #+END_SRC With ob-org.el loaded, the two elisp blocks will produce tables of images in the latex and html backends. Some further work is needed to adjust the `width=...' of the latex result and to put captions in the right places in both latex and html. Using the babel blocks makes it easy to see what might be needed. In the end, I expect a filter would be used rather than babel blocks. HTH, Chuck
Re: [O] Best practices for dual HTML/LaTeX export for scientific papers
Hi, David Dynerman writes: > 1) Citations to an external bibliography I use a home-brewed solution. If your requirements are modest there's also ox-bibtex.el in addition to John's package (which I haven't tried). In the future there may be a "official" solution. > 2) Figures containing multiple side-by-side figures with subcaptions (e.g. in > LaTeX I would use minipage + subcaption) For LaTeX you can find solution on this list. I would not know how to do it in "plain" HTML. That would be the first step to a solution. > 3) In-document links (i.e., cross references) to figures (e.g., “See Figure > 1”) Can't you just do: #+NAME: fig #+CAPTION: caption [[file:fig.png]] See figure [[fig]] > 4) LaTeX and HTML export ox stands for org export. A number of backends including LaTeX and html are supported. It's documented in the manual. > Is it an issue of adding some functionality to the HTML exporter? Patches are welcome, but you should aim to target as all relevant backends. For your own solution you can use filters or you can ox-publish and change the functions that you desire to change. Hope it helps, Rasmus -- Send from my Emacs
Re: [O] Best practices for dual HTML/LaTeX export for scientific papers
#1 org-ref does an ok job with this. It isn't as good at html output as for latex output (because latex has a dedicated citation processor via bib(la)tex, and org-ref has a hackery for generating mostly ok entries from the bibtex file, for the common types I have used.). For example, you often need to escape things like % and & in bibtex, and there is limited support for removing those in org-ref. Also, org-ref currently does not support latex in the bibtex entries for html output. There is potential for this by replacing fragments with images, but I probably won't look into that until the summer. The output style is user-customizable, but currently somewhat limited. I may look into improving this over the summer to make it more flexible. Cannot comment on #2. I solve this by manually by putting both figures in a single image file, and using a single caption with a) and b) in the caption text. #3 I just pushed a small enhancement to org-ref that makes the ref links point to a #id in the html document. this works for figures at least. It will take some post processing to change the link from the label to a number, and maybe a custom exporter to do that. A temporary solution is to label your figures with numbers, e.g. #+LABEL: fig:1. It isn't pretty, but it would be functional. David Dynerman writes: > Hi all, > > I’m currently trying to use org mode to write a scientific paper. Here is my > wishlist: > > 1) Citations to an external bibliography > 2) Figures containing multiple side-by-side figures with subcaptions (e.g. in > LaTeX I would use minipage + subcaption) > 3) In-document links (i.e., cross references) to figures (e.g., “See Figure > 1”) > 4) LaTeX and HTML export > > This seems like a modest set of requirements, but I’ve had trouble getting it > going. > > For #1, I’m currently using John Kitchin’s org-ref package. This is nice - it > gives me an HTML bibliography, but it has it’s own link syntax for > in-document links to figures that doesn’t export to HTML. Thus I have to use > org-ref style links for citations, but regular org-style links for figure > cross references. > > I haven’t figured out how to do #2. Is this currently possible? Is it an > issue of adding some functionality to the HTML exporter? > > For #3, I’m currently using #+LABEL: fig:foo, followed by [[fig:foo]]. Is > this the suggested way of doing it? > > The hard part seems #4: org-ref gives a workable HTML bibliography, but I run > into some other issues listed above. > > Can anyone suggest some “Best practices” for the above? I’d be willing to > collect these into a list, which I think would be really helpful for new > users. I’d also be willing to look into adding this functionality, if someone > could suggest a good way for it to fit into the codebase/framework. > > Thank you, > David -- Professor John Kitchin Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803 @johnkitchin http://kitchingroup.cheme.cmu.edu
Re: [O] Best practices for dual HTML/LaTeX export for scientific papers
On Thursday, 2 Apr 2015 at 09:30, David Dynerman wrote: > Hi all, > > I’m currently trying to use org mode to write a scientific paper. Here is my > wishlist: I only ever target LaTeX so cannot help with the HTML end of things. > 1) Citations to an external bibliography John Kitchin's org-ref package is probably the way to go. I don't use it but use simply [[cite:blah-et-al]] which exports, in LaTeX, to \cite{blah-et-al} and I make sure that my org-latex-pdf-process runs bibtex on the resulting LaTeX. > 2) Figures containing multiple side-by-side figures with subcaptions (e.g. in > LaTeX I would use minipage + subcaption) Not sure how to do this. > 3) In-document links (i.e., cross references) to figures (e.g., “See Figure > 1”) What you currently do is what I do, labelling with #+label: fig-label and referring via [[fig-label]]). > 4) LaTeX and HTML export I don't bother with the latter although you may be able to use one of the LaTeX to HTML converters out there to good effect (pandoc, htlatex)? The recent developments on citation syntax for org may help resolve some of the issues with multiple export targets for scientific papers, however. Stay tuned! HTH, eric -- : Eric S Fraga (0xFFFCF67D), Emacs 25.0.50.1, Org release_8.3beta-921-gfd8c84
[O] Best practices for dual HTML/LaTeX export for scientific papers
Hi all, I’m currently trying to use org mode to write a scientific paper. Here is my wishlist: 1) Citations to an external bibliography 2) Figures containing multiple side-by-side figures with subcaptions (e.g. in LaTeX I would use minipage + subcaption) 3) In-document links (i.e., cross references) to figures (e.g., “See Figure 1”) 4) LaTeX and HTML export This seems like a modest set of requirements, but I’ve had trouble getting it going. For #1, I’m currently using John Kitchin’s org-ref package. This is nice - it gives me an HTML bibliography, but it has it’s own link syntax for in-document links to figures that doesn’t export to HTML. Thus I have to use org-ref style links for citations, but regular org-style links for figure cross references. I haven’t figured out how to do #2. Is this currently possible? Is it an issue of adding some functionality to the HTML exporter? For #3, I’m currently using #+LABEL: fig:foo, followed by [[fig:foo]]. Is this the suggested way of doing it? The hard part seems #4: org-ref gives a workable HTML bibliography, but I run into some other issues listed above. Can anyone suggest some “Best practices” for the above? I’d be willing to collect these into a list, which I think would be really helpful for new users. I’d also be willing to look into adding this functionality, if someone could suggest a good way for it to fit into the codebase/framework. Thank you, David signature.asc Description: Message signed with OpenPGP using GPGMail