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 10 years ago.
Improve this question
I'm beginner in LaTeX. I tried few examples, but I can't do a full justify alignment. Maybe this question isn't very annoying and you could help.
There is my code example:
\documentclass[10pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[L7x]{fontenc}
\usepackage[lithuanian]{babel}
\usepackage{multicol}
\usepackage[left=1.5cm,right=1.5cm,top=2cm,bottom=2cm]{geometry}
\begin{document}
\title{text text text text text text text text text text text text}
\author {text text text text}
\date{}
\maketitle
\center{\textit{ text text text text text text}}
\center{\textit{ text text text text text text}}\\
\small\textbf{Abstract.}
An abstract is a brief summary of a research article, thesis, review, conference proceeding or any in-depth analysis of a particular subject or discipline, and is often used to help the reader quickly ascertain the paper's purpose. When used, an abstract always appears at the beginning of a manuscript or typescript, acting as the point-of-entry for any given academic paper or patent application. Abstracting and indexing services for various academic disciplines are aimed at compiling a body of literature for that particular subject.
\begin{multicols}{2}
\section*{\large Preface}
Academic literature uses the abstract to succinctly communicate complex research. An abstract may act as a stand-alone entity instead of a full paper. As such, an abstract is used by many organizations as the basis for selecting research that is proposed for presentation in the form of a poster, platform/oral presentation or workshop presentation at an academic conference. Most literature database search engines index only abstracts rather than providing the entire text of the paper. Full texts of scientific papers must often be purchased because of copyright and/or publisher fees and therefore the abstract is a significant selling point for the reprint or electronic form of the full text.
\section*{\large Some theory}
An abstract allows one to sift through copious amounts of papers for ones in which the researcher can have more confidence that they will be relevant to his or her research. Once papers are chosen based on the abstract, they must be read carefully to be evaluated for relevance. It is commonly surmised that one must not base reference citations on the abstract alone, but the entire merits of a paper.\\
\end{multicols}
\end{document}
Thank you in advance.
This
\center{\textit{ text text text text text text}}
is not the right way to do it. This \center takes effect for the eintire document. (This would also be the case with \raggedright or \raggedleft) There is no way to get back to justified alignment once you set the global alignment to something else (center raggedright or raggedleft)
You should put the brackets before the \center tag ... that is
{\center\textit{ text text text text text text}}
(this would however not put the text you want to center in the middle of the page but only into a box in the left part though the text will be centered in there). The clean way to do what you probably want to do is to use the center environment (\begin{center} and \end{center})
\begin{center}\textit{ text text text text text text}\end{center}
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed last year.
Improve this question
I am extremely new to LaTeX but have noticed that in the examples I have seen of LaTeX documents that there is always a massive number of empty lines at the top of the compiled pdf file. Nobody seems to say a word about this! Is this some kind of academic convention?
Here is an example:
\documentclass[]{article}
\usepackage{graphicx}
\title{Here is my title}
\author{Kevin Wright}
\begin{document}
\maketitle
\begin{abstract}
This is my abstract stuff
\end{abstract}
hello $\sqrt{x+y-10}$
\end{document}
Yes, by default the article class uses a lot of whitespace above the title of the paper. If you use a separate title page about 60 points of it.
With regard to the space on top of a regular page,
add \usepackage{layout} to your example, and just before the \end{document} add:
\section{Layout}
\layout
Now process and view the document and you will see exactly what the space on top of the page is made up of.
If you want to modify that, have a look at e.g. the geometry and fancyhdr packages.
Heey all,
For my thesis, I'm dealing with a lot of figures with experimental data in one chapter. To maintain an overview for the reader, I would like to have text on the odd pages and figures on even pages. This way, when printing the document all text would be printed on the right side of the opened booklet and the figures on the left.
Anyone an idea how to create this in latex?
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 10 years ago.
Improve this question
I would like to split for example the phrase:
Lower, upper and simulation throughput per user vs number of users
which appears in a caption of figure, into two lines in order for every line to have almost equal length. Something like the following:
Lower, upper and simulation
throughput per user vs number of users
How can I do that? I would appreciate any help!
You could wrap the contents in a varwidth environment (from the similarly-named varwidth package) of large-enough width. varwidth will shrink it to fit that natural content:
\documentclass{article}
\usepackage{graphicx}% http://ctan.org/pkg/graphicx
\usepackage{varwidth}% http://ctan.org/pkg/varwidth
\begin{document}
\listoffigures
\begin{figure}
\centering
\includegraphics[scale=.5]{example-image-a}% Image
\caption[Lower, upper and simulation throughput per user \textit{vs.}\ number of users]
{\begin{varwidth}[t]{\linewidth}Lower, upper and simulation \\ throughput per user \textit{vs.}\ number of users\end{varwidth}}
\end{figure}
\end{document}
The reason for specifying the caption twice (once in the option argument [] and once as part of the mandatory argument {}) is because sending a box-constrained piece of text to the ToC doesn't look great. So, this separates the formatting between the two document components. Depending on the document class you're using, it is also possible to make this part of the regular label-setting requirements.
The caption package also provides format=hang with justification=raggedright that seems to duplicate your requirement. However, you'll have to play with the margins to adequately obtain the output you're after.
I'm looking for a way of linking box-like environments (e.g. minipages) in LaTeX, so that text that does not fit into the first box spills into subsequent boxes. E.g:
/begin{box-like-environment}
Text, too much to fit in this box...
/end{box-like-environment}
% some LaTeX here, possibly covering several pages...
/begin{box-like-environment}
% Text which doesn't fit in the first box should appear in this box
/end{box-like-environment}
The effect is something like the 'linked text boxes' of MS Publisher. Any ideas as to if and how this could be achieved?
The idea being, I guess, that the program figures out where to split the text between the two boxes, say so that you can have the text filled between two floats that face each other on opposite pages.
I have no idea how this might be done in Latex; Latex lacks sensitivity to page layout, so I'd guess it can't be done. Context is more sophisticated with regards to layout: it uses METAPOST to handle page layout, not primitive Tex, and there was discussion of something similar on the NTG mailing list: cf. Hans Hagen's post.
Maybe this is an option? There is some software for automatic translation of Latex to Context.
I have been alerted to the flowfram package, which does this.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 9 years ago.
Improve this question
I'm using LaTeX for an algorithms assignment and I need to show the steps for Horspool's algorithm for string matching similar to what is shown in the textbook. The way it demonstrates the algorithm is showing how the pattern shifts along the text for each failed comparison, with each shift on a new line. The pattern is shown below the text with appropriate horizontal spacing indicating which letters are being compared.
Here is an example of what it would look like with a DNA sequence:
GAGTAATCCTTCACTTCAAGGCCAGTCTTCACATCTCATCAGA
ACATCTCA
ACATCTCA
ACATCTCA
ACATCTCA
I've poked around on several LaTeX references. I tried using \hspace to add the spacing at the beginning of each line, then adding \hfill after the pattern and before creating a newline. I'm not getting any errors, but there is no space being added at the front. The line is being filled correctly.
Is there another way to add the space to the beginning of each line, or another way to format this?
Just use \hspace*{5mm} (i.e. the starred form) which works fine at the beginning of a line.
I am fairly sure you want to typeset your examples with a fixed-width font, in which case, you should probably use verbatim environment. Even better, you could use fancyvrb package, which gives you a Verbatim environment, and allows you control over captioning, coloring, font size/shapes, etc. You can even make blanks more visible by showing them:
\documentclass{article}
\usepackage{fancyvrb}
\begin{document}
\begin{Verbatim}[showspaces=true,fontsize=\small]
GAGTAATCCTTCACTTCAAGGCCAGTCTTCACATCTCATCAGA
ACATCTCA
ACATCTCA
ACATCTCA
ACATCTCA
\end{Verbatim}
\end{document}
For this, I always add an "empty" object to the beginning of the line, e.g.
${}$\hspace{5em}Foo
it's not beautiful, but serves the purpose.
I would simply use the listings package and do the indention with spaces or tabs.
I suppose that you are using the typewriter font anyway to get letters with a non-relative width.