I'm trying to include a simple glossary to my LaTeX document,
I already searched for something like that on google, but never got it running.
I would like to use glossary or glossaries.
how to write it in the text?
how to print it?
what to execute on which position?
Well, there is a glossaries package on CTAN. Read the pdf documentation.
Check if you already have it in your installation, if not install it, and put \usepackage{glossaries} in the preamble of you document and it will be available to you.
It looks like you need \usepackage{glossaries} and \makeglossaries in the preamble, and some number of \newglossaryentry and \newacronym calls (it is not immediately clear to me if these only go in the premble or can go in the document text). Finally, you will need one or more \printglossary calls in the text. Use \gsl to connect glossary entries on the argument with the pages they occur on.
Processing the file will have to include a call to makeglossaries followed by at least one more invokation of latex.
In addition to the samples mentioned in the documentation there is a Stack Overflow question which includes a minimal file making use of glossaries. You may be particularly interested in the acronym glossary.
There is a nice blog for beginners: LaTeX glossary and list of acronyms
Here is an example:
\documentclass{article}
% Load the package
\usepackage{glossaries}
% Generate the glossary
**\makeglossaries**
\begin{document}
%Term definitions
\newglossaryentry{utc}{name=UTC, description={Coordinated Universal Time}}
\newglossaryentry{adt}{name=ADT, description={Atlantic Daylight Time}}
\newglossaryentry{est}{name=EST, description={Eastern Standard Time}}
% Use the terms
\gls{utc} is 3 hours behind \gls{adt} and 10 hours ahead of \gls{est}.
%Print the glossary
\printglossaries
\end{document}
Related
I have a "project book" which uses LaTeX's \documentclass{report} ("report" is like a more compact version of \documentclass{book}). I would like to include into this book an appendix with the Doxygen-generated API documentation for the software in the project.
I have achieved this by setting Doxygen's config options LATEX_HEADER and LATEX_FOOTER to an empty file. This makes the resulting latex/refman.tex have top level commands like: \section{\-Namespace \-Index}, at which point I can wrap this with a top level document like:
\documentclass{report}
\usepackage{doxygen.sty}
% the "import" package helps to find Doxygen files in the latex/ subdirectory
\usepackage{import}
% [...] title page and the rest of the book
\appendix
\chapter{API reference (generated by Doxygen)
subimport{latex/}{refman.tex}
% [...] final stuff
\end{document}
This works reasonably well and I get doxygen.sty with this special doxygen invocation:
doxygen -w latex /dev/null /dev/null doxygen.sty
One problem is that this puts an "autogenerated" header on the entire document (not just on the doxygen appendix). I can get rid of this by editing doxygen.sty (I also rename it for my inclusion, actually) and commenting out the block that starts with % Setup fancy headings.
At this point I have something I can live with, but I would like to go one step further: the "doxygen" style modifies a lot of other aspects of the LaTeX document style, and I like it less.
So my question is (in two levels of excellence):
What would be a minimal set of LaTeX commands to put in a doxygen.sty file that would nicely render the doxygen appendix but not interfere with the rest of the LaTeX document?
Even better, has someone come up with a way of doing
\usepackage{doxygen_standalone}
% [... until you need doxygen]
\begin{doxygen}
% the stuff you need to insert your auto-generated doxygen API docs,
% for example the \subimport{latex/}{refman.tex} that I showed above
\end{doxygen}
This last approach is one I would consider very clean.
I'm hoping there is a really simple answer, such as "this already exists in doxygen.sty as an option, and you missed it!"
rename doxygen.sty to mydoxygen.sty, then modify it by inserting
\newenvironment{doxygen}{... most of doxygen.sty goes here ...}{}
I always like my figures to be placed in between text as opposed to the top or bottom of the page. I also like to talk about the figure before it is shown. So I am trying to have something like this:
By looking at Figure~\ref{fig:VCO} you can see that blah blah blah.
\begin{figure}[h]
\caption{VCO test circuit}\label{fig:VCO}
\begin{center}
\includegraphics[width=0.9\columnwidth]{figures/VCO_circuit.eps}
\end{center}
\end{figure}
This doesn't seem to work because it I guess it is referencing something that hasn't occurred yet? Does anyone have some simple solution? I am still very new to LaTeX.
Generally LaTeX needs at least two passes to resolve all its references, the first time to write them to an auxiliary file and the second time to put them into the final ps/pdf/dvi file. So it does not matter where the reference is.
A third pass will be needed, for example, if your document has a long table-of-contents which will screw up page numbers.
It failed the first time because labeling and referencing are a two-pass process. The first time you processed your latex, all the labels were being indexed so the ref failed. The second time around, since the labels had been indexed the ref knew what it was actually referencing.
I would add that latexmk (link) has proven invaluable to me over the years. This is a LaTeX "build" script written in Perl that is designed to compile .tex source files the right number of times. It parses the output from the latex command and performs dependency checking to ensure that the output document is kept up-to-date with the minimum number of passes. It can also deal with BibTeX bibliography files. Generally speaking, I invoke latexmk from either an Ant or GNU Make makefile and treat it just like I'm compiling C++ code, for example.
I had same problem and I found this solution:
\graphicspath{{images/}}
\DeclareGraphicsExtensions{.jpg}
\makeatletter
\newenvironment{tablehere}
{\def\#captype{table}}
{}
\newenvironment{figurehere}
{\def\#captype{figure}}
{}
\makeatother
\begin{figurehere}
\includegraphics[height=5cm]{2-14aGa-Sur.jpg}
\caption{Hliněná destička s mapou severu Mezopotámie}
\label{fig:Ga-Sur}
\end{figurehere}
\graphicspath{{images/}} is there to declare your path to your pictures
\DeclareGraphicsExtensions{.jpg} is there for declare picture extension (multiple can be with comma (I think ;-))
\makeatletter
\newenvironment{tablehere}
{\def\#captype{table}}
{}
\newenvironment{figurehere}
{\def\#captype{figure}}
{}
\makeatother
is there for precise determination of position here
\begin{figurehere}
\includegraphics[height=5cm]{2-14aGa-Sur.jpg}
\caption{Hliněná destička s mapou severu Mezopotámie}
\label{fig:Ga-Sur}
\end{figurehere}
there is your picture with height specified and caption and label with it...
I hope it will help you ;-).
I'm using the glossaries package in LaTeX. I've got \gls{foo} in my document, but I don't want the entry for "foo" to appear in the glossary. How can I keep a working (i.e. expanding) \gls{foo} in the body of my document, but exclude the entry for "foo" from the glossary?
EDIT: I want to use \gls{foo} to indicate "as used here, 'foo' has its specific meaning within this document." In a few cases, though, I've ended up with a "foo" whose definition is too obvious--or difficult--to articulate in the glossary.
So I want \gls{foo} to be expanded as usual, but I don't want the "foo" entry to appear in the glossary.
I hope this adds a little more information about what I'm trying to accomplish. It may be an abuse of glossaries, but I find it helpful to make sure I'm always using the same words and the right words while writing technical documents.
If you are using the glossaries package you can create an "ignored" glossary like
\documentclass{article}
\usepackage{glossaries}
\newglossary[glignoredl]{ignored}{glignored}{glignoredin}{Ignored Glossary}
\makeglossaries
\newglossaryentry{foofoo}{name={FOOFOO},description={foofoo stuff}}
\newglossaryentry{foo}{name={FOO},type={ignored},description={no good description}}
\newglossaryentry{bar}{name={BAR},description={bar of stuff}}
\begin{document}
Here is a \gls{foo} that is also a \gls{bar}, but of course it's also a \gls{foofoo}.
Why not consider buying a \gls{foo}?
\printglossary
% \printglossary[type={ignored}]
\end{document}
I have no idea why you'd want to do this, but the following should work:
\let\oldgls\gls% store the original meaning of \gls in a new command named \oldgls
\let\gls\relax$ make \gls do nothing
Some text with \gls{foo} no links to the glossary,
and no ``foo'' entry in the glossary.
\let\gls\oldgls% restore the original meaning of \gls
Some more text with \gls{bar} that links to the glossary,
and with a ``bar'' entry in the glossary.
This can be accomplished by adding the terms to a special common dictionary. It's actually a built-in feature of the glossaries package and it's even exemplified by the package author. From said example:
\documentclass{article}
\usepackage{glossaries}
\newignoredglossary{common}
\makeglossaries
\newglossaryentry{sample}{name={sample},description={an example}}
\newglossaryentry{commonex}{type=common,name={common term}}
\begin{document}
\gls{sample}. \gls{commonex}.
\printglossaries
\end{document}
Note the use of the \newignoredglossary command.
I'm using LaTeX and BibTeX for an article, and I want to able to cite the title of an article I reference. What is the command to do this?
I'm using \bibliographystyle{chicago} and it does not appear to be \citeT{}, \citetitle{} or \citeTitle{}
#Norman, and the various commenters, are correct in that it would be difficult to do this with bibtex and other tools. But, there is an alternative. Biblatex does allow this through the command \citetitle. Also, if you really want to, the formatting drivers in biblatex are easily readable and modifiable, but only if you feel the need. Unfortunately, it is not part of any distribution, yet, so it has to be downloaded and installed.
Just type in the title. Even natbib, the most powerful widespread BibTeX package, is not powerful enough to do what you want out of the box. Trying to get BibTeX to extract the title for you, by means of a LateX command, is possible, but it would require that you
Design a new format for bibliography items that is incompatible with existing formats.
Write your own custom .bst file, using the very strange postfix language that is used only by BibTeX, to be compatible with your new format.
Write a new LaTeX command to pull the title information out of the new format.
Speaking as someone who has written several custom bst files as well as a replacement for BibTeX, it's just not worth fooling with. After all, if you are citing the paper, you probably know the title anyway.
EDIT: If you have to do this with multiple papers, I would try to cheat. Extend the bst file so that it writes into the bbl file a command that writes into the aux file the title associated with each bibkey. You can model the bbl command on \label and the actual title-citing command on \ref.
This is how I solve the title issue for cited papers:
In the preamble
include Natbib:
\usepackage[sort&compress]{natbib}
If you want to cite a TITLE instead of an author in the text you define the title like this in the preamble:
\defcitealias{Weiser1996designingcalm}{Designing Calm Technology}
Note:
You need to have a bibtex item (for the title ''Designing Calm Technology'') with the key {Weiser1996designingcalm}.
In the paper where you want to write the cited paper's title
\citetalias{Weiser1996designingcalm}
this results in => Designing Calm Technology (i.e. the text you specified with the \defcitealias command above)
or
\citepalias{Weiser1996designingcalm}
that results in => (Designing Calm Technology) (i.e. title with parenthesis)
This question is old and maybe \citefield was not around back in the days, but now it works like charm for this kind of problems:
\documentclass[varwidth]{standalone}
\usepackage{biblatex}
\begin{filecontents}{\jobname.bib}
#article{example,
title = {NAME OF PAPER},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\citefield{example}{title}
\end{document}
Got it from this question.
Thanks to Anders for the hint. \defcitealias seems to be the way to go.
Bibtex produces a .bbl file which contains the bibliography entries. something like that
\bibitem[\protect\citeauthoryear{Andrienko
{\itshape{et~al.}}}{2003}]{Andrienko2003}
Andrienko, G., Andrienko, N., and Voss, H., 2003. {GIS for Everyone: The
CommonGIS Project and Beyond}. {\itshape {In}}: {\itshape {Maps and the
Internet}}., 131--146 Elsevier.
I use Eclipse, which is free and that you may already have to apply regular expressions in this file when needed. '\R' acts as platform independent line delimiter. Here is an example of multi-line search:
search:
\\bibitem.*(\R.*)?\R?\{([^{]*)\}\R^[^\\].*\d\d\d\d\.\s([^\.]*\R?[^\.]*)\R?.*\R?.*
and replace:
\\defcitealias{$2}{$3}
(For myself I use \\bibitem.*(\R.*)?\R?\{([^{]*)\}$\R^([^\\].*[^\}]$\R.*$\R.*) to get all the item text)
Et produces a series of \defcitealias that can be copypasted elsewhere:
\defcitealias{Andrienko2003}{{GIS for Everyone: The
CommonGIS Project and Beyond}}
Finally, this can be used to build a custom command such as:
\newcommand{\MyCite}[1]{\citet*{#1}. \citetalias{#1}.}
Used as \MyCite{Andrienko2003} and producing: Andrienko et al. (2003). GIS for Everyone: The CommonGIS Project and Beyond.
I am currently stuck, having two separate glossaries: main & acronyms. Acronyms glossary prints footnotes on first use in the text, but main glossary does not. Is there any way to make any other glossary than acronyms to print footnote on first use of the term? I don't get how to do it.
Here is the code example compiled with TeXnic Center and MiKTeX 2.7:
\documentclass{article}
\usepackage{index}
\usepackage[toc,style=long3colheaderborder,footnote,acronym]{glossaries}
\makeindex
\makeglossaries
\newglossaryentry{appdomain}{name={application domain}, description={app Domain Description...}}
\newglossaryentry{sample}{name={[has been inserted aaa]},description={testing testing 123}}
\newacronym{aca}{aca}{a contrived acronym}
\begin{document}
\section{this is a test section}
This is the test line... a \gls{sample} \gls{appdomain}
\index{entry} and \gls{aca}
\thispagestyle{empty}\cleardoublepage
\printglossary[type=main,title={Glossary},toctitle={Glossary}]
\thispagestyle{empty}\cleardoublepage
\printglossary[type=\acronymtype,title={List of Abbreviations},toctitle={List of Abbreviations}]
\printindex
\thispagestyle{empty}\cleardoublepage
\end{document}
I want sample and appdomain either contain a footnote with description or a footnote stating: please refer to Glossary
Many thanks,
Ovanes
In short, with the glossaries package, you can't get footnotes on the first use for non-acronym glossaries.
However, you can redefine some commands in the preamble (after you \usepackage{glossaries}) to get what you want:
\makeatletter
\renewcommand{\gls#main#displayfirst}[4]{
#1#4\protect\footnote{#2}
}
\makeatother
But that will be really fragile.
I think there is an easier way of doing this. Maybe it's new, but
\defglsdisplayfirst[main]{#1#4\protect\footnote{#2}}
appears to achieve the exact same thing (correct me if I'm wrong). See the glossaries manual, version 2.03, subsection 2.4.1 changing the format of the text.
Unfortunately, it appears commands like \gls or \autoref does not work in those footnotes.
Following is a good technique, to put a footnote stating where the definitions are:
\label{nom} %put this on the page your term appears, so that it can collect page number
\newcommand{\g}{\footnote{For all abbreviations see the glossary on page \pageref{nom}.}}
I've found this from here.