# Tag Info

4

If I understand you correctly you want the position of the lines and arrows, relative to the axes, to be the same in both plots. For such cases the rel axis cs coordinate system is helpful. It is a coordinate system which has (0,0) in the lower left of the axis, and (1,1) in the upper right. You can use it as for example \node at (rel axis cs:0.5,0.5) {stuck ...

5

You can do that with a combination of relatively arcane listings internal macros; no need to write to an external file. For convenience, I've defined a new boolean key called onlyheader. If set, only the function header gets printed. Edit: I added a fix for the bug you reported, but that fix conflicts with matlab-prettifier. Unfortunately, I don't have ...

3

File handling in this manner is not something that is necessarily best handled all-in-one with TeX. It would be much better to do the processing outside of TeX, and then use the result inside TeX. This method (abstracted from How can I save shell output to a variable in LaTeX?) is somewhat of a compromise. It uses the write18 TeX primitive to run a shell ...

2

The filecontents package is used only to create the files to be input. The code fetches the asked for lines. They may be manipulated directly, or with the listings package. For this I again write the lines to a file and input them: there surely is something easier and more elegant, but it turns out I am completely unfamiliar with listings. [The update adds ...

3

Both komascript classes and mcode define \ifnumbered in incompatible ways. This is surely the cause of the problem. One or the other (ideally both) should change the name of this switch, especially if it is needed only for internal purposes. I edited mcode.sty, changing instances of "numbered" (in \ifnumbered and \numberedtrue) to "mcode@numbered", and the ...

7

scrbook defines a macro \ifnumbered that isn't a TeX if which is not necessarily wrong but it is a bit dangerous and here mcode pushes you over a cliff. You can restore scrbook s definition: \documentclass{scrbook} \let\zz\ifnumbered \usepackage{mcode} \let\ifnumbered\zz \begin{document} %\tracingall \chapter{matlab code} \end{document}

Top 50 recent answers are included