Mathematics learners ask questions on Mathematics Stack Exchange to get an answer from others without geographical or time restrictions, unlike teachers in schools. Users answer questions to gain virtual points called reputation.
Among them, many are new users who don’t use MathJax while typing their questions. As a result, the output is difficult to read. This discourages users from answering those questions, so we would have less answers to read. Since we can sometimes benefit from alternative solutions, it’s better to post a question that is clear enough to attract others to offer an answer. We can downvote those poorly rendered questions, but I think it’s a bit cruel to do so on the very first post from new users. Therefore, I choose to leave a comment which suggests them to use $\rm \LaTeX$. They often say they don’t know how to use it. To avoid responses like that, I include a link to the MathJax guide on Meta Math.SE.
Please use $\rm \LaTeX$.
However, it’s tedious to type the markdown source code every time I want to leave this comment.
I’ll include the code below, so that it can be simply copied and pasted next time.
1
Please use <a href="http://meta.math.stackexchange.com/q/5020/290189">$\rm \LaTeX$</a>.
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
.
To provide a good-looking template of basic linear programs for users of Mathematics Stack Exchange.
1
2
3
4
5
6
7
\begin{array}{cccll}
\max &z=&x_1&+x_2 & <br />
\text{s.t.}& & & \phantom{+}x_2 + s_1 &= 8 <br />
& & -x_1&+x_2 - s_2&=-4 <br />
& & x_1&+x_2+s_3&= 12 <br />
& & & s_1,s_2,s_3 &\ge 0
\end{array}
If you want a prettier template, you may see
this $\rm TeX$–$\rm \LaTeX$ Stack Exchange question. I
tried added @{}
in the first argument of the array
environment to
eliminate the excessive inter-column space—this works great in $\rm
\LaTeX$. However, neither @{}
nor \multicolumn{4}{l}{...}
is
processed by MathJax.