I want to write horizontal bullet points in latex. How can I do that? as far as I got some solution on the internet is a vertical list with numbers.
How can I get bullet points instead of numbers?
My current code is something like this-
\documentclass[twoside = false, % doppelseitiger Druck
DIV=17, % DIV Faktor für Satzspiegelberechnung, sie Doku zu KOMA Script
BCOR=15mm, % Bindekorrektur
chapterprefix=false,
headinclude=true,
footinclude=false,
pagesize, % write pagesize to DVI or PDF
fontsize=11pt, % use this font size
paper=a4, % use ISO A4
bibliography=totoc, % write bibliography-chapter to table of contents
index=totoc, % write index-chapter to table of contents
cleardoublepage=plain, % \cleardoublepage generates pages with pagestyle empty
headings=big, % A4/B5
listof=flat, % improved list of tables
numbers=noenddot
]{scrbook}
\begin{inparaenum}
\item A
\item B
\item C
\item D
\item E
\item F
\item G
\end{inparaenum}
\end{document}
Assuming you are using the paralist package... use the inparaitem instead of inparaenum
\documentclass[11pt]{article}
\usepackage{paralist}
\begin{document}
This list includes the following :
\begin{inparaitem}
\item option A
\item option B
\item option C
\end{inparaitem}\\
Please choose an option
\end{document}
For horizontal list:
\documentclass{article}
\usepackage[inline]{enumitem}
\begin{document}
Text before list.
\begin{enumerate*}
\item My first in list.
\item My second in list.
\end{enumerate*}
Text after list.
\end{document}
For more examples, please visit overleaf.
Related
I have this problem:
\begin{center}
\begin{minipage}{2in}
\begin{enumerate}[{1)}]
\item $p \lor \neg q$ Agregacion
\item $q \ent p$ Equivalenica
\end{enumerate}
\end{minipage}
\end{center}
I want that the text in every item (not the math part) aligned with the text from above .
Like a list, where I can said what rule I applied with text.
Like if every item have "2 columns" the left one for the equation and the right one for a kind of explanation.
If I understood correctly, you would like to have an enumerate list with two columns: math expressions and texts.
Since you already have the list, I would customise it via enumitem and then enclose equations inside makebox to make sure equations span the same space (basically the same approach as samcarter_is_at_topanswers.xyz's but with slightly expanded example). The most involved part is a set of list parameters; it keeps text within a column should it span multiple lines.
This approach will fail if you have a more complex equations, though
\documentclass{article}
\usepackage{amsmath}
\usepackage{enumitem}
\newlength\firstcollen % Controls first column length
\AtBeginDocument{\setlength\firstcollen{0.3\textwidth}}
\usepackage{kantlipsum} % Just for dummy text
\newcommand\itemmath[1]{\item%
\parbox[t]{\firstcollen}{\ensuremath{#1}}%
\ignorespaces}
\begin{document}
\begin{enumerate}[
label=\arabic{enumi}),
labelwidth=2.5em,
labelsep=0.5em,
labelwidth=2em,
leftmargin=\dimexpr+\firstcollen+2.5em,
itemindent=-\firstcollen,
% listparindent=\parindent, parsep=0pt, % Simulates paragraphs
listparindent=0pt, parsep=3pt, % No indentation, small separation
align=left,
]
\itemmath{y = f(x)}Short equation
\itemmath{r^2 = \cos^2 x + \sin^2 x} A trigonometric identity
\itemmath{\int_{a}^{b}\frac{1}{2}f(x)dx} \kant*[1][1]
\itemmath{y = f(x)} Short equation
\itemmath{r^2 = \cos^2 x + \sin^2 x} \kant[3][1]\kant[3][2]\kant[3][3]
\itemmath{b = \int_{c}^{d}\frac{3}{4}g(x)dx} Short text
\itemmath{\int_{a}^{b}\frac{1}{2}f(x)dx} \kant[1][1-5]\kant[2]
\end{enumerate}
\end{document}
You could use \makebox to ensure that all your equations have the same width:
\documentclass{article}
\usepackage{mathtools}
\usepackage{enumerate}
\begin{document}
\begin{center}
\begin{minipage}{2in}
\begin{enumerate}[{1)}]
\item \makebox[2cm][l]{$p \lor \neg q$} Agregacion
\item \makebox[2cm][l]{$q p$} Equivalenica
\end{enumerate}
\end{minipage}
\end{center}
\end{document}
I've a enumerate list and some items have figures. I write this:
\begin{enumerate}
\item Estado da arte:
\item Levantar os requisitos
\item Com o microcontrolador
\ref{figurametodo3}.
\begin{figure}[h!]
\begin{center}
\includegraphics[scale=0.6]{./dados/figuras/metodo_3}
\caption{Sistema para leitura da identificação de uma Tag}
\label{figurametodo3}
\end{center}
\end{figure}
\item Estudar
\begin{figure}[h]
\begin{center}
\includegraphics[scale=0.4]{./dados/figuras/metodo_4}
\caption{Comunicação entre o microcontrolador e o celular}
\label{figurametodo4}
\end{center}
\end{figure}
\item Desenvolver
\begin{figure}[h]
\begin{center}
\includegraphics[scale=0.6]{./dados/figuras/metodo_final}
\caption{Comunicação entre celulares e servidor}
\label{figura22}
\end{center}
\end{figure}
\end{enumerate}
But it aligns all figures below the list, outside of place that I want. I want that my figures stay just below that your item. Inside of the list.
This is covered in the following FAQs:
How to influence the position of float environments like figure and table in LaTeX?
Keeping tables/figures close to where they are mentioned
Force LaTeX image to appear in the section in which it's declared
Here's one option using the float package and it's [H]ERE float specifier:
\documentclass{article}
\usepackage{float,graphicx}
\begin{document}
\begin{enumerate}
\item Item 1
\item Item 2
\item Item 3
\begin{figure}[H]
\centering
\includegraphics[width = .5\linewidth]{example-image-a}
\caption{A figure caption}
\end{figure}
\item Item 4
\begin{figure}[H]
\centering
\includegraphics[width = .5\linewidth]{example-image-b}
\caption{B figure caption}
\end{figure}
\item Item 5
\item Item 6
\end{enumerate}
\end{document}
Use minipage environment to insert the image:
\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{caption}
\begin{document}
\begin{enumerate}
\item Estado da arte:
\item Levantar os requisitos
\item
\begin{minipage}[t]{\linewidth}
Com o microcontrolador \newline
\includegraphics[scale=0.6]{./dados/figuras/metodo_3}
\captionof{figure}{Sistema para leitura da identificação de uma Tag}
\end{minipage}
\end{enumerate}
\end{document}
You should not use figure, if you don't want a float.
The LaTeX Wikibook explains:
Floats are containers for things in a document that cannot be broken
over a page. LaTeX by default recognizes "table" and "figure" floats,
[...].
Floats are there to deal with the problem of the object that won't fit
on the present page, and to help when you really don't want the object
here just now.
To provide a caption outside of figures one needs to use package caption, which provides the captionof command.
There is also a capt-of package if you are just interested in using the command \captionof.
The answer by Werner is nice but you do have to type in the mandatory "Item 3" besides the "\item" command, for example. Supposing you just want to include a figure on an item on the list without adding any text, there is the following dirty trick:
\item \phantom{text}
\includegraphics[scale=0.5]{Image}
Note that the blank space between these two lines of code is absolutely necessary. In case you want more space between the item label and the diagram, the following could be done:
\item \phantom{text}
\vspace{3mm}
\includegraphics[scale=0.5]{Image}
I have a text file which contains a series of movie titles, which looks like this once opened.
A Nous la Liberte (1932) About Schmidt (2002) Absence of Malice
(1981) Adam's Rib (1949) Adaptation (2002) The Adjuster (1991) The
Adventures of Robin Hood (1938) Affliction (1998) The African Queen
(1952)
Using the code below:
def movie_text():
moviefile = open("movies.txt", 'r')
yourResult = [line.split('\n') for line in moviefile.readlines()]
movie_text()
I get nothing.
Your code doesn't prints right.
If I understand it well,
moviefile = open("movies.txt", 'r')
lines=moviefile.readlines()
print(len(lines)) # Shows list size
for line in lines:
print(line[:1]) # The [:1] part cuts the \n
The method readlines returns a list, I am not sure why your use split. I mean, if all you want is to remove the '\n', you can do it in many ways, being the one I used just one of them.
Hope it works!
I have a frequency table of words which looks like below
> head(freqWords)
employees work bose people company
1879 1804 1405 971 959
employee
100
> tail(freqWords)
youll younggood yoyo ytd yuorself zeal
1 1 1 1 1 1
I want to create another frequency table which will combine similar words and add their frequencies
In above example, my new table should contain both employee and employees as one element with a frequency of 1979. For example
> head(newTable)
employee,employees work bose people
1979 1804 1405 971
company
959
I know how to find out similar words (using adist, stringdist) but I am unable to create the frequency table. For instance I can use following to get a list of similar words
words <- names(freqWords)
lapply(words, function(x) words[stringdist(x, words) < 3])
and following to get a list of similar phrases of two words
lapply(words, function(x) words[stringdist2(x, words) < 3])
where stringdist2 is follwoing
stringdist2 <- function(word1, word2){
min(stringdist(word1, word2),
stringdist(word1, gsub(word2,
pattern = "(.*) (.*)",
repl="\\2,\\1")))
}
I do not have any punctuation/special symbols in my words/phrases. (I do not know a lot of R; I created stringdist2 by tweaking an implementation of adist2 I found here but I do not understand everything about how pattern and repl works)
So I need help to create new frequency table.
I have a Data file which looks like the one below. Now, I wanted to make a histogram chart using column 9, column 10 as errorbars. That works out pretty good. Bubt is there an option only to plot specific rows?
I tried the solution in a another thread that using a ternary operator:
plot 'Härte StS-123 bis 151.txt' using ( ( $0 == 4 || $0 == 6 ) ? $9 : 1/0 ):($9+$10):($9-$10):xticlabels(2)
this plots row 4 and 6 indeed, but leaves an empty space inbetween the datasets.
Is there any other way to achieve this?
Data File:
StS-123a "SBR / THF" 50.10 49.60 49.20 50.70 50.00 49.50 49.85 0.49 0.00974176
StS-123b "SBR / THF" 51.00 50.40 50.40 52.00 52.80 50.60 51.20 0.90 0.017614257
StS-124a "SBR+2phrGraphit" 49.60 49.40 49.30 48.90 49.40 49.10 49.28 0.23 0.004599753
What you may want is the index option to the plot command:
plot 'datafile' index 4 u 9:($9-$10):($9+$10):xticlabels(2), \
'' index 6 u 9:($9-$10):($9+$10):xticlabels(2)
This should plot just the data from the 4th and 6th datasets (rows), albeit with two different styles which you can adjust in the plot command.
Did you want to connect the values from the two datasets? That may be trickier.
If you want to only plot data from the 4th and 6th rows that have data, you can use external commands in gnuplot, like:
plot "<sed '/^$/d' data.dat | sed -n '4p; 6p'" u 9:($9-$10):($9+$10):xticlabels(2)
(This may not be the most compact way to use sed in this case, but it deletes blank lines then returns the 4th and 6th rows.)