0

enter code here I am writing a project in LaTeX. I need the first part of my project in [12pt] (which I know how to do). The second part (my MATLAB code) I need in the default format, not [12pt]. How can I do this?

The reason why I need this is because the [12pt] format changes my MATLAB code by miraculously skipping some lines.

I am using \lstinputlisting to import my MATLAB code.

\lstinputlisting[style=Matlab-editor, basicstyle=\small]{blotto.m}
1
  • 2
    Something like \small and a blank line? – Bernard Jan 10 '19 at 19:38
4

You should probably describe your real problem as [12pt] will not cause lines to be skipped.

If you use the default [10pt] option you can use \large to get a region of 12pt text.

Conversely, if you use a document [12pt] option you can use \footnotesize to get 10pt text.

5
  • This is really weird. When I use \documentclass{article}, MATLAB code is displayed fine. When I use \documentclass[12pt]{article}, MATLAB code skips some lines. Typing \small (or others) does not work... I am using the function \lstinputlisting to download my MATLAB code if that helps. – Andy Jan 10 '19 at 19:53
  • 1
    If you post an example someone can easily debug, if you don't then it is impossible. What do you mean by skip lines? are they off the page? How are you inporting the matlab code, inline or using listings or .... basically you have not given any clues about your matlab problem. – David Carlisle Jan 10 '19 at 19:55
  • I have now edited the question. – Andy Jan 10 '19 at 21:04
  • 1
    @Andy the edit doesn't let anyone debug though, you have provided no usable example and haven't said what is wrong with the output you show, or what different output you get at 10pt (if you provided a usable example people woul dbe able to see the difference) but really matlab inclusion seems a different question from the question you asked (and I answered) about how to change font size, so perhaps best to ask a new question, with a usable example. (I still can not guess what you mean by skip lines here) – David Carlisle Jan 10 '19 at 21:08
  • Never mind I have a quick fix. I made the whole document [10pt], then made the first section \large... – Andy Jan 10 '19 at 21:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.