9

I am learning the use of LaTeX by porting an 12-page LibreOffice Writer file to a set of pdflatex input files.

The ability to separate the source in different files and later generate a single output file is nice. Automatic chapter/section/subsection numbering and index generation is also cool.

However, here the benefits that I am seeing stop. When transferring bolded text, I do {\bfText} (which seems to be actually incorrect). When inserting pictures, I do /insertgraphics{../images/picture}. When doing italics, I do \emph{Text}.

I feel that I am missing something huge.

There is a common problem among programmers, when someone has to quickly do some development in an unknown programming language, they would learn the syntax, but not the idiomatic way to do things, and write very bad code. I feel the same is happening to me here.

Is it correct to use \emph to make whole paragraphs italics? Is it correct to use \insertgraphics to place an illustration exactly here, because it is related to a certain paragraph, and would make less sense if using \figure latex moves it wherever it decides?

EDIT:

My goals are:

  • When the text is being skimmed, the most important words and numbers should stand out. That is, if someone has read the text, by skimming it, they should be able to find concrete information rapidly. I am currently using {\bfText} for this.
  • Some paragraphs are short stories, while the rest of the text is rules and numbers. I want the stories to look different, so that the person from the previous point skips them entirely, while a new reader would know that this is just a story and he doesn't need to pay much attention and look for important information in it. I am using \emph{TheWholeParagraph} for this.
  • Figures are illustration, associated with the start of a new section. As such, they should be somewhere around the heading. Their purpose it to invoke atmosphere, related to the new content.
Vorac
  • 743
  • 7
    It's I think impossible to answer your question, it's just too chatty and I'm afraid that it can happen that there'll soon be dozens of answers with no really good content. Moreover, the whole post speaks about differences of LaTeX and Word, and in the end you ask "And how to get to speed?". Anyways, just as a comment: Section numbering is far from the only thing that is inconsistent in most text processors, that's the main reason why they are quite bad, and that's something which can't change; the typographic quality can change, but that's a very long long run. – yo' Feb 17 '14 at 08:38
  • 2
    The logical markup of content is a huge benefit, if you have to change some kind of formatting throughout the whole document (or in other documents),this could be done generally. Another benefit is the mathematical markup and its ready-to-print output. –  Feb 17 '14 at 08:38
  • @tohecz, I'll try to edit my question. My specific aim is to write well in latex and not copy-paste the formatting from W+. – Vorac Feb 17 '14 at 08:39
  • @Christian, please give me some pointers. I know that e.g. \emph makes the text italic and thats all. How can I change that post-factum? Why would I want to? – Vorac Feb 17 '14 at 08:45
  • 2
    As @Christian said, the logical markup helps a lot. You shouldn't use \emph{…} when you want italics. You should use \emph{…} when you want to emphasize something. Wether the emphasis is done by italizing content or putting it bold is another story. So… what do you MEAN with \textbf{…} or \textit{…}? – Manuel Feb 17 '14 at 08:45
  • 1
    @Vorac: A quick example,you want to markup some words etc. all with the same style, say to use it in some version of a document as italic and decide later on, that bold would be better, you could define \newcommand{\mymarkupcommand}[1]{\textit{#1}} first and later change to \renewcommand{\mymarkupcommand}[1]{\textbf{#1}} –  Feb 17 '14 at 08:50
  • 1
    @Vorac About your last edit. If you want to emphasize with bold then change the meaning of \emph so it uses the bold font rather than the italic font. About those “quotes” or “stories”, you can define new environments (or use some predefined like quote) so you write \begin{story} TheWholeParagraph \end{story} and then tell LaTeX to do whatever you want with that paragraph, in this case it seems that you just want it to be in italics. – Manuel Feb 17 '14 at 08:52
  • @Vorac: If you want to have a figure exact at that place you should use \includegraphics alone, otherwise let LaTeX do a 'wise' floating inside the figure `environment. It depends on the purpose of your document, for example, in a pdf presentation, that figure must basically appear at a certain position and should not float around. –  Feb 17 '14 at 08:54
  • @Vorac: By the way, I agree with tohecz -- this question is not suitable for this platform in that sense, that there is no precise answer but most probably a lot of 'pros' and 'cons'. –  Feb 17 '14 at 08:56
  • @Christian, could you suggest an aggressive edit? The comments have lead me to the EDIT section, and Manuel has provided above a comment that nearly answers my concerns. – Vorac Feb 17 '14 at 09:07
  • 7
    As nobody seemed to mention it already: The best way to start is take a few days and read some introductory material. You can save a lot of time in the long run, so please see it as an investment. – Johannes_B Feb 17 '14 at 09:09
  • 1
    I started using LaTeX about a month ago, and now consider myself well enough up to speed to be writing my PhD thesis in it. Of course, I still have problems, but this community has been fantastic for help with that. Here are a few links that I've found helpful: LaTeX wiki link; CTAN: Comprehensive Tex Archive Network link; University of East Anglia thesis writing guide: link. – cjms85 Feb 17 '14 at 09:24
  • @Vorac: To be candid, I am not sure what you mean by 'aggressive edit'? –  Feb 17 '14 at 09:35
  • @Vorac: User cjms85 gave some nice links to start with, the content there is worth to be read. –  Feb 17 '14 at 09:45
  • @Christian, I have read the tutorial, that's how I configured the Bulgarian handling. And am referencing the book, but only reading without practice is beginning to be heavy on me.Maybe I'm a slow learner :) – Vorac Feb 17 '14 at 09:54
  • @Vorac: Well, transforming an LibreOffice/Word file to LaTeX is not an easy task, depending on the contents. Do you not expect to format the LateX version such that the corresponding pdf output looks exactly the same as provided by standard text processors, but the huge amount of work is worth to do it, however, it might be slow in the beginning. –  Feb 17 '14 at 10:01
  • @Vorac I think part of the answer to your question is: no regular LaTeX user would produce a document such as the one you describe (and which is quite common amongst Word users). I don't know if there is much point in trying to reproduce it, knowing that it is probably not an example of good typography anyway. Why not try to write something directly in LaTeX? Just paste-in plain text and then play around with it thinking of what you mean before you decide on using a command. – ienissei Feb 17 '14 at 12:05
  • 4
    Ideally, \bfseries, \textit{}, \Large etc. should only ever appear before \begin{document} (i.e. in the preamble) where you define semantic macros that use them. \emph{} is such a semantic macro, predefined. – Crissov Feb 17 '14 at 13:08

4 Answers4

10

I agree with @tohecz that this is a bit of a scattered question, but I'll try to answer each individual part and bring it all together.

The highlight of everything that follows:

With LaTeX (and TeX systems in general), it's essential to realize that even though TeX is processing your document and LaTeX has defined a format you should try and stick to, the ultimate author of the document is you. Write your document, figure out the rest later.


However, here the benefits that I am seeing stop. When transferring bolded text, I do {\bf Text} (which seems to be actually incorrect). When inserting pictures, I do /insertgraphics{../images/picture}. When doing italics, I do \emph{Text}.

I feel that I am missing something huge.

The comments and other answers correctly state that idiomatic LaTeX uses the 'core' commands exclusively in the preamble—the portion of your document that is not typeset. Good practice would suggest creating new commands that capture the intent of the markup rather than its behavior. For example, instead of saying

...
Here is some text that I want
to {\bf stand out} while I'm
reading the document
...

you could instead say

\documentclass{...}
...
\newcommand\skimmable[1]{{\bfseries #1}}
...
\begin{document}
...
Here is some text that I want
to \skimmable{stand out} while I'm
reading the document

Is it correct to use \emph to make whole paragraphs italics?

No. Use environments for this, as noted below.


Is it correct to use \insertgraphics to place an illustration exactly here, because it is related to a certain paragraph, and would make less sense if using \figure latex moves it wherever it decides?

It's not terrible, but there are packages that provide such semantic markup to place a picture in-par depending on your use case. See texdoc wrapfig, for instance. (Type texdoc wrapfig into your terminal—texdoc is quite simply an amazing resource.) Again, I would abstract your use cases in ideas such as

\inparpicture[pos=mid right, width=5cm]{path/to/graphic}

(As a sidenote, it's generally bad practice to have a cross–edge in our directory tree from your TeX sources to your graphics. Just make images/ a subdirectory of your source files, if you can.)


When the text is being skimmed, the most important words and numbers should stand out. That is, if someone has read the text, by skimming it, they should be able to find concrete information rapidly. I am currently using {\bfText} for this.

As noted, create and use semantic markup for this. I am surely beating a dead horse by now, but you may decide later that bolding text doesn't work quite a well as, say, coloring the text… or framing the text… or…. Using semantic markup for this is not only idiomatic, but extraordinarily useful.

Some paragraphs are short stories, while the rest of the text is rules and numbers. I want the stories to look different, so that the person from the previous point skips them entirely, while a new reader would know that this is just a story and he doesn't need to pay much attention and look for important information in it. I am using \emph{TheWholeParagraph} for this.

The current approach has two problems:

  • Not using semantic markup.
  • You cannot have multi-paragraph short stories. (Try it.)

Use environments:

\newenvironment{story}{\itshape}{}

This solves both problems simultaneously.

Figures are illustration, associated with the start of a new section. As such, they should be somewhere around the heading. Their purpose it to invoke atmosphere, related to the new content.

There is a question around here that does exactly this, but I cannot find it. Perhaps you may have better luck, or someone can chime in below. In the meantime, it is perfectly reasonable to 'abstract this away' using semantic markup (oh no, not again!) to express what you want to do:

\section{Some new heading}[illustration=path/to/illustration]

As you can see, it's feasible to even have existing commands be altered/extended to fit the needs of the document. With LaTeX (and TeX systems in general), it's essential to realize that even though TeX is processing your document and LaTeX has defined a format you should try and stick to, the ultimate author of the document is you. Write your document, figure out the rest later.

Sean Allred
  • 27,421
7

There are two main differences I see between text processors and LaTeX:

  1. TeX is a typesetting system. LaTeX is about ridding you of the burden of trying to do page and paragraph layout. Layouting was done for you by people who really know this stuff. This is the main reason why Word documents look so ugly: many authors fiddle with the layout settings without knowing what they do. (And the default page layout is very bad, IMHO).

  2. The LaTeX markup is a semantic markup. You tell the system about the meaning of a part of the input, and leave it to decide how to show that meaning in the document. Examples would be emphasize, which is done with italics, except of course if the surrounding text is already emphasized. Then, normal is the typeface to use, and LaTeX will do this correctly.

If you are an expert in layout and typography and want and need full control, then a DTP system would be for you. Neither Word, nor LibreOffice nor LaTeX would be the proper tool.

Frank
  • 313
  • 1
    Regarding the last comment: ConTeXt has been developed for this use case. – Sean Allred Feb 17 '14 at 15:38
  • 1
    Not true. I use LaTeX with the aim of top-level typography, and I can say that I have the full control that I need, since I can always step down to the low-level TeX layer and do something there. – yo' Feb 17 '14 at 16:13
  • 1
    @tohecz: not true. ;) In fact, LaTeX was developed (more or less) to help typeset scientific papers in computer science. It is possible to do high-quality typesetting of (almost) anything using LaTeX, but you need add-ons (aka packages), and sometimes it just doesn't feel right (why would you need a package or low-level trickery to change something as trivial as enumeration style?). So you can use LaTeX for that, but this is not precisely its design goal. – mbork Feb 17 '14 at 21:10
  • 2
    Let's not argue over that, because it doesn't make sense. I need packages because my day doesn't have 256 hours. – yo' Feb 17 '14 at 21:25
3

Regarding bold, the best practice is to use the \textbf{bold text} commnad. As the link you provided says, the \bf command is deprecated.

Now, for italicized text the best practice is to use \textit{italicized text}, which is the equivalent of the previous command. The \emph command you are using is intended for emphasizing, as some commenters have posted. But that emphasis can be defined as any kind of formatting, be it italicized, underlined, bold, etc.

So keeping those things in mind, I believe the best is for you to emphasize the words you need to stand out, using the \emph command. You then can redefine it so that it gives the result you want (bold text), instead of changing the command preceding every single emphasized word. You can redefine using the following code on your preamble:

\makeatletter
\DeclareRobustCommand{\em}{%
  \@nomath\em \if b\expandafter\@car\f@series\@nil
  \normalfont \else \bfseries \fi}
\makeatother

Now, regarding italicized paragraphs, you could just use:

\textit{
The whole paragraph
}

to achieve the effect. But again, its best to have an environment that differentiates the special paragraph and then define that environment to make it look whatever you want it to look like. For example, you could create a new environment that works like the quote environment but with italicized text, by using the following code in your preamble:

\newenvironment{myquote}
{\begin{quote}\itshape}
{\end{quote}}

Then, each of the paragraphs containing the short stories should be put inside the new myquote environment, like this:

\begin{myquote}
The whole paragraph.
\end{myquote}

Lastly regarding pictures, if its just to evoke a mood and not for future reference, the it may be best to just include them with the \includegraphics{}, by use of the graphicx package.

Hope it helps!

PS. I have to add that what others have commented is true: you should probably invest a few days reading the basics of writing in LaTeX. Or at least have a guide handy, so you can check there if what you are doing is right. Also, the title of your question is a bit misleading ;)

han-tyumi
  • 1,152
  • 8
  • 17
0

FWIW, I often recommend to new users (like myself) that they try to export their OpenOffice files to LaTeX and then process them in LaTeX just to see the difference. Many converts have thus been won.

In a way your question asks, "how I can get better at LaTeX?" and for that you should read the various manuals that are out there; as many as you can. The memoir manual in particular (both sections) have a lot to say about typesetting and book design.

Another way of emphasizing text is by increasing the font size. You can do this quickly by using one of the following commands:

\tiny
\scriptsize 
\footnotesize 
\small
\normalsize % (default)  (except this one)
\large 
\Large % (capital "L") 
\LARGE % (all caps) 
\huge 
\Huge % (capital "H") 
azetina
  • 28,884
user26732
  • 1,785
  • 2
  • 22
  • 35
  • Hi! Can you please show us any example of a profesionally typeset document where text is emphasized by font size? – yo' Feb 17 '14 at 17:35
  • @tohecz: let me play devil's advocate here. What do you think about displayed math (as opposed to inline math), like \dfrac and \tfrac? ;) – mbork Feb 17 '14 at 17:45
  • Also, look at Tschichold's New Typography and the (terrible imho) boldface emphasizing... Not exactly fontsize, but close. – mbork Feb 17 '14 at 17:48
  • Last but not least, smaller font size is quite often used to, say, deemphasize text (think footnotes, for instance). – mbork Feb 17 '14 at 17:49