## Resources

We use Latex, Matlab, and xfig/visio/omnigraffle to write papers. This page contains the paper writing guidelines used at NMSL. Many of the guidelines were also used when Cheng-Hsin Hsu was at Simon Fraser University.

### Technical report template

This is a template for writing technical/course reports. Please use the template for all your reports.

### Installing Latex compiler and integrated environment

• Windows: First install Miktex, a Latex compiler, and then install TeXincCenter, an integrated environment.
• Linux: Find and install Latex packages in your distributions. There have been quite a few Latex packages, but recently TexLive is probalby one of the most active Latex projects. Then, install Kile, which is a KDE-based integrated environment.
• Mac: The most user-friendly Linux package is MacTex. I don't use integrated environment (GUI) on Mac; I use makefile to compile PDF in Terminal prompt. Note that, from time to time, you may need tools from package like imagemagick and ghostscript, and projects like MacPort and Fink come handy.

### Exporting Matlab figures in the consistent dimension

Matlab allows you to save a figure in a high-quality eps file. However, choosing font size and figure dimension is very tricky and often lead to tiny, unreadable figure labels and legends. Always apply the following Matlab script twice before saving figures. This can be done by cut and paste the whole paragraph into Matlab. Also notice that, after applying the script, do not change the figure dimension before saving its eps file.

% for 3-column figuresset(gca,'FontSize',20)set(gca, 'FontName', 'Times New Roman');set(gca,'TickDir','out')set(get(gca, 'xlabel'), 'interpreter', 'latex');set(get(gca, 'xlabel'), 'FontName', 'Times New Roman');set(get(gca, 'xlabel'), 'FontSize', 20);set(get(gca, 'ylabel'), 'interpreter', 'latex');set(get(gca, 'ylabel'), 'FontName', 'Times New Roman');set(get(gca, 'ylabel'), 'FontSize', 20);set(legend(), 'interpreter', 'latex');set(legend(), 'FontName', 'Times New Roman');set(legend(), 'FontSize', 20);set(gcf, 'WindowStyle', 'normal');set(gca, 'Unit', 'inches');set(gca, 'Position', [.65 .65 4.6 3.125]);set(gcf, 'Unit', 'inches');set(gcf, 'Position', [0.25 2.5 5.5 4.05]);

### Drawing and exporting diagrams

Vector images must be used for high-quality papers. Omnigraffle and xfig both support exporting eps files. Visio, unfortunately, does not export images in EPS format. As a workaround: (i) print your figure as a pdf file, (ii) use ImageMagick to convert it into a ps file, and (iii) use ps2eps to get an eps file.

### Adding Latex math symbols in xfig figures

1. First you're in Xfig. Write equations or characters in the schematic. You need $in both sides, eg,$\phi\$.
2. Press the "Edit" icon and turn on the Special flag.
3. Export the figure into Combined Postscript/LaTeX instead of the usual Encapsulated postscript (EPS) .
6. When storing fig files in a different from tex files, you need to manually modify pstex_t files whenever you export them. E.g.. I have to change \epsfig{file=coverage.pstex}% into \epsfig{file=../fig/coverage.pstex}%.
7. Write the following command to insert your figure in TeX file.
\begin{figure}[ht] \centering{ \resizebox{.48\textwidth}{!} { \input{../fig/coverage.pstex_t} } } \caption{Test.} \label{fig:test}\end{figure}

### Embedded fonts in PDF files

It is required by IEEE, ACM, and many other publishers that all fonts are embedded in the document. Embedding fonts is important in order to make the document look and print in the same way the authors intended on different systems.

• In TeXincCenter, you may import this profile using Build -> Define Output Profiles -> Import, and then use this profile to compile your PDF.
• Instead, you can use the following argument line for ps2pdf post processor (in TeXnicCenter: Build->Define Output Profiles. Then choose Latex => PS => PDF. Then, Postprocessor tab).
-sPAPERSIZE=letter -dSAFER -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -dPDFSETTINGS=/printer -dMaxSubsetPct=100 -dSubsetFonts=true -dEmbedAllFonts=true -r600 -dCompatibilityLevel=1.4 -sOutputFile="%bm.pdf" -c save pop -f "%bm.ps"
• You can use the following script with Ghostscript. You need to change the "outFile.pdf" and "inputFile.pdf" to your files.

gs -sDEVICE=pdfwrite -q -dBATCH -dNOPAUSE -dSAFER \-dPDFX \-dPDFSETTINGS=/prepress \-dAutoFilterColorImages=false -dColorImageFilter=/FlateEncode \-dAutoFilterGrayImages=false -dGrayImageFilter=/FlateEncode \-sOutputFile=outFile.pdf \-c > setdistillerparams \-f inputFile.pdf \-c quit