I am pretty sure the line spacing does not apply to embedded code in this sense, the code can be similar to a figure, where you usually would not use double spacing as well. Could you repeat it again in simpler terms? Thanks to this blog for providing this information – http: Go to Review tab. Insert a table with single column. You can only interact with it by double-clicking it. Firstly, I would suggest you to carefully consider whether you indeed want to retain syntax highlighting in a source code, embedded into a thesis document.
Is there some better and ideally portable way to do this? Final result is shown in the image below and meets all the requirements. Mohamed Alikhan Mohamed Alikhan 7 Create a ” Paragraph Style ” with the name of ” Code ” just for your code snippets check https: Make the adjustments to cells’ spacing and columns’ width to get the aspect you like. Save that table style and enjoy!
Markdown in combination with pandoc can also be a feasible alternative to LaTeXif your thesis is light on mathematics and your formatting needs are relatively modest.
Thirdly, to find the optimal Word-only solutiontry to review first several pages of more then 3M results of Google search source code highlight word document. I absolutely hate and despise working for free for Microsoft, given how after all those billions of dollars they STILL do not to have proper guides about stuff like this with screenshots on their damn website.
Unicorn Meta Zoo 3: Calchas Calchas 1, 6 Resulting Microsoft word snippet will appear as shown in screenshot below. Note that some editors e. Unfortunately, I don’t recall Open Office being any better.
Code snippet shall have a nice border. I needed to include some code snippets in my thesis. Insert a table with single column.
Secondly, if you would want and be able to generate your thesis Word document from a LaTeX one I do not recommend it, as it can be quite tricky, unless you have experience in thatthen source code formatting transforms into a pretty trivial task, thanks to corresponding LaTeX packages and excellent free and open source pandoc software. KonVas KonVas 91 1 5.
How to format code in a thesis (Word document)? – Academia Stack Exchange
If the snippets are to be in-line with text, rather than in say an appendix, then consider whether you want full-on coloured syntax highlighting or whether that would stand out too theis compared to the rest of the document.
Click “Show Highlighted” button. I am pretty sure the line spacing does not apply to embedded code in owrd sense, the code can be similar to a figure, where you usually would not use double spacing as well. This is related to this answer: What is the best sord to insert source code examples into a Microsoft Word document? This gives me the option to use line number, as well as very nice syntax highlighting. Open the website provided above in chrome and Copy the code snippet in the text area.
Then they can easily be edited globally later. I was told by my chair members to post the code on Github and obtaining a DOI number associated with it.
Ideally remove the font bar from the ribbon altogether. Resulting text has spell-check disabled.
Link does not work. Your Code will not be autocorrected. Add a fill in the middle column. Hi ParameshKorrakuti, If by the border you mean the ‘light grey colored background behind the numbers’ shown on the syntax highlighter website, then I have not been successful at achieving that.
Whatever you do, don’t do it by hand. You can use Open Xml Sdk for this. A new pop-up will be presented.
If you have the code in html with color and formatting. Then run the macro on each code block. Thesi suspect such a macro probably exists somewhere.
Meatyflesh Meatyflesh 1 3.
Go to Review tab.