How to use SyncTeX with Org-mode? - emacs

Background
With SyncTeX you can get forward and backward search between a source document and the typeset material. More specifically:
Forward search is to jump from a particular place in the source document, e.g. a LaTeX file, to the corresponding place in the typeset material, e.g. a PDF file.
Backward search is to jump from a particular place in the typeset material, e.g. a PDF file, to the corresponding place in the source document, e.g. a LaTeX file.
With Org-mode you can export as LaTeX and process it to PDF.
Question
It would be useful to be able to do forward and backward search between an Org-mode file and the PDF it produces on LaTeX export. Is this possible?
As mentioned, SyncTeX already implements forward and backward search between a LaTeX file and its resulting file. So the missing link seems to be the jump between the Org-mode file and the LaTeX file it is exported as.
I found a similar question on the mailing list: [Orgmode] synctex!! ...syncorg? It got no answer involving a solution.

There is a recent (April 2013) thread on the org-mode mailing list which has some preliminary patches. However, reading the emails, it seems like it's a tricky problem.

There is a more recent (depending on your frame of reference) post from October 2013 which has a solution. However, I have not been successful with that code, and re-raised the issue in this thread.

Related

Merge 2 pdf files and preserve forms

I'd like to merge at least 2 PDF files into one while preserving all the form elements in the original PDFs. The form elements include text fields, radio buttons, check boxes, drop down menus and others. Please have a look at this sample PDF file with forms:
http://foersom.com/net/HowTo/data/OoPdfFormExample.pdf
Now try to merge it with any other arbitrary PDF file.
Can you do it?
EDIT: As for the implementation, I'd ideally prefer a command line solution on a linux plattform using open source tools such as 'ghostscript', or any other tool that you think is appropriate to solve this task.
Of course, everybody is welcome to supply any working solution to this problem, including a coded solution that involves writing a script which makes some API calls to a pdf-processing library. However, I'd suggest to take the path of least resistance first (CMD Solution).
Best Regards
EDIT #2: Well there are indeed several CMD tools that merge PDFs. However, these tools don't seem to, AFAIK, to preserve the forms in the original PDFs! These tools appear to simply just concatenate the printouts of all those PDFs into a single Printout, which is then presented as a single PDF.
Furthermore, If you printout a PDF file with forms into a file, you lose all the forms in it. This clearly not what I'm looking for.
I have found success using pdftk, which is an open-source software that runs on linux and can be called from your terminal.
To concatenate multiple pdfs into one (and preserve form-fillable elements), you can use the following command:
pdftk input1.pdf input2.pdf cat output output-file.pdf

Include *prewritten* documentation in Doxygen

To distinguish this question from Doxygen: Adding a custom link under the "Related Pages" section which has an accepted answer that is not a real answer to the question, I specifically add prewritten to the question.
What I want:
Write one document tex file (without preamble, since this file will be \input-ed into a full document)
Import the document into Doxygen's HTML output.
Using Doxygen to produce tex file will probably not work, since it does too much layout work [This holds for its HTML output too like empty table rows 2015]. If Doxygen takes some other input that can easily be transformed into LaTeX, that will do.
You can easily add an already existing Latex file to your doxygen documentation using \latexonly\input{yourfile}\endlatexonly.
I would assume you put it e.g. under a doxygen \page.

how can I display knitR markdown in a pandoc rendered pdf

I wish to show the knitR code in the final PDF together with its execution result.
I did not find yet a working way to fence "tripple-backticks"{r}..."tripple-backticks" blocks in the knitR code and see them as-is in the final PDF.
The backticks get interpreted whatever I do.
This is for tutorial purpose so that people see how to write knitR markdown. The use of html "pre" tags around the block of code leads to removal of the code.
for instance I wish to see this example fully first and then the result thereof
adding 4 spaces before each line like here does not work in RStudio and knit HTML fails
```{r test-haskell, engine='haskell', engine.path='ghc', cache=TRUE}
[x | x <- [1..10], odd x]
```
follow-up addition
I include here some RStudio Rmd code that leads to unexpected PDF content
in the pdf, the pre-code block simply disappeared.
The only fix I found is to invent a fake tag 'rmd' to fence the pieces of markdown I wish to keep as-is. I suspect this is a pandoc issue rather than knitr, unless there is a better way to fence code in knitr. The code I wish to keep can be any of bash, perl, R, or any other manguage used to process the data in the knitr tutorial.
my pandoc command was:
pandoc --variable=geometry:'top=1.5cm, bottom=1.5cm, left=2cm,
right=1cm' --variable=papersize:'a4paper' --number-sections
--table-of-contents --template=default.latex --highlight-style tango testrmd.md -o testrmd.pdf
Can it come from the template I used (default.latex)? It is the only template I found that meets my needs for vignette-like output. Same about 'tango' which is the only coloring scheme that shows some light background in code blocks.
As you see from the screenshots above I am a new-bee here (both in markdown and latex). Thanks for any help

diff tool with extra highlighting

GitHub's diff viewer has a nice feature that it has extra highlighting on changed lines. For example, in this diff, just a single word was inserted:
Are there other tools that display a diff like this? Pastebin's diff viewer and http://www.quickdiff.com/ don't do this, and even GitHub's gist doesn't do this if you tell it to highlight a .diff file.
I'd like some way to take two files or the output of diff and show this nice output without having to put it on GitHub. Does anything exist?
Kompare is able to highlight differences in a viewed patch, although it displays the file content in two different panes and not line over line like in your picture.
For diffing with highlighting I like KDiff3 better, but it will require two files to compare, it does not operate directly on patch files like kompare can.

Microsoft Word to Org-mode

I am trying to put the Microsoft Word document in emacs using org-mode. I have copied the Word Document and pasted in emacs. I like to achieve the headings like 7.1.2.4 in org-mode format.
and then link the TOC to appropriate headings. How I can do that? Any suggestions? Any programming language like Perl has done it?
Thanks.
There is ODT2ORG (https://bitbucket.org/josemaria.alkala/odt2org/wiki/Home) which lets you import odt files in org-mode.
Use Openoffice/Libreoffice to produce an .odt from your .doc.
Use odt2org to get an .org.
About the headings: I am not entirely sure I understand you.
there is org-toc.el included in org-mode that provides a seperate buffer with a TOC of your current document (like in Reftex). All the entries there are already links to the individual headings. Also, an exported document will have a TOC included by default without your intervention.
Orgmode does not support automatically numbered headings (yet). However, if you want to export your document to html, docbook, latex, or pdf, your headings will appear numbered and nested (you can tweak the settings quite a lot).
I doubt that you will get your intended result purely automatically but it should work 70% automatically, especially if you have latex installed and simply want to have a good-looking pdf in the end. Convert doc to odt, convert odt to org, open and type "C-c C-e d".
Another option: Save as an HTML file, then use Pandoc to convert the HTML to an .org file.
I've converted loads of Word documents into Org files. It takes minutes to do it by hand.
If you want cross-references, use internal links (4.2 in the current manual).
The * and ** style headings are always likely to be there in Org. Think of the use case where exports are compiled from #+INCLUDEd files, or you have done a selective export using tags. Any kind of single sourcing technology isn't going to display the numbering.
There is a ruby gem which converts doc to md. With pandoc you can convert to org.
https://github.com/benbalter/word-to-markdown