BeelGroup / Docear-Desktop

Docear's desktop version (GPL)
296 stars 90 forks source link

import mm2latexinput with cites and details #433

Closed stth1998 closed 10 years ago

stth1998 commented 10 years ago

mm2latexinput.xsl has been taken as base and:

refactored

major changes:

minor changes

Due to the many incompatible changes, I created a new file.

it works on my huge mindmap, further tests have to be done. please report with errors and examples to https://github.com/Docear/Desktop/issues/382

stth1998 commented 10 years ago

ah, I forgot:

major change:

this -sadly- only works with xslt extensions:

and the subfiles cannot have the same name as the target as its URI is not accessible in XSLT.

stlanger commented 10 years ago

Hello stth1998,

thanks for your work! :) I had a look at it, but I have not used LaTeX in 8 years, so I've got some questions. Maybe you can help me.

  1. from a mind map I exported to LaTeX. Without any numberings in the mind map it created a tex-file with sections and subsections although you stated one would need to number nodes before that. Is this intended (I like it this way, one can remove them later anyway)? I also did not find any chapters, only sections.
  2. the TeX file itself could not be transformed to pdf right away. The document header was missing. I needed to add a header first and also end the document properly. Is there a reason why you did not add the document's header by default?
  3. if your code needs some more work (bug fixing, improvements, user wishes, ...), would you like to help?
  4. could you please explain your last comment about placing the top level nodes into different files some more? What do you need to issue the command?

When we have tested your code some more, there are no further questions or serious bugs, we will gladly merge it to Docear. :)

Best regards, Stefan

P.S.: For the document's header I have used the following code:

\documentclass[11pt]{article} 
\begin{document}
stth1998 commented 10 years ago

Edit: since my answer is reflected in github i'll translate it....

Hi Stefan

thanks for your work! :) sure, was mostly for me

  1. from a mind map I exported to LaTeX. Without any numberings in the mind map it created a tex-file with sections and subsections although you stated one would need to number nodes before that. Is this intended (I like it this way, one can remove them later anyway)? I also did not find any chapters, only sections. No this is not intended. Is there a node with HTML content? If there is a

    the old rules for richcontent create a \section. if this happens often, this behavior should be changed because it demolishes the structure.

We should think about how to tell the user which prerequisites he has to mind (numbering, etc.) before he exports. Otherwise, he might report a bug instantly. This should also apply for the other exports, I think.

I took numbering as criteria for the section creation because a) it's plausible (layerwise numbering) b) my mindmap has numbering c) i can distinguish nodes for content of chapter-paragraphs from nodes for sections which would be situated in one layer

  1. the TeX file itself could not be transformed to pdf right away. The document header was missing. I needed to add a header first and also end the document properly. Is there a reason why you did not add the document's header by default? exports created by mm2latexartcl and mm2latexbook have the same behaviour. mm2latexinput, which i extended did not. I personally think, it's more practical because you cannot make all latex users happy with your choice of document class and packages.
  2. if your code needs some more work (bug fixing, improvements, user wishes, ...), would you like to help? Minor fixes: sure. Bigger changes: depends on size of task and if it is exciting for me (but it's not that I necessarily have to need it for myself).
  3. could you please explain your last comment about placing the top level nodes into different files some more? What do you need to issue the command? Sure. XSLT-2.0-processors have an option to switch on extensions. They're needed. If such is available, it should work out of docear, too. Usually, you select a target file name in the export function. The XSLT takes away the ".tex" from it and creates several output file names.

Magic starts, where i changed the old main--template (commented out) from:

73: (apply all matching noed-templates on the nodes of the second layer (since we have a central node, this is the first sectional layer))

to:

52: (for every node from the second layer as ".") 60: (change the output file) 61: (and apply the templates on the second layer)

Outside of xsl:result-document the output goes into the user selsected file. It is only filled with \input-commands.

When we have tested your code some more, there are no further questions or serious bugs, we will gladly merge it to Docear. :) Very good.

Best regards, Stefan

Best regards,

Stefan, too

P.S.: For the document's header I have used the following code:

\documentclass[11pt]{article}
\begin{document}

mine is something like 300 lines long long. ;) but you can suround this output by nearly every header. (see my comment for future work)