Resources for customizing Latex output?

44 views
Skip to first unread message

Ben Watson

unread,
Dec 16, 2017, 8:25:34 PM12/16/17
to MultiMarkdown Discussion List
I have been struggling to figure out the best way of doing this.

In my MMD file, I have sections like this:

```
Target Info
===========
Architecture...
```



```c#
var heap = clr.Heap;
foreach(var obj in heap.EnumerateObjects())
...
```


which produces tex output:

\begin{verbatim}
Target Info
===========
Architecture...
\end{verbatim}


\begin{verbatim}
var heap = clr.Heap;
foreach(var obj in heap.EnumerateObjects())
...
\end{verbatim}

The language info is dropped in latex (though pandoc will use it to correctly do syntax highlighting for epub format).

I would like to instead use the minted package instead of verbatim to get syntax highlighting for some of the code. I assume I need to do use XSLT files, but I am having trouble figuring out the right set of steps to accomplish this. 

Q: Is there a guide to customizing MMD-->Latex output in general I could refer to? Where do I put the XSLT files I need, what commands do I run, etc.? This feels rather basic, but my attempts so far have all failed.

I am using MMD 4.2 because that's what came with Scrivener (but I am running mmd.exe outside of Scrivener, in my own build process). If necessary, I can update to a newer version of mmd, but that would be a significant change in my manuscript because I have latex commands peppered throughout and I understand that the syntax for including those changed in v6.

Thanks for any guidance you can offer,
Ben

Lucas Burke

unread,
Dec 18, 2017, 10:17:20 PM12/18/17
to MultiMarkdown Discussion List
Don’t you just want to run a filter on your input file for ```c# → <!- - \begin{minted} ... etc ... \end{minted} ?

I can’t imagine that you want to use xslt for that. Isn’t just looping through the lines enough?
--
You received this message because you are subscribed to the Google Groups "MultiMarkdown Discussion List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to multimarkdow...@googlegroups.com.
To post to this group, send email to multim...@googlegroups.com.
Visit this group at https://groups.google.com/group/multimarkdown.
For more options, visit https://groups.google.com/d/optout.

Fletcher T. Penney

unread,
Dec 19, 2017, 10:08:36 AM12/19/17
to MultiMarkdown Discussion List
Perhaps I am misunderstanding, but generally you can just run your
document through MMD. No need for other scripts or XSLT, unless you're
doing something very specific.


F-


On 12/18/17 10:17 PM, Lucas Burke wrote:
> Don’t you just want to run a filter on your input file for ```c# → <!- -
> \begin{minted} ... etc ... \end{minted} ?
>
> I can’t imagine that you want to use xslt for that. Isn’t just looping
> through the lines enough?
>
> On Dec 16, 2017, at 8:25 PM, Ben Watson <b...@benwatson.org
>> *Q: *Is there a guide to customizing MMD-->Latex output in general I
>> could refer to? Where do I put the XSLT files I need, what commands do
>> I run, etc.? This feels rather basic, but my attempts so far have all
>> failed.
>>
>> I am using MMD 4.2 because that's what came with Scrivener (but I am
>> running mmd.exe outside of Scrivener, in my own build process). If
>> necessary, I can update to a newer version of mmd, but that would be a
>> significant change in my manuscript because I have latex commands
>> peppered throughout and I understand that the syntax for including
>> those changed in v6.
>>
>> Thanks for any guidance you can offer,
>> Ben
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "MultiMarkdown Discussion List" group.
>> To unsubscribe from this group and stop receiving emails from it, send
>> an email to multimarkdow...@googlegroups.com
>> <mailto:multimarkdow...@googlegroups.com>.
>> To post to this group, send email to multim...@googlegroups.com
>> <mailto:multim...@googlegroups.com>.
>> Visit this group at https://groups.google.com/group/multimarkdown.
>> For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google
> Groups "MultiMarkdown Discussion List" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to multimarkdow...@googlegroups.com
> <mailto:multimarkdow...@googlegroups.com>.
> To post to this group, send email to multim...@googlegroups.com
> <mailto:multim...@googlegroups.com>.
--
Fletcher T. Penney
fletche...@gmail.com

Ben Watson

unread,
Dec 19, 2017, 10:49:03 AM12/19/17
to MultiMarkdown Discussion List
Yeah, I'd prefer to not have another tool do this. 

The problem with just using mmd up to now is that it's difficult to customize the transformation to latex. I still want to use the ```c# syntax because I also translate to epub format, but the latex format for print needs some customization and I don't want it to use \begin{verbatim} anymore.
>> To post to this group, send email to multim...@googlegroups.com
>> <mailto:multim...@googlegroups.com>.
>> Visit this group at https://groups.google.com/group/multimarkdown.
>> For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google
> Groups "MultiMarkdown Discussion List" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to multimarkdow...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages