1

I'd like to include in my LaTeX code some form of indication that certain words are keywords, or that a phrase is a quote, or that another phrase is an example, etc. Where can I find a list of inbuilt semantic indications like these?

  • 1
    Perhaps you should give an example of what you want to achieve, i.e. a screenshot and a MWE? – user31729 Mar 25 '14 at 9:12
  • Like this? tex.stackexchange.com/questions/163472/… – Thruston Mar 25 '14 at 9:43
  • Next time please provide an example of what you want. For instance, you could write, "I want the following code...<code>...to have the following output...<output>." This way I can clearly see that you require your keywords to be "in the text" and the keywords list generated. I'd be able to tell: weather you want the list to be itemized or listed in paragraph form (keyword1, keyword2, etc), weather you want the keywords to be listed in the body or margin of the document, weather you want them to be listed alphabetically or in the order they appear in the document, etc. – Far Zin Mar 25 '14 at 11:49
  • You can define your own environments to do this: \newenvironment{toy}[0]{}{}. then use the environment: \begin{toy}teddy bear\end{toy}. Of course this environment doesn't change the style but you can add that if you want to. – user10274 Mar 25 '14 at 14:00
  • Sorry for not providing an example. I just thought it was one of the selling points of LaTeX to just indicate semantics in the document and let it take care of the rest; so I assumed it was enough to just ask a short question. I didn't have anything particular in mind, was just wondering about inbuilt semantic indicators. – mtanti Mar 25 '14 at 16:49
2

There are not many inbuilt semantic macros like that, even though LaTeX premieres dividing semantics from typography. Sometimes you instead define your own command in the preamble, like

\newcommand\movie[1]{\textit{#1}}

for writing movie titles in italics (especially when you might change your mind about how to render that kind of element later). Or you use a package for handling a special kind of element.

Maybe the kind of keywords you mean (indicated in a special way when introduced) is a job for a package like glossaries. Maybe the kind of examples you mean are like numbered examples in linguistics? There are several packages that do these. I don't think you will find that list, and are better off asking about particular needs.

|improve this answer|||||
1

Use \begin{quote} and \end{quote} for quotations.

For keywords, use the index package. Use ^[aut]{yourkeyword} to identify a keyword. add the example's preamble to your document:

\documentclass{article}    
\usepackage{index}

\newindex{aut}{adx}{and}{Name Index}
\newindex{not}{ndx}{nnd}{List of Notation}    
\shortindexingon
\proofmodetrue    
\def\aindex{\index*[aut]}

\begin{document}

Lorem ^[aut]{ipsum} dolor sit amet, consectetur adipiscing elit.

^[aut]{consectetur} adipiscing elit. Aliquam vitae orci ante. Maecenas ^[aut]{viverra}.

interdum molestie dapibus tincidunt, dignissim sit amet risus. ^[aut]{Quisque}.

\end{document}

This prints:

enter image description here

The keywords will appear in the right margin.

|improve this answer|||||
  • By keywords I mean keywords in the text, not a collection of keywords. So every time I introduce a new keyword I somehow highlight it. – mtanti Mar 25 '14 at 6:32
  • See my most recent edit. – Far Zin Mar 25 '14 at 11:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.