In the past, I know two ways of writing a limit using $\rm \LaTeX$.
$\lim_{x \to 1} \frac{1}{x^2}$ looks OK.
$\lim_{x \to 1} \frac{1}{x^2}$
$\displaystyle \lim_{x \to 1} \frac{1}{x^2}$ looks better, but it occupies more than one line’s vertical space.
$\displaystyle \lim_{x \to 1} \frac{1}{x^2}$
For option (1), including limits in inline equations by _
doesn’t
look good since $x \to 1$ isn’t placed at the bottom of $\lim$.
If we want the text to occupy less space to save paper, then option (2) isn’t good. In order to see another drawback of this option, I have written some long (and meaningless) sentences here, so that the fraction in this paragraph appears in the middle. Although I seldom write in English, I have tried my best to illustrate my ideas with words. The vertical space created by the fraction in display style $\displaystyle \frac{1}{x^2}$ doesn’t match with the line separation of other lines in the paragraph. If you have already reached this line but you don’t understand what I’m saying, I’m write more so as to wrap the fraction with a chuck of text.
To create an inline limit $\lim\limits_{x \to 1} \frac{1}{x^2}$ which looks better in the middle of a paragraph. Fames ac turpis egestas. Duis ultricies urna. Etiam enim urna, pharetra suscipit, varius et, congue quis, odio. Donec lobortis, elit bibendum euismod faucibus, $\lim\limits_{x \to 1} \frac{1}{x^2}$ velit nibh egestas libero, vitae pellentesque elit augue ut massa. Praesent vel ligula. Nam venenatis neque quis mauris. Proin felis. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aliquam quam.
Use \lim\limits_{x \to 1} \frac{1}{x^2}
instead.
I reviewed my old post on power means inequalities.
At the 71st line of that post, I carelessly put a \|
instead of |
, causing it to be interpreted as rVert
.
As the MathJax tutorial on Math Meta SE pointed out, the
correct $\rm \LaTeX$ syntax for |
in {}
denoting a set should be
\mid
. However, the |
in {}
doesn’t match the fraction.
$$\max\left\{\frac{1}{a_i} \mid i = 1,\dots,k \right\}$$
gives
I need to change it back to
Following a comment by asmeurer, I tried
$$\max\left\{\frac{1}{a_i} \middle| i = 1,\dots,k \right\}$$
which gives
The horizontal spacing around |
isn’t correct.
$\max\left\{ \frac{1}{a_i} \,\middle|\, i = 1,\dots,k \right\} \quad \text{(right)} \\ \max\left\{\frac{1}{a_i} \middle| i = 1,\dots,k \right\} \quad \text{(wrong)}$
See the external link of this post by clicking the title of this post.
\|
as \lVert
or \rVert
.\providecommand{\norm}[1]{\lVert#1\rVert}
for denoting norms
in $\rm \LaTeX$ documents. Similar commands can be used for
absolute values and sets.Same as my recent post Writting Letter With Bibliography.
How to add a scanned signature to a $\rm \LaTeX$ document for the
lettre
class?
Searching “latex letter signature”, I quickly find an article on
texblog. If the \name{}
has been defined at the beginning of
the letter, then adding \forname
below the line
\fromsig{\includegraphics[scale=1]{signature.jpg}} \\
will give you another name, and {Your name}
will give you the
third one. Moreover, the alignment of the sender’s name isn’t
right.
According to the documentation of lettre
, the \signature{}
command
accepts only text as its arguments. I try redefining it, but the
alignment is still wrong. As a result, I decided to do it the
dirty way: I recalled the method of adding the sender’s name at the
closing part in Bio Teckna’s model letter. The
\begin{center}
environment is used. However, to make it look like a
French letter, I used \hspace{8cm}
to adjust the horizontal spacing.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
\documentclass[a4paper,12pt]{lettre}
\usepackage{fontspec}
\usepackage[frenchb]{babel}
\begin{document}
\begin{letter}{
Nom de destinataire \\
4, boulevard de la Paix, \\
12345 Nom de ville
}
\name{\null}
\address{
Votre NOM\\
23, rue à votre ville \\
23456 Nom de votre ville
}
\def\sigspace{-10mm}
\lieu{Votre ville}
\telephone{01 02 03 04 05}
\nofax
\email{fake@live.hk}
\def\concname{Objet :~}
\conc{Saisir votre objet}
\opening{Madame, Monsieur,}
Un exemple d'une lettre $\rm \LaTeX$ faite par \LaTeX. Le faux
texte ci-dessous est généré par le plugin Lorem Ipsum pour Vim.
% lorem{{{
Curabitur eget nisi at lectus placerat gravida. Vivamus nulla. Donec
luctus. Sed quis tellus. Quisque lobortis faucibus mi. Aenean vitae
risus ut arcu malesuada ornare. Maecenas.
Amet, rhoncus in, ipsum. Mauris rhoncus, lacus eu convallis sagittis,
quam magna placerat est, vitae imperdiet mauris arcu ac dui. In ac
urna non justo posuere mattis. Suspendisse egestas bibendum nulla. In
erat nunc, posuere sed, auctor quis, pulvinar quis, mi. Mauris at est.
Phasellus lacinia eros in arcu. Maecenas lobortis, tellus vel gravida
tincidunt, elit erat suscipit arcu, in varius erat risus vel magna.
Fusce nec ante quis dolor vestibulum bibendum. Pellentesque sit amet
urna.
% lorem}}}
\closing{Veuillez d'agréer, Madame, Monsieur, mes salutations les
meilleures.}
\begin{center}
\hspace{8cm}\fromsig{\includegraphics[scale=1]{sample-sign.jpg}}\\
\hspace{8cm}\fromname{Votre NOM}
\end{center}
\encl{pièces jointes}
\end{letter}
\end{document}
The final product can be viewed by clicking the link for the sample PDF with signature.
]]>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
\documentclass[12pt]{lettre}
\usepackage{fontspec}
\usepackage[frenchb]{babel}
\begin{document}
\begin{letter}{
Nom de destinataire \\
4, boulevard de la Paix, \\
12345 Nom de ville
}
\name{Votre NOM}
\address{
Votre NOM\\
23, rue à votre ville \\
23456 Nom de votre ville
}
\lieu{Votre ville}
\telephone{01 02 03 04 05}
\nofax
\def\concname{Objet :~}
\conc{Saisir votre objet}
\opening{Madame, Monsieur,}
Un exemple d'une lettre $\rm \LaTeX$ faite par \LaTeX. Le faux
texte ci-dessous est généré par le plugin Lorem Ipsum pour Vim.
% lorem{{{
Curabitur eget nisi at lectus placerat gravida. Vivamus nulla. Donec
luctus. Sed quis tellus. Quisque lobortis faucibus mi. Aenean vitae
risus ut arcu malesuada ornare. Maecenas.
Amet, rhoncus in, ipsum. Mauris rhoncus, lacus eu convallis sagittis,
quam magna placerat est, vitae imperdiet mauris arcu ac dui. In ac
urna non justo posuere mattis. Suspendisse egestas bibendum nulla. In
erat nunc, posuere sed, auctor quis, pulvinar quis, mi. Mauris at est.
Phasellus lacinia eros in arcu. Maecenas lobortis, tellus vel gravida
tincidunt, elit erat suscipit arcu, in varius erat risus vel magna.
Fusce nec ante quis dolor vestibulum bibendum. Pellentesque sit amet
urna.
% lorem}}}
\closing{Veuillez d'agréer, Madame, Monsieur, mes salutations les
meilleures.}
\end{letter}
\end{document}
You may view the output PDF before downloading the above sample.
]]>Recently, I need to write letters. Get the formatting for addressee and sender automatically done, I choose $\rm \LaTeX$. I cite a book in my letter, and try to add a bibliography at the end of the letter.
During the compilation for the following letter, an error was thrown.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
\documentclass[12pt]{lettre}
\usepackage{fontspec}
\usepackage[frenchb]{babel}
\usepackage[backend=biber]{biblatex}
\addbibresource{ltrbib.bib}
\usepackage{csquotes}
\begin{document}
\begin{letter}{
Nom de destinataire \\
4, boulevard de la Paix, \\
12345 Nom de ville
}
\name{Votre NOM}
\address{
Votre NOM\\
23, rue à votre ville \\
23456 Nom de votre ville
}
\lieu{Votre ville}
\telephone{01 02 03 04 05}
\nofax
\def\concname{Objet :~}
\conc{Saisir votre objet}
\opening{Madame, Monsieur,}
Un exemple de citation dans un document $\rm \LaTeX$. \cite{serre}
Le faux texte ci-dessous est généré par le plugin Lorem Ipsum pour
Vim.
% lorem{{{
Curabitur eget nisi at lectus placerat gravida. Vivamus nulla. Donec
luctus. Sed quis tellus. Quisque lobortis faucibus mi. Aenean vitae
risus ut arcu malesuada ornare. Maecenas.
Amet, rhoncus in, ipsum. Mauris rhoncus, lacus eu convallis sagittis,
quam magna placerat est, vitae imperdiet mauris arcu ac dui. In ac
urna non justo posuere mattis. Suspendisse egestas bibendum nulla. In
erat nunc, posuere sed, auctor quis, pulvinar quis, mi. Mauris at est.
Phasellus lacinia eros in arcu. Maecenas lobortis, tellus vel gravida
tincidunt, elit erat suscipit arcu, in varius erat risus vel magna.
Fusce nec ante quis dolor vestibulum bibendum. Pellentesque sit amet
urna.
% lorem}}}
\closing{Veuillez d'agréer, Madame, Monsieur, mes salutations les
meilleures.}
\printbibliography
\end{letter}
\end{document}
1
2
3
4
5
6
7
8
9
@BOOK{serre,
author = {Serre, J. P.},
title = {Cours d'arithmétique},
publisher = {Presse Universitaire de France},
year = {1970},
edition = {1ère ed.},
address = {Paris, France},
pages = {103--106},
}
Here’s my compilation procedure.
$ xelatex noltrbib.tex
$ biber noltrbib
$ xelatex noltrbib.tex
This is XeTeX, Version 3.1415926-2.5-0.9999.3 (TeX Live 2013/Debian)
restricted \write18 enabled.
...
! Undefined control sequence.
\\blx@head@bibliography [#1]->\section
*{#1}\markboth {\MakeUppercase {#1}}{...
l.52 \end
{letter}
?
...
I type <Enter>
at ?
, and get a PDF that seems OK. You may
read the log file for this file to know more about this error.
However, each time I use $\rm \LaTeX$-Suite to compile the document
inside Vim, a quickfix window pops up. This is quite inconvenient: I
need to use <C-w>k
to switch to the original buffer or ZQ
to close
the quickfix window. Therefore, I am motivated to find out a solution
for this error.
Luckily, I find the thread
Environment thebibliography undefined when using letter in
$\rm \LaTeX$ Forum extremely useful. In my opinion, if one can
include inline code in a post in this forum, the file name
letterbib.sty
and the command in the preamble can be shown in
monospaced font for readability.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
\documentclass[12pt]{lettre}
\usepackage{fontspec}
\usepackage[frenchb]{babel}
\usepackage[backend=biber]{biblatex}
\addbibresource{ltrbib.bib}
\usepackage{csquotes}
\usepackage{letterbib}
\begin{document}
\begin{letter}{
Nom de destinataire \\
4, boulevard de la Paix, \\
12345 Nom de ville
}
\name{Votre NOM}
\address{
Votre NOM\\
23, rue à votre ville \\
23456 Nom de votre ville
}
\lieu{Votre ville}
\telephone{01 02 03 04 05}
\nofax
\def\concname{Objet :~}
\conc{Saisir votre objet}
\opening{Madame, Monsieur,}
Un exemple de citation dans un document $\rm \LaTeX$. \cite{serre}
Le faux texte ci-dessous est généré par le plugin Lorem Ipsum pour
Vim.
% lorem{{{
Curabitur eget nisi at lectus placerat gravida. Vivamus nulla. Donec
luctus. Sed quis tellus. Quisque lobortis faucibus mi. Aenean vitae
risus ut arcu malesuada ornare. Maecenas.
Amet, rhoncus in, ipsum. Mauris rhoncus, lacus eu convallis sagittis,
quam magna placerat est, vitae imperdiet mauris arcu ac dui. In ac
urna non justo posuere mattis. Suspendisse egestas bibendum nulla. In
erat nunc, posuere sed, auctor quis, pulvinar quis, mi. Mauris at est.
Phasellus lacinia eros in arcu. Maecenas lobortis, tellus vel gravida
tincidunt, elit erat suscipit arcu, in varius erat risus vel magna.
Fusce nec ante quis dolor vestibulum bibendum. Pellentesque sit amet
urna.
% lorem}}}
\closing{Veuillez d'agréer, Madame, Monsieur, mes salutations les
meilleures.}
\printbibliography
\end{letter}
\end{document}
Finally, no compilation error is shown in the generated log. You may view the second generated PDF.
To install the above STY file, which isn’t found on CTAN, one needs
to manually download it to ~/texmf
on *nix. (Search “~/texmf” for
the way to find “temxf” on Win*.) Searching “texmf
linux refresh”, I find the way for a
$\rm \TeX$ database update. I miss the first argument
in the command texhash ~/texmf
, and then the installed STY file
can’t be found in ~/texmf/ls-R
.