Resources
- Details
- Category: Resources
- Last Updated on Friday, 03 August 2012 10:15
- Written by Cheng-Hsin Hsu
- Hits: 2310
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
% for 3-column figures
set(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
- First you're in Xfig. Write equations or characters in the schematic. You need $ in both sides, eg, $\phi$.
- Press the "Edit" icon and turn on the Special flag.
- Export the figure into Combined Postscript/LaTeX instead of the usual Encapsulated postscript (EPS) .
- Add \usepackage{epsfig} to your preamble.
- You might need to add \usepackage{color} to your preamable
- 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}%.
- 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
Relevant Links
- One pager for introducing Latex: get to know Latex
- Not so short Latex introduction: details about Latex
- Complete list of Latex symbol: handy when writing complicated equations
- Matlab tutorial: online Matlab tutorial
- Practical Matlab introduction: another Matlab tutorial