Table of Contents
Latex
Build commands
pdflatex filename (with or without extensions) bibtex filename (without extensions) pdflatex filename (with or without extensions) pdflatex filename (with or without extensions)
Formating
Multi-column
* http://www-h.eng.cam.ac.uk/help/tpl/textprocessing/columns.html
Squeezing space
You can modify the following lengths, which affect all floats.;
\floatsep: space left between floats (12.0pt plus 2.0pt minus 2.0pt).
\textfloatsep: space between last top float or first bottom float and the text (20.0pt plus 2.0pt minus 4.0pt).
\intextsep : space left on top and bottom of an in-text float (12.0pt plus 2.0pt minus 2.0pt).
\dbltextfloatsep is \textfloatsep for 2 column output (20.0pt plus 2.0pt minus 4.0pt).
\dblfloatsep is \floatsep for 2 column output (12.0pt plus 2.0pt minus 2.0pt).
\abovecaptionskip: space above caption (10.0pt).
\belowcaptionskip: space below caption (0.0pt).
For example:
\setlength{\parskip}{1pt plus 2pt minus 4pt}
\setlength{\dbltextfloatsep}{0pt plus 2.0pt minus 4.0pt}
\setlength{\belowcaptionskip}{+2pt}
\setlength{\abovecaptionskip}{+2pt}
\setlength{\textfloatsep}{-2pt}
\setlength{\intextsep}{0pt plus 2pt minus 2pt}
\section{xyz}
Margin ieeetran journal etc
Journal class require less page count but has smaller bottom margin (requried for conference) and page number (not required by conference). To fix those:
You're in luck. First of all, obtain and use the new version 1.7 of
IEEEtran:
http://www.ctan.org/tex-archive/macros/latex/contrib/IEEEtran/
IEEE has not yet updated their site to carry v1.7. Note that some
command names have been changed to use an \IEEE prefix (see the
changelog.txt).
Now, use the new \CLASSINPUT interface to set your default margins
(for the second and later pages) *before* IEEEtran loads:
\newcommand{\CLASSINPUTinnersidemargin}{1.7cm} % inner side margin
\newcommand{\CLASSINPUToutersidemargin}{1.7cm} % outer side margin
\newcommand{\CLASSINPUTtoptextmargin}{1.7cm} % top text margin
\newcommand{\CLASSINPUTbottomtextmargin}{1.7cm}% bottom text margin
\documentclass[journal]{IEEEtran}
Then, adjust the \textheight (e.g., bottom margin) for the first
page only via \enlargethispage. Because you have two column text, you
will have to insert this command twice - once after \maketitle and
once somewhere (ideally in the middle) of the text in the second
column on the first page. To allow for dual compilation under
single column format, you can conditionally include the second
\enlargethispage so as to be invoked only if using two column
format:
\maketitle
\enlargethispage{-0.8cm}
blah blah blah ...
blah blah start of second column
\ifCLASSOPTIONtwocolumn
\enlargethispage{-0.8cm}
\fi
Margin ieeetran conference class
- Table caption in top margin: http://tex.stackexchange.com/questions/237931/ieeetran-tabular-wont-fit-into-0-7in-margin
The caption package – at least if it's loaded with no other options than justification=centering (which is the default anyway) – seems to be causing the penetration of the top margin by the first caption of the table* environment.
A workable fix would appear to consist of loading the package with options skip=5pt and position=bottom as well (even though the captions are to be placed on top rather than at the bottom of each tabular). In addition, you really need to specify the option size=footnotesize as the IEEEtran document class sets tabular material in that size.
Note that since table* environments can only appear at the top of a page, nothing is gained by specifying the [t] location specifier.
A reworked/expanded version of your example code that implements these recommendations:
\documentclass[conference]{IEEEtran}
\usepackage{caption}
\usepackage{comment}
\usepackage{lipsum}
\captionsetup{size=footnotesize,
%justification=centering, %% not needed
skip=5pt, position = bottom}
\begin{document}
\lipsum[1-3] % filler text
\begin{table*}
\centering
\caption{First caption}
\begin{tabular} {ccc}
\hline
a & b & c\\
\hline
\end{tabular}
\bigskip
\caption{Second caption}
\begin{tabular} {ccc}
\hline
d & e & f \\
\hline
\end{tabular}
\end{table*}
\lipsum[4-30] % more filler text
\end{document}
Download sty file to directory
tlmgr install <package>
If the second, you will have a small problem in that tlmgr might not be in the path that sudo automatically searches. So you need to locate it first and use sudo to call it with the full path. If your shell has the which builtin, you can find tlmgr using the command which tlmgr. Thus:
which tlmgr sudo /path/to/tlmgr install <package>
Figure position
Floatbarrierer solution works best.
install manually
In this situation, you have two options: to install system-wide (all users on your system) or to install just for you. System-wide means that any user on your system will be able to use it, just for you means just that: it will only be installed for your account. The difference between the two is the base location:
System-wide: type kpsewhich -var-value TEXMFLOCAL in the Terminal to find the right directory Just for you: type kpsewhich -var-value TEXMFHOME in the Terminal to find the right directory
If it is not distributed in TDS, then there are two options: If the package is available from TeX Live, you can get the TDS packaged version from http://mirror.ctan.org/systems/texlive/tlnet/archive/.tar.xz, and unpack it into a temporary directory. In most cases it will contain subdirectories like tex, fonts, etc. Copy these to the TEXMF tree as decided above. In case it contains a directory texmf-dist or similar, it is a package that also ships some scripts or different things outside the texmf hierarchy, in this case it is the best to contact an expert. Finally, you can also download the package from CTAN or the original distribution channel, unpack it and then there might be instructions - in which case follow them - but the general pattern is pretty similar. If it is a LaTeX package, create a directory in <base dir>/tex/latex/<package name> for it and extract the files (.sty plus perhaps .cls, etc.) there. Documentation files go in <base dir>/doc/latex/<package name>.
If you installed it globally, you will now need to run mktexlsr (or equivalently texhash) via sudo. If mktexlsr is not in the path that sudo searches, you will need to locate it. You can do:
which mktexlsr sudo /path/to/mktexlsr
Or if your shell allows it:
sudo $(which mktexlsr)
This isn't necessary for local installations.
Testing the Installation
The simplest way to check that the installed file is being found is to run
kpsewhich <package_name>
(where <package_name> includes the extension). If this lists the newly installed file, all should be fine. If it doesn't but does display something then it may be that there is another version of this package installed which is being found first. If that is the case, then
kpsewhich –all <package_name>
will list all of the matching names so you can test to see if it is finding it at all.
If it did find it but isn't using it, you will either have to choose a location which is searched earlier than the version that is being found or remove the version(s) that are being found first.
If it did not find it at all, there are some possible reasons.
If you did a full installation of TeX Live, is the kpsewhich command from the new installation? Try which kpsewhich to find out. If not, adjust your $PATH and try again. (If your path is correct, it might be that your shell hasn't noticed it: try rehash to correct this (Bourne-Again Shells)). If you only installed a package, did you put it somewhere that TeX can find it? The full list of directories in which TeX searches can be found by running kpsewhich --var-value TEXMF These are searched recursively. If it is in a directory that TeX searches, and that directory is prepended in the list by !! then it is one where TeX consults the cache, not the actual files on the disc. To recreate the cache, run mktexlsr or texhash as super-user.
Glossaries
We can use acronym only if no glossary is needed
%% preamble
\usepackage{hyperref} %if present
\usepackage{glossaries}
% with param
% \usepackage[acronyms,nonumberlist,nomain]{glossaries}
\usepackage{glossary-mcols} %% add styles
\makeglossaries in your preamble
%% Document
% glossary and acronym entries in your preamble (recommended) or before first use in your document
\newglossaryentry{ref}{ABBR}{A.B.B.R}
\newacronym{mylable}{ABBR}{A.B.B.R}
% locate the glossaries list within your document structure
\printglossaries
% text:
Then pepper your writing with \gls{mylabel} macros (and similar) to simultaneously insert your predefined text and build the associated glossary.
%% Compile
% File processing must now include a call to
makeglossaries
latex
pdflatex.
Customization
For the glossary to show up in your Table of Contents, you need to specify the toc option:
\usepackage[toc]{glossaries}
If all entries are to be printed the command
\glsaddall
The glossary and the list of acronyms can be displayed separately in different places[3]:
\usepackage[acronyms]{glossaries}
\printglossary[type=\acronymtype] % prints just the list of acronyms
% Some text between the list of acronyms and the glossary.
\printglossary % if no option is supplied the default glossary is printed.
Change Title:
\printglossary[title=List of Terms,toctitle=Terms and abbreviations]
Change format of the list. A number of pre-built styles are available, and can be changed easily using
% Must be issued before \printglossaries (preamble)
\glossarystyle{<newstyle>
% Or inside document
\printglossary[type=\acronymtype,style=mcolindex,title=List of Acronyms]
Glossary font
\makeglossaries %% preamble
\renewcommand{\glossarypreamble}{\footnotesize}
Define your style
\newglossarystyle{tablestyle} %% style name {% \renewenvironment{theglossary}% {% start of glossary % Find maximum width of the first column: \setlength{\maxlength}{0pt}% \forglsentries[\currentglossary]{\thislabel}% {% \settowidth{\thislength}{\glsentryshort{\thislabel}}% \ifdim\thislength>\maxlength \setlength{\maxlength}{\thislength}% \fi }% % Now calculate the width of the second column: \settowidth{\thislength}{\hspace{1.5em}=\hspace{1em}}% \setlength{\glsdescwidth}{\linewidth-\maxlength-\thislength-2\tabcolsep}% % Start the tabular environment \begin{multicols}{2}% \begin{tabular}{l@{\hspace{1.5em}=\hspace{1em}}p{\glsdescwidth}} \hline \multicolumn{1}{l}{\textbf{Acronym}} & \multicolumn{1}{@{}l}{\textbf{Description}}\\% \hline }% {% end of glossary \hline \end{tabular}% \end{multicols}% }% % Header has been incorporated into \begin{theglossary} \renewcommand*{\glossaryheader}{}% % Don't do anything between letter groups \renewcommand*{\glsgroupheading}[1]{}% \renewcommand*{\glsgroupskip}{}% % Set display for each the acronym entry \renewcommand{\glossentry}[2]{% \glstarget{##1}{\glsentryshort{##1}}% short form & \glsentrylong{##1}% long form \\% end of row }% % No sub-entries, so \subglossentry doesn't need redefining }
Multi-columns
Nomenclature (better use Glossaries)
First load the package in the preamble. The makenomenclature command is required for the generation of the nomenclature file (.nlo). Commenting it out is a convenient way to “switch it off”.
\usepackage{nomencl}
\makenomenclature
Next, add abbreviations together with their description or long form to your document. Ideally, this is done immediately after an abbreviation is mentioned for the first time.
\nomenclature{Fig.}{Figure}
\nomenclature{$A_i$}{Area of the $i^{th}$ component}
This command has an optional argument which provides control over the order of the entries. Consider the following example:
I want $\beta$\nomenclature{$\beta$}{The second letter of the gr
The following command prints the abbreviation/symbol list at the corresponding position of the document.
\printnomenclature
Customization
To control the distance between the symbol or abbreviation and the explaining text use the optional distance argument.
\printnomenclature[5em]
To change the name of the list use
\renewcommand{\nomname}{List of Symbols}
To change font, you could redefine \nompreamble. That command will be executed before starting the list and does nothing by default.
\renewcommand*{\nompreamble}{\footnotesize}
2-col nomencl
Just add \usepackage{multicol} to your preamble and then:
\begin{multicols}{2}
\printnomenclature
\end{multicols}
nomentbl
To Learn
Compile
Similar to a glossary or bibliography, the document is typesetted once (latex). Next, the nomenclature is generated using makeindex. Finally, the document is typesetted again, adding the nomenclature to it. -s nomencl.ist is needed!.
latex filename.tex makeindex filename.nlo -s nomencl.ist -o filename.nls latex filename.tex
The makeindex command takes the nomenclature file (.nlo), the style file (nomencl.ist) and the name of the output file (.nls) as input arguments. ist-style file can be modified for new style.
Call makeindex in preamble (not work for me)
\usepackage{nomencl}
\makenomenclature
\makeindex
Sample
\documentclass{article}
\usepackage{nomencl}
\makenomenclature
\makeindex %<----
\renewcommand{\nomname}{Time Zones}
\begin{document}
UTC\nomenclature{UTC}{Coordinated Universal Time} is 3 hours behind ADT\nomenclature{ADT}{Atlantic Daylight Time} and 10 hours ahead of EST\nomenclature{EST}{Eastern Standard Time}.
\printnomenclature
\small\hfill Created by http://texblog.org
\end{document}