Latex - Several lines of points in the table of contents in pdf - latex

In my table of contents, between 2 sections there are several points. Look this screenshot Bug section of table of contents
There is my code
\section[Lecture du fichier excel avec la librairie pandas]{Lecture du fichier excel avec la librairie pandas}
La librairie pandas me permet
de lire des csv et \ des fichiers excel . Gr\^ace \`a cette librairie,
je peux transformer les donn\'ees d{\textquoteright}un format excel ou
csv , en dataframe. Un dataframe est simple \`a utiliser et tr\`es
rapide \`a lire car il est stock\'e dans la m\'emoire RAM . \ Voici un
sch\'ema repr\'esentatif :
\begin{center} \includegraphics[width=16.002cm,height=8.091cm]{MmoiredestageV10libreoffice-img5.png} \end{center}
My question : why there are several lines ? and how to remove it .
I am using kile
Thanks

I'm stupid I found the problem.
I used the writer2latex, which convert odt to latex. And he adds lots of empty subsection. I removed it .
Like that
\subsection{}
\subsection{}
\subsection{}
\subsection{}
\subsection{}
\subsection{}
\subsection{}

Related

Can I mix markdown code block declaration and latex commands in a custom latex command?

For markdown, with Latex, I wrote a convenient command :
\newcommand{\mauve}[1]{\textcolor{Purple}{#1}}
\newcommand{\fonction}[1]{\begingroup\small\mauve{\texttt{#1}}\endgroup}
\newcommand{\cadreGris}{\renewtcolorbox{quote}{colback=darkgray!5!white,arc=0pt,outer arc=0pt,boxrule=0pt,lowerbox=invisible,code={\tcbset{enlarge left by=0cm}}}}
\newcommand{\code}{\begingroup\cadreGris\footnotesize}
that helps me formatting my source code in markdown that way:
On peut rajouter aux périodes des durées avec \fonction{plusYears(...)}, \fonction{plusMonths(...)}... ou en retrancher avec \fonction{minusDays(...)}...
- la classe \fonction{Duration}...
\code
> ```scala
> import java.time.Duration
> java.time.temporal.ChronoUnit
>
> Duration.of(10192927, ChronoUnit.MILLIS) // PT2H49M52.927S
> ```
\endgroup
Il est possible d'utiliser les méthodes \fonction{toHours()}, \fonction{toDays()}... Mais attention : elles retournent des nombres entiers. Ci-dessus, un `getDays()` renverra 0, car il y a 0 jours... et 2 heures.
Which produces this result I enjoy:
But is there a way I could create a new command, for example \scala,
that would perform:
\code
> ```scala
and then an \endcode that would produce:
> ```
\endgroup
Meaning : is there a way to mix blocks declaration of "markdown kind" and latex commands in a command definition?

— File ended while scanning use of \#xdblarg. LaTeX work

Can you please help me to find the error? I think it's ok the first part, but i can't find the error with the equation that should be a system.
'''\documentclass[a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\title{Test di \LaTeX del Laboratorio di Comunicazione
mediante Calcolatore}
\author{Sara Pia Ciccotosto \\
\textbf{s.ciccotosto#studenti.unipi.it}}
\begin{document}
\maketitle
\section{Teorema del laboratorio}
\subsection{ L’enunciato classico}
\paragraph{Scopo di queste note `e dimostrare in modo formale un risultato noto in letterature come \textit{Teorema del Laboratorio}. Si tratta di un risultato che ha un ruolo
fondamentale nella trattazione analitica di alcuni problemi di Cauchy, come il
seguente:
\begin{equation}
\begin{cases}
\frac{dy(x)}{dx} = 1+x^2 y(x) \\
y(0)=0
\end{cases}
\end{equation}'''
this is the output:
Runaway argument?
{Scopo di queste note `e dimostrare in modo formale un risultato noto\ETC.
! File ended while scanning use of \#xdblarg.
<inserted text>
\par
<*> "./test lcmc.tex"
?
and in "Error, warnings and badboxes" is written "File ended while scanning use of #xdblarg"
Thank you!

Lua find "\x" in the player names

the players on my server are joining with Emojis on his names and that is not permitted, I tried to create a if check, but it doesn't work properly
if string.find(playerName, "%^") or string.find(playerName, '%\') then
deferrals.done("Por favor, elimine sus emojis y códigos de color de su nombre.")
end
The syntax highlighting already tells you what's wrong: \ is used in Lua as an escape character, so the ' behind it doesn't close the string which instead goes on until the next ' smoewhere in your code. Use \\ if you want a single \
if playerName:find("%^") or playerName:find("%\\") then
deferrals.done("Por favor, elimine sus emojis y códigos de color de su nombre.")
end
By the way; if you don't need patterns in your search, you can disable them by passing false as the second argument to string.find:
if playerName:find([[^]], 1, false) or playerName:find([[\]], 1, false) then
deferrals.done("Por favor, elimine sus emojis y códigos de color de su nombre.")
end
And just in case, try adding an or true to the condition, so it activates for all player names; that way you can find out if it's the condition itself that fails, or the code inside the if block.

Encoding: 008D character?

Problem: I have a bunch of txt files written in Portuguese on a Windows machine using NotePad. Some of them seem to have been encoded as ANSI. When I open these files using gedit on Ubuntu, some of them contain boxes containing 008D (see screenshot). This is after converting them to UTF-8.
When I print the file contents to the terminal using cat, head or more, this is the output of the same file. Note that everything from última vez up to and including the strange character isn't printed to the terminal.
Olá madrinha! Eu gostava de ir contigo passar férias na montanha, porque acho que vai ser divertido e há muito tempo que já não vou a tua casa e na últimaar a ter saudades. Madrinha, não sei porque és tão simpática comigo mas para mim, és a melhor madrinha do mundo inteiro. Madrinha, ajudas-me sempre que preciso e estás sempre a apoiar-me por isso, quero ir a tua casa para te apoiar a ti. Obrigada madrinha, por me apoiares. Muito obrigado madrinha
When I open the same file using atom.io, everything looks as it should:
Questions: Most pressingly: How can I get rid of this character without opening all files and manually deleting them? And secondly, what is this, i.e., what should I google to solve similar problems?
Found the magical keywords ('remove unicode string using sed'). This does the trick: https://stackoverflow.com/a/8562661/1331521:
# Define unicode character you want to remove;
# In this case 008D:
CHARS=$(python -c 'print u"\u008D".encode("utf8")')
# Then run sed on all files in directory
sed -i 's/['"$CHARS"']//g' *

Dual-line bilingual paragraph in LaTeX [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
An interlinear gloss can be used to layout a translation of a document.
http://en.wikipedia.org/wiki/Interlinear_gloss
Usually this is done word-by-word or morpheme-by-morpheme. However, I would like to do this in a different way, translating entire paragraphs at a time. The following link and image is an example of what I want done, though I want to do it for a different text which is larger.
http://www.optimnem.co.uk/learning/spanish/three-little-pigs.php
For now I am not interested in taking into account the order of words or phrases that change order between languages. That is, I don't mind if the words in the paragraph are not aligned or if the length of one paragraph is much longer than the other, causing an overhanging line.
As far as I can tell, the following packages do not meet my needs:
covingtn.sty
cgloss4e.sty
gb4e.sty
lingmacros.sty - shortex
Here is the english version:
In the heart of the forest lived three little pigs who were brothers. The wolf always was chasing them in order to eat them. In order to escape the wolf, the pigs decided to make a house each. The smallest made his from straw, to finish first and go out to play. The middle one constructed a cottage from wood. Seeing that his little brother had finished already, he hurried to go and play with him. The oldest worked on his house of brick. 'You'll soon see what the wolf does with your houses,' he scolded his brothers but they were having a great time.
Here is the spanish version:
En el corazón del bosque vivían tres cerditos que eran hermanos. El lobo siempre andaba persiguiéndoles para comérselos. Para escapar del lobo, los cerditos decidieron hacerse una casa. El pequeño la hizo de paja, para acabar antes y poder irse a jugar. El mediano construyó una casita de madera. Al ver que su hermano perqueño había terminado ya, se dio prisa para irse a jugar con él. El mayor trabajaba en su casa de ladrillo. - Ya veréis lo que hace el lobo con vuestras casas - riñó a sus hermanos mientras éstos se lo pasaban en grande.
I don't want to do it manually like this:
\documentclass{article}
\usepackage[margin=1in, paperwidth=8.5in, paperheight=11in]{geometry}
\usepackage[utf8]{inputenc}
\usepackage{url}
\begin{document}
\noindent
\url{http://www.optimnem.co.uk/learning/spanish/three-little-pigs.php}\\
\\
\indent
En el corazón del bosque vivían tres cerditos que eran hermanos. El lobo siempre\\
\indent
In the heart of the forest lived three little pigs who were brothers. The wolf always\\
\\
%
andaba persiguiéndoles para comérselos. Para escapar del lobo, los cerditos decidieron\\
was chasing them in order to eat them. In order to escape the wolf, the pigs decided to\\
\\
%
hacerse una casa. El pequeño la hizo de paja, para acabar antes y poder irse a jugar.\\
make a house each. The smallest made his from straw, to finish first and go out to play.\\
\\
%
El mediano construyó una casita de madera. Al ver que su hermano perqueño había\\
The middle one constructed a cottage from wood. Seeing that his little brother had\\
\\
%
terminado ya, se dio prisa para irse a jugar con él. El mayor trabajaba en su casa de\\
finished already, he hurried to go and play with him. The oldest worked on his house of\\
\\
%
ladrillo. - Ya veréis lo que hace el lobo con vuestras casas - riñó a sus hermanos\\
brick. 'You'll soon see what the wolf does with your houses,' he scolded his brothers\\
\\
%
mientras éstos se lo pasaban en grande.\\
but they were having a great time.\\
\\
\end{document}\\
I would like to use a package or a macro to automatically have the english and spanish texts interspersed with line breaks when the end of the line has been reached for each. How can I layout this simple dual-line biligual paragraph in Latex in a more automated way (without manually adding line breaks)?
The following hack may help you achieve your goal. It's based on the idea of a zero-height minipage to overlap two triple-spaced minipages.
I'll use placeholders for the English and Spanish text (\english and \spanish respectively). Also, be sure to include the setspace package:
\usepackage{setspace}
\def\english{In the heart of the forest lived three little pigs who were brothers. The wolf always was chasing them in order to eat them. In order to escape the wolf, the pigs decided to make a house each. The smallest made his from straw, to finish first and go out to play. The middle one constructed a cottage from wood. Seeing that his little brother had finished already, he hurried to go and play with him. The oldest worked on his house of brick. 'You'll soon see what the wolf does with your houses,' he scolded his brothers but they were having a great time.}
\def\spanish{En el corazón del bosque vivían tres cerditos que eran hermanos. El lobo siempre andaba persiguiéndoles para comérselos. Para escapar del lobo, los cerditos decidieron hacerse una casa. El pequeño la hizo de paja, para acabar antes y poder irse a jugar. El mediano construyó una casita de madera. Al ver que su hermano perqueño había terminado ya, se dio prisa para irse a jugar con él. El mayor trabajaba en su casa de ladrillo. - Ya veréis lo que hace el lobo con vuestras casas - riñó a sus hermanos mientras éstos se lo pasaban en grande.}
By giving the top block a height of 0pt we allow for the next minipage to overlap it.
\begin{minipage}[t][0pt]{\linewidth}
\setstretch{3}
\english
\end{minipage}
\begin{minipage}[t]{\linewidth}
\setstretch{3}
\spanish
\end{minipage}
The primary One of the problems with this idea is that if the zero-height section is longer than the regular section, then you'll have some lingering overlapping text to deal with. (Edit: This problem is addressed in the comment below, note that line-breaks will also be a serious drawback to this idea.)
The result (in part):
I don't think there is a package to do what you want, but it is possible to implement this yourself using \vsplit, which is well documented in Tex by Topic (availble for free download, or in the dead-tree edition via Lulu). The basic idea is
You define two vboxes, one for the English, one for the Spanish, and you want to take out the contents one line at a time. Call these vboxes \ENbox and \ESbox;
You need to determine the correct vertical dimension to use: this might be \lineheight, or you might need a different value, you will have to experiment. Assuming \lineheight is right ...
... then you can get the next line of English using \setbox\nextline=\vsplit\ENbox to \lineheight, which you can output using \unvbox\ENbox, then likewise the next line from \ESbox, then some vertical space for the intergloss gap;
Then you need to test the loop, which you can do by querying the vertical heights, using \ht, of \ENbox and \ESbox. This bit will be fiddly.
All-in-all, this will be somewhat tricky coding: good luck, and don't hesitate to ask questions here if you run into difficulties.
Postscript This is obviously much more work than Geoff's much simpler solution, which for some reason I hadn't seen when I wrote this, but it should be more flexible if you want to fiddle with it.
If you want to interlace Spanish and English paragraphs, and have them line up approximately correctly, then what you want is to write your translations word-by-word (or several words by several words), and use a gloss package that can wrap long sentences. I've done this before using gloss.sty. An example of its use(the goal was to gloss each word with its part of speech):
\gloss Both knowledge and wisdom extend man's reach. Knowledge led to
cjc nn0 cjc nn0 vvb {nn0 pos} {nn0 pun} nn0 vvd prp
\gloss computers, wisdom to chopsticks. Unfortunately our association is
{nn2 pun} nn0 prp {nn2 pun} av0 dps nn1 vbz
\gloss overinvolved with the former. The latter will have to wait for a
ad0 prp at0 {nn0 pun} at0 nn0 vm0 vhb to0 vvb avp at0
\gloss more sublime day.
av0 aj0 {nn1 pun}
\unhbox\gline
The package lines things up words from the first language with words from the second "language" using spaces. To line up multiple words in one language with a single word (or multiple words) from the other language, use braces to group the multiple words. Though the lines here are interlaced, this is just for my editing convenence. You could write really long lines if you wanted to, and the gloss algorithm will wrap them properly.
I've also used a two-column paragraph-by-paragraph approach using the parallel package.
put an extra line break in between each set of lines:
%
andaba persiguiéndoles para comérselos. Para escapar del lobo, los cerditos decidieron
was chasing them in order to eat them. In order to escape the wolf, the pigs decided to
%

Resources