I have a though one for you:
I'm writing in MultiMarkdown and all my figures, tables, charts are usually pictures. This allows me to write something like this:
The MultiMarkdown input
![This is the caption.][table1]
[table_sometable]: tab_pic1.png
… and end up with:
Compiled LaTeX
\begin{figure}[htbp]
\centering
\includegraphics[keepaspectratio,width=\textwidth,height=0.75\textheight]{tab_pic1.png}
\caption{This is the caption.}
\label{table_sometable}
\end{figure}
I thought about writing a shell script that simple exchanges \begin{figure}
to \begin{table}
(same for \end{figure}
) before I compile my .tex file with pdflatex to a PDF.
However, I'm looking for a pure LaTeX solution since it's more portable and more people at my University could use it.
After reading LaTeX programming: how to implement conditionals I thought that it might be possible and decided to ask my question here since I'm only 4 days old in the world of LaTeX.
I also read "How to form "if ... or ... then" conditionals in TeX?" and "LaTeX conditional expression", but I'm not sure if parsing for a string is supported.
I imagine the scipt to work like:
IF a string called
\label{table_}
is found between\begin{figure}
and\end{figure}
THEN replace{figure}
with{table}
I also found Search & Replace Script for TeXworks but maybe it's possible to handle this all on the compile level, so that I don't have to run anything extra and just can start compiling in Sublime Text when I'm done writing.
So why would this be cool…
- obviously it's kind of a must-have for people who write in (Multi)Markdown
- a filter would also allow to split all figures further into catogories (photographies/images, charts, …)
- other geeky stuff which depends on parsing the content before compiling a pdf.
I'm open for ideas, solutions, links.