Lighweight markup (wiki) language for documenting - latex

When I write papers or documentation it makes think using LaTeX or OpenOffice is overkill as I usually only need some markup elements (bold, headlines, lists, ...) . I'd like to write my documents using a wiki style markup as this is very efficient.
For example:
= Introduction =
'''HTML''' is a markup language...
In the end I'd like to simply convert it to PDF. (Cross-platform was nice too.)
compiler.exe -pdf input.wiki output.pdf
Is there a tool (or simple tool chain) to do this job?
I'd personally like to not make use of LaTeX as a transformation step. There are tools doing this job transforming lightweight syntax to TeX and then to PDF/PS.

You might find that MarkDown gets pretty close to what you want.
MarkDown is a simple technique for marking up text files so that they can be post-processed into other forms. One of the nice things about MarkDown is their goal that a marked-up document should be simply readable as a straight text file:
The overriding design goal for
Markdown’s formatting syntax is to
make it as readable as possible. The
idea is that a Markdown-formatted
document should be publishable as-is,
as plain text, without looking like
it’s been marked up with tags or
formatting instructions.
PanDoc looks like it might be good companian tool to convert the MarkDown straight into PDF files. There may well be other choices - PanDoc is just the best tool I found with a quick Google search.

reStructuredText.
You can use Sphinx to generate HTML and LaTeX (and later PDF with pdflatex).
There is also rst2pdf, don't know if it's mature.

You could use Markdown (example) and then use Pandoc (which also works with reStructuredText and several other wiki-like syntaxes) to convert to PDF.

Related

Rmarkdown with pandoc templates, apply lua filter on intermediate .tex

I'm trying to use lua filters to capture images in my manuscript and list their caption in a special \section at the end of it.
I am working on a rmarkdown document that itself uses a .tex template.
I wasn't able to get anywhere, so I run a very simple filter:
function Header (head) print(pandoc.utils.stringify(head)) end
and noticed that just the headers in the markdown were recognized, not the ones in the ones in the template.
The only way I found to have lua filters recognize the elements in the template was to rerun the produced .tex file with pandoc:
pandoc -f latex -t latex -o test2.tex --lua-filter=my_filters.lua test.tex
but that removed all latex formatting and structure content outside the body, e.g., \documentclass, \usepackage and other custom commands. So it's a no go.
So the question is, is there a way to force lua filter to be applied after the integration of a latex template when knitting a rmarkdown document?
There might be a way, but it most likely won't do what you need.
When pandoc reads a document, it parses it and converts it into it's internal data structure. That internal structure can then be modified with a filter. LaTeX is a very expressive and complex document format, and any conversion from LaTeX into pandoc's internal format will result in a loss of (layout) information. That's good enough in most cases, but would be a problem in your case.
There are two possible ways to do this: one is to post-process the output, which is probably tedious and error-prone. The other is to find a way to generate the desired output, e.g. via a pandoc filter, without adding it to the template first.
I believe your other question is the right way to go.

Convert Mathjax ouptut in a readable format for jqmath

On a project, I use ck editor with mathjax plugin in order to insert some formulas.
In a another part of this project, I would like to use jqmath. Cause it's faster and more integrated in wkhtmltopdf (I use those formulas in some docs produced by wkhtmltopdf, and some issues exist with mathjax, especialy over bar).
My problem: syntax is different between mathjax and jqmath. Of course, jqmath doesn't care about my formulas syntaxed under mathjax...
So my question is: does it exist a way to convert maths strings from mathjax to jqmath syntax?
Cheers
Both MathJax and jqmath use MathML internally and both understand it as an input format (jqmath added MathML input support a while back, see the copy-me.html in the distribution). So you can generate MathML from MathJax and feed that into jqmath.

Tools for converting LaTeX equations to Content MathML or OpenMath?

Do you know any open source tools or libraries (preferably Java, but that's not a strict requirement) in the GNU/Linux world that convert mathematical equations in LaTeX syntax to Content MathML or OpenMath?
I need to convert tons of equations in batch mode, so I'm not looking for interactive apps.
EDIT My focus is on the equations' semantics, so I cannot use Presentation MathML (unless there's a converter from Presentation MathML to Content MathML).
Thanks in advance!
This might be what you are looking for: SnuggleTeX
From the site:
SnuggleTeX is a 100% Java library for converting (a reasonable subset of) LaTeX into XHTML + MathML.
SnuggleTeX can attempt to convert input LaTeX to Content MathML by first creating Enhanced Presentation MathML and then processing that. In many ways, this part of the process is relatively simple since most of the semantic structure has already been inferred (though might not necessarily make any sense).
You can also use an online equation editor WIRIS editor which is able to import MathML/Latex and export to MathML/Latex
Have a look over here, where you can find a perl version.
You may want to have a look at LaTeXML. It converts LaTeX to various XML formats, including OpenMath and content MathML.
But be warned, like all other tools, the conversion from (presentation-oriented) LaTeX to content markup (as in OpenMath and MathML) is heuristic. In particular, in ambiguous situations (e.g. $f(a+b)$, which can mean $f$ applied to $(a+b)$ or $f$ times $(a+b)$) LaTeXML chooses one (usually times).
There are two ways out:
1) use content markup already in the LaTeX source (see http://trac.kwarc.info/sTeX)
2) use a better post-processor for LaTeXML is working on this

Ruby on Rails: In there a way to convert word to html?

maybe a way to batch convert also?
You could use Google Docs API to upload and convert .doc's.
http://code.google.com/apis/documents/overview.html
Some samples and code: http://code.google.com/apis/documents/code.html
Ruby example and demo:
http://code.google.com/p/gdata-samples/source/browse/#svn/trunk/doclist/DocListManager
http://doclistmanager.googlecodesamples.com/
The short answer is no, but the long answer is sorta.
MS Word itself will save a file out as html - but it's a total friggin' mess. To an extent this is simply because the customer base that is converting word files to html directly are not concerned about it being sloppy, so Word hasn't worked hard on making a clean output. On the other hand, it's intrinsically difficult, because word is oriented to create fixed size, non-dynamic documents, like a paper-base book. So it's easy to convert to other static formats (say a PDF), but how do you convert to HTML? Do you just make the text flow across? Do you set a width that will hopefully make the layout stay the same? What if there is fonts or layout elements in the word doc that are not available in the HTML renderer?
The easiest thing to do is to do it project by project - you can create a DTD to convert an RTF file, for instance - but this involves you making programmer level decisions about how these will be converted.

How do I cite the title of an article in LaTeX?

I'm using LaTeX and BibTeX for an article, and I want to able to cite the title of an article I reference. What is the command to do this?
I'm using \bibliographystyle{chicago} and it does not appear to be \citeT{}, \citetitle{} or \citeTitle{}
#Norman, and the various commenters, are correct in that it would be difficult to do this with bibtex and other tools. But, there is an alternative. Biblatex does allow this through the command \citetitle. Also, if you really want to, the formatting drivers in biblatex are easily readable and modifiable, but only if you feel the need. Unfortunately, it is not part of any distribution, yet, so it has to be downloaded and installed.
Just type in the title. Even natbib, the most powerful widespread BibTeX package, is not powerful enough to do what you want out of the box. Trying to get BibTeX to extract the title for you, by means of a LateX command, is possible, but it would require that you
Design a new format for bibliography items that is incompatible with existing formats.
Write your own custom .bst file, using the very strange postfix language that is used only by BibTeX, to be compatible with your new format.
Write a new LaTeX command to pull the title information out of the new format.
Speaking as someone who has written several custom bst files as well as a replacement for BibTeX, it's just not worth fooling with. After all, if you are citing the paper, you probably know the title anyway.
EDIT: If you have to do this with multiple papers, I would try to cheat. Extend the bst file so that it writes into the bbl file a command that writes into the aux file the title associated with each bibkey. You can model the bbl command on \label and the actual title-citing command on \ref.
This is how I solve the title issue for cited papers:
In the preamble
include Natbib:
\usepackage[sort&compress]{natbib}
If you want to cite a TITLE instead of an author in the text you define the title like this in the preamble:
\defcitealias{Weiser1996designingcalm}{Designing Calm Technology}
Note:
You need to have a bibtex item (for the title ''Designing Calm Technology'') with the key {Weiser1996designingcalm}.
In the paper where you want to write the cited paper's title
\citetalias{Weiser1996designingcalm}
this results in => Designing Calm Technology (i.e. the text you specified with the \defcitealias command above)
or
\citepalias{Weiser1996designingcalm}
that results in => (Designing Calm Technology) (i.e. title with parenthesis)
This question is old and maybe \citefield was not around back in the days, but now it works like charm for this kind of problems:
\documentclass[varwidth]{standalone}
\usepackage{biblatex}
\begin{filecontents}{\jobname.bib}
#article{example,
title = {NAME OF PAPER},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\citefield{example}{title}
\end{document}
Got it from this question.
Thanks to Anders for the hint. \defcitealias seems to be the way to go.
Bibtex produces a .bbl file which contains the bibliography entries. something like that
\bibitem[\protect\citeauthoryear{Andrienko
{\itshape{et~al.}}}{2003}]{Andrienko2003}
Andrienko, G., Andrienko, N., and Voss, H., 2003. {GIS for Everyone: The
CommonGIS Project and Beyond}. {\itshape {In}}: {\itshape {Maps and the
Internet}}., 131--146 Elsevier.
I use Eclipse, which is free and that you may already have to apply regular expressions in this file when needed. '\R' acts as platform independent line delimiter. Here is an example of multi-line search:
search:
\\bibitem.*(\R.*)?\R?\{([^{]*)\}\R^[^\\].*\d\d\d\d\.\s([^\.]*\R?[^\.]*)\R?.*\R?.*
and replace:
\\defcitealias{$2}{$3}
(For myself I use \\bibitem.*(\R.*)?\R?\{([^{]*)\}$\R^([^\\].*[^\}]$\R.*$\R.*) to get all the item text)
Et produces a series of \defcitealias that can be copypasted elsewhere:
\defcitealias{Andrienko2003}{{GIS for Everyone: The
CommonGIS Project and Beyond}}
Finally, this can be used to build a custom command such as:
\newcommand{\MyCite}[1]{\citet*{#1}. \citetalias{#1}.}
Used as \MyCite{Andrienko2003} and producing: Andrienko et al. (2003). GIS for Everyone: The CommonGIS Project and Beyond.

Resources