This question already has answers here:
How to have no pagebreak after \include in LaTeX
(5 answers)
Closed 8 years ago.
I am in the progress of writing an expose for my master thesis. One point in the expose is an overview of literature. To save my time and work I use bibtex to create that chapter. The thing I want to change now is that latex starts a new page for the bibliography which is an enormous overhead in a four page document.
The, I think, relevant parts from my document are:
\documentclass [ fontsize = 12pt,
paper = a4,
paper = portrait,
twoside = false,
headsepline,
twocolumn = false,
numbers=noenddot
]{scrartcl}
\bibliographystyle{unsrt}
\begin{document}
%
\include{text}
\nocite{*}
\singlespacing
\bibliography{literature}
%
\end{document}
I am using biblatex. This solved the problem:
\begingroup
\let\clearpage\relax
\printbibliography
\endgroup
Related
I have searched but nothing useless, only "use \newline" or "use \".
I'm creating a simple latex document to store any texts instead of using .txt, and the problem is that the pdf document contains the lines going towards right until they go out of the paper.
I'm using this simple code
\documentclass[a4paper]{article}
\usepackage{geometry}
\geometry{
a4paper,
total={170mm,257mm},
left=5mm,
top=20mm,
}
\begin{document}
\section{Text 1}
Loremipsumdolorsitamet,consecteturadipiscingelit,seddoeiusmodtemporincididuntutlabore etdoloremagnaaliqua.Utenimadminimveniam,quisnostrudexercitationullamcolaborisnisiutaliquipexeacommodoconsequat.Duisauteiruredolorinreprehenderitinvoluptatevelitessecillum doloreeufugiatnullapariatur.Excepteursintoccaecatcupidatatnonproident,suntinculpaquiofficiadeseruntmollitanimidestlaborum.
\end{document}
Since latex sees it as a one word, it refuses to break it since it doenst know its hyphenation. But I would like to allow latex to break it regardless. Any thoughts ?
Remarks: I already have used:
\hspace{0pt}
\leavevmode\nobreak\hspace{0pt}
\mbox{Loremip...larorum.}
Nothing worked.
I think I got why nothing worked. See my code below, that I managed to compile successfully after editing your MWE.
You basically have two ways to force hyphenation here.
As in the comment by SamCarter, you manually split words within text, just using \- where necessary. I did it below in line 18 (6 from bottom).
You add to your preamble the command \hyphenation{word-to-split}: I did this below to hyphenate the word in line 20 (4 from bottom). Notice that, in this case, you use - instead of \- within the braces {} enclosing the argument.
\documentclass[a4paper]{article}
\usepackage{geometry}
\geometry{
a4paper,
total={170mm,257mm},
left=5mm,
top=20mm,
}
\hyphenation{Duisauteiruredolorinre-prehenderitinvoluptatevelitesse-cillum doloreeufugiatnullapariatur}
\begin{document}
\section{Text 1}
Loremipsumdolorsitamet, consecteturadipiscingelit,
seddoeiusmodtemporincididuntutlaboreetdoloremagna.
Uten\-imadminimveniam,
quisnostrudexercitationullamcolaborisnisiutaliquipexeacommodoconsequat.
Duisauteiruredolorinreprehenderitinvoluptatevelitessecillumdoloreeufugiatnullapariatur.
Excepteursintoccaecatcupidatatnonproident,
suntinculpaquiofficiadeseruntmollitanimidestlaborum.
\end{document}
Finally, if the full stop character . is not followed by a space, two separate words may be interpreted as one and the command \hyphenation may not work as expected. Not sure that this was the detail making you write that nothing worked, but be careful to this too.
I recently discovered a problem in my bibliography and I somehow can't solve it. It's appearing when the titles are too long, but its working with URLs normally as you see in the 2nd example as long the as the title is short enough.
It seems that symbols like "[]" beeing generated from something and the log is giving me 2x Overfull \hbox (X pt too wide) in paragraph.
setup: document.tex and bib/literature.bib
settings: pdfLatex (using biber and texindy)
Minimal example:
\documentclass[
11pt,
a4paper
]{scrreprt}
% add bibliography
\usepackage[style=alphabetic, sorting=anyt]{biblatex}
\addbibresource{bib/literature.bib}
\usepackage[colorlinks, urlcolor=blue]{hyperref}
\begin{document}
\cite{Gaedke}
\cite{IOT}
\printbibliography
\end{document}
literature.bib
#online{Gaedke,
author = {Gaedke, Martin and Heil, Andreas},
title = {{GET /dgs HTTP/1.1 Host: www.WebComposition.net.}},
url = {http://www.mendeley.com/research/dgs-http11-host-wwwwebcompositionnet/},
urldate={2018-08-19}
}
#online{IOT,
author = {Litzel, Nico },
title = {Was ist das Internet of Things?},
url = {https://www.bigdata-insider.de/was-ist-das-internet-of-things-a-590806/},
urldate={2018-08-19}
}
According to the biblatex documentation:
biburlnumpenalty: If this counter is set to a value greater than zero, biblatex will permit linebreaks after numbers in all strings formatted with the \url command from the url package. This will affect urls and dois in the bibliography. The breakpoints will be penalized by the value of this counter. If urls and/or dois in the bibliography run
into the margin, try setting this counter to a value greater than zero but less than
10000 (you normally want to use a high value like 9000). Setting the counter to zero
disables this feature. This is the default setting.
So, you can add:
\usepackage[style=alphabetic, sorting=anyt]{biblatex}
\addbibresource{bib/literature.bib
% If you want to break on URL numbers
\setcounter{biburlnumpenalty}{9000}
% If you want to break on URL lower case letters
\setcounter{biburllcpenalty}{9000}
% If you want to break on URL UPPER CASE letters
\setcounter{biburlucpenalty}{9000}
There are two separate issues:
The title, where LaTeX hyphenation does not know how to break www.WebComposition.net. You can do something here using \hyphenation{} in the preamble or see here for the many ways of hyphenation using the LaTeX packages for the German language
The URL, where LaTeX URL breaking (from the url package loaded by hyperref) does not know how to break wwwwebcompositionnet/. For this issue, refer to the answer by Eiji https://stackoverflow.com/a/53388858 or see https://tex.stackexchange.com/questions/3033/forcing-linebreaks-in-url/10419
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 7 years ago.
Improve this question
I have a report with appendixes.
What I want is to use a different style on the page numbering when the appendixes start.
I use Arabic numbering until I reach the appendixes. Then I would want to do something like this:
I want the custom page numbering to be:
Chapter: A
Section: {Chapter}{1} (A-1)
\newpage
\pagenumbering{custompagenumbering}
Is this possible?
Some paragraph. Some paragraph. Some paragraph. Some paragraph. Some paragraph.
\newpage
\setcounter{page}{1}
\renewcommand{\thepage}{A-\arabic{page}}
Some paragraph. Some paragraph. Some paragraph. Some paragraph. Some paragraph.
Would this be anywhere near what you want to do? This is how you can manipulate the page counter, and the \thepage command that determines what will be printed as page number. \roman{page} would give roman numbers, \alph{page} a, b, c ...
The other sensible solution is to use the fancyhdr package, as suggested before.
First I would create one file that includes all chapters and appendixes etc. something called main.tex or thesis.tex
there you can do all the includes and document settings, and also your header and footer settings:
% Free Header and Footer
\usepackage{fancyhdr}
\lfoot[\fancyplain{}{}]{\fancyplain{}{}}
\rfoot[\fancyplain{}{}]{\fancyplain{}{}}
\cfoot[\fancyplain{}{\footnotesize\thepage}]{\fancyplain{}{\footnotesize\thepage}}
\lhead[\fancyplain{}{\footnotesize\nouppercase\leftmark}]{\fancyplain{}{}}
\chead{}
\rhead[\fancyplain{}{}]{\fancyplain{}{\footnotesize\nouppercase\sc\leftmark}}
here it would make the page number in the center of your page foot. and the chapter title on the left of your header and also on the right if your work is doubel paged.
then you can start to include your other chapters.. mine looks like that (still in thesis.tex):
% --- Start of Document ----------------------------------------
\begin{document}
\pagenumbering{roman} %roemische ziffern
\pagestyle{fancy} % Initialize Header and Footer
\include{title} % Title Page
\include{affidavit} % affidavit
\include{abstracts} % Englisch and German abstracts
\include{acknowl} % Acknowledgements
\include{glossary} % Glossary
\include{abbreviation} % Abkuerzungen
%\include{keywords} % Keywords
\include{toc} % Table of Contents
%--- Include your chapters here ----------
\setcounter{page}{1} % set page to 1 again to start arabic count
\pagenumbering{arabic}
%\include{chapter0}
\include{chapter1} % Introduction
\include{chapter2} % Background
\include{chapter3} % Konzeption
\include{chapter4} % Technische Umsetzung
\include{chapter5}
\include{chapter6}
%
%% ....
\appendix
\include{appendix} % Appendix A
\end{document}
Hope that helps! headers and footers are some time difficult, and sometime if you change \documentclass it could appear different too. ;)
If you're able to use the Memoir class (which I recommend), you can use page styles. See Chapter 7.2 Page Styles. For example, create two styles:
\pagestyle{plain} % Regular page numbering
... STUFF ...
\clearpage % make a new page numbering down here
\copypagestyle{AppendixPS}{plain}
\renewcommand{\thepage}{Chapter \chapter Section \section page \page}
\pagestyle{AppendixPS}
I haven't tested this – or used LaTeX to do this in a while – but I hope it provides some food for thought or at least puts you onto the right track.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
I want to make cheat sheets for my personal use. I want to use this opportunity to get a good hand on LaTeX too. (I am already comfortable making simple documents math related in LaTeX.)
Now I want to try making cheat sheets in LaTeX. But I don't know how to do it. In cheat sheets, usually the page is split into multiple rectangular sections and each one has a few commands or notes inside it. Each rectangular section has a border etc.
How can it be done in LaTeX? Are any packages available to do this? Do you think TikZ will be a good idea for this?
Because some professors allowed us to use cheat sheets written on a computer for exams, I decided to create a template some time ago to save enough space as possible but keep readibility. The template uses the code of the answer here.
Update: The complete source code can now be found here.
The base file looks like this:
\documentclass[10pt,landscape,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{tikz}
\usetikzlibrary{shapes,positioning,arrows,fit,calc,graphs,graphs.standard}
\usepackage[nosf]{kpfonts}
\usepackage[t1]{sourcesanspro}
%\usepackage[lf]{MyriadPro}
%\usepackage[lf,minionint]{MinionPro}
\usepackage{multicol}
\usepackage{wrapfig}
\usepackage[top=0mm,bottom=1mm,left=0mm,right=1mm]{geometry}
\usepackage[framemethod=tikz]{mdframed}
\usepackage{microtype}
\let\bar\overline
\definecolor{myblue}{cmyk}{1,.72,0,.38}
\def\firstcircle{(0,0) circle (1.5cm)}
\def\secondcircle{(0:2cm) circle (1.5cm)}
\colorlet{circle edge}{myblue}
\colorlet{circle area}{myblue!5}
\tikzset{filled/.style={fill=circle area, draw=circle edge, thick},
outline/.style={draw=circle edge, thick}}
\pgfdeclarelayer{background}
\pgfsetlayers{background,main}
\everymath\expandafter{\the\everymath \color{myblue}}
\everydisplay\expandafter{\the\everydisplay \color{myblue}}
\renewcommand{\baselinestretch}{.8}
\pagestyle{empty}
\global\mdfdefinestyle{header}{%
linecolor=gray,linewidth=1pt,%
leftmargin=0mm,rightmargin=0mm,skipbelow=0mm,skipabove=0mm,
}
\newcommand{\header}{
\begin{mdframed}[style=header]
\footnotesize
\sffamily
Cheat sheet\\
by~Your~Name,~page~\thepage~of~2
\end{mdframed}
}
\makeatletter
\renewcommand{\section}{\#startsection{section}{1}{0mm}%
{.2ex}%
{.2ex}%x
{\color{myblue}\sffamily\small\bfseries}}
\renewcommand{\subsection}{\#startsection{subsection}{1}{0mm}%
{.2ex}%
{.2ex}%x
{\sffamily\bfseries}}
\def\multi#column#out{%
\ifnum\outputpenalty <-\#M
\speci#ls \else
\ifvoid\colbreak#box\else
\mult#info\#ne{Re-adding forced
break(s) for splitting}%
\setbox\#cclv\vbox{%
\unvbox\colbreak#box
\penalty-\#Mv\unvbox\#cclv}%
\fi
\splittopskip\topskip
\splitmaxdepth\maxdepth
\dimen#\#colroom
\divide\skip\footins\col#number
\ifvoid\footins \else
\leave#mult#footins
\fi
\let\ifshr#kingsaved\ifshr#king
\ifvbox \#kludgeins
\advance \dimen# -\ht\#kludgeins
\ifdim \wd\#kludgeins>\z#
\shr#nkingtrue
\fi
\fi
\process#cols\mult#gfirstbox{%
%%%%% START CHANGE
\ifnum\count#=\numexpr\mult#rightbox+2\relax
\setbox\count#\vsplit\#cclv to \dimexpr \dimen#-1cm\relax
\setbox\count#\vbox to \dimen#{\vbox to 1cm{\header}\unvbox\count#\vss}%
\else
\setbox\count#\vsplit\#cclv to \dimen#
\fi
%%%%% END CHANGE
\set#keptmarks
\setbox\count#
\vbox to\dimen#
{\unvbox\count#
\remove#discardable#items
\ifshr#nking\vfill\fi}%
}%
\setbox\mult#rightbox
\vsplit\#cclv to\dimen#
\set#keptmarks
\setbox\mult#rightbox\vbox to\dimen#
{\unvbox\mult#rightbox
\remove#discardable#items
\ifshr#nking\vfill\fi}%
\let\ifshr#king\ifshr#kingsaved
\ifvoid\#cclv \else
\unvbox\#cclv
\ifnum\outputpenalty=\#M
\else
\penalty\outputpenalty
\fi
\ifvoid\footins\else
\PackageWarning{multicol}%
{I moved some lines to
the next page.\MessageBreak
Footnotes on page
\thepage\space might be wrong}%
\fi
\ifnum \c#tracingmulticols>\thr##
\hrule\allowbreak \fi
\fi
\ifx\#empty\kept#firstmark
\let\firstmark\kept#topmark
\let\botmark\kept#topmark
\else
\let\firstmark\kept#firstmark
\let\botmark\kept#botmark
\fi
\let\topmark\kept#topmark
\mult#info\tw#
{Use kept top mark:\MessageBreak
\meaning\kept#topmark
\MessageBreak
Use kept first mark:\MessageBreak
\meaning\kept#firstmark
\MessageBreak
Use kept bot mark:\MessageBreak
\meaning\kept#botmark
\MessageBreak
Produce first mark:\MessageBreak
\meaning\firstmark
\MessageBreak
Produce bot mark:\MessageBreak
\meaning\botmark
\#gobbletwo}%
\setbox\#cclv\vbox{\unvbox\partial#page
\page#sofar}%
\#makecol\#outputpage
\global\let\kept#topmark\botmark
\global\let\kept#firstmark\#empty
\global\let\kept#botmark\#empty
\mult#info\tw#
{(Re)Init top mark:\MessageBreak
\meaning\kept#topmark
\#gobbletwo}%
\global\#colroom\#colht
\global \#mparbottom \z#
\process#deferreds
\#whilesw\if#fcolmade\fi{\#outputpage
\global\#colroom\#colht
\process#deferreds}%
\mult#info\#ne
{Colroom:\MessageBreak
\the\#colht\space
after float space removed
= \the\#colroom \#gobble}%
\set#mult#vsize \global
\fi}
\makeatother
\setlength{\parindent}{0pt}
\begin{document}
\small
\begin{multicols*}{5}
\input{section1}
\end{multicols*}
\end{document}
When you use the code copy the template and put your LaTeX code in external files like section1.tex, section2.tex,.... Than you can easily follow the normal structure inside these LaTeX files like
\section{Title of section 1}
\subsection*{Title of subsection 1}
Some text...
\subsection*{Title of subsection 2}
With some colored math $\sum_{i=1}^\infty i$.
Inserting an image also works:\\
\includegraphics[width=\linewidth]{yourimage.png}
After filling your sections you'll get a much compressed document which still looks good like this:
I've been making my own cheat sheets as well for various things. I really like how the Latex cheat sheet found here looks. I suggest grabbing the tex source and stealing some ideas from it :).
Consider using multicol.
And consider familiarizing yourself with CTAN. Most things TeX end up there sooner or later, though it does require some digging if you don't know what you're looking for.
Here is a beautiful example of a cheat sheet (is a booklet actually, not just a couple of pages).
http://clqr.boundp.org/index.html
It is made using LaTex. It summarizes all the symbols on the Common Lisp Standard. Maybe you can pick up one or two tips from the available LaTeX source.
I like how these cheat sheets look like:
http://michaelgoerz.net/refcards/
By default (using the plain style) BibTeX orders citations alphabetically.
How to order the citations by order of appearance in the document?
There are three good answers to this question.
Use the unsrt bibliography style, if you're happy with its formatting otherwise
Use the makebst (link) tool to design your own bibliography style
And my personal recommendation:
Use the biblatex package (link). It's the most complete and flexible bibliography tool in the LaTeX world.
Using biblatex, you'd write something like
\documentclass[12pt]{article}
\usepackage[sorting=none]{biblatex}
\bibliography{journals,phd-references} % Where journals.bib and phd-references.bib are BibTeX databases
\begin{document}
\cite{robertson2007}
\cite{earnshaw1842}
\printbibliography
\end{document}
Change
\bibliographystyle{plain}
to
\bibliographystyle{ieeetr}
Then rebuild it a few times to replace the .aux and .bbl files that were made when you used the plain style.
Or simply delete the .aux and .bbl files and rebuild.
If you use MiKTeX you shouldn't need to download anything extra.
The best I came up with is using the unsrt style, which seems to be a tweaked plain style. i.e.
\bibliographystyle{unsrt}
\bibliography{bibliography}
However what if my style is not the default?
Just a brief note - I'm using a modified version of plain.bst sitting in the directory with my Latex files; it turns out having sorting by order of appearance is a relatively easy change; just find the piece of code:
...
ITERATE {presort}
SORT
...
... and comment it - I turned it to:
...
%% % avoid sort:
%% ITERATE {presort}
%%
%% SORT
...
... and then, after running bibtex, pdflatex, pdflatex - the citations will be sorted by order of appearance (that is, they will be unsorted :) ).
Cheers!
EDIT: just realized that what I wrote is actually in the comment by #ChrisN: "can you edit it to remove the SORT command" ;)
You answered your own question---unsrt is to be used when you want references to ne listed in the order of appeareance.
But you might also want to have a look at natbib, an extremely flexible citation package. I can not imagine living without it.
I'm a bit new to Bibtex (and to Latex in general) and I'd like to revive this old post since I found it came up in many of my Google search inquiries about the ordering of a bibliography in Latex.
I'm providing a more verbose answer to this question in the hope that it might help some novices out there facing the same difficulties as me.
Here is an example of the main .tex file in which the bibliography is called:
\documentclass{article}
\begin{document}
So basically this is where the body of your document goes.
``FreeBSD is easy to install,'' said no one ever \cite{drugtrafficker88}.
``Yeah well at least I've got chicken,'' said Leeroy Jenkins \cite{goodenough04}.
\newpage
\bibliographystyle{ieeetr} % Use ieeetr to list refs in the order they're cited
\bibliography{references} % Or whatever your .bib file is called
\end{document}
...and an example of the .bib file itself:
#ARTICLE{ goodenough04,
AUTHOR = "G. D. Goodenough and others",
TITLE = "What it's like to have a sick-nasty last name",
JOURNAL = "IEEE Trans. Geosci. Rem. Sens.",
YEAR = "xxxx",
volume = "xx",
number = "xx",
pages = "xx--xx"
}
#BOOK{ drugtrafficker88,
AUTHOR = "G. Drugtrafficker",
TITLE = "What it's Like to Have a Misleading Last Name",
YEAR = "xxxx",
PUBLISHER = "Harcourt Brace Jovanovich, Inc."
ADDRESS = "The Florida Alps, FL, USA"
}
Note the references in the .bib file are listed in reverse order but the references are listed in the order they are cited in the paper.
More information on the formatting of your .bib file can be found here: http://en.wikibooks.org/wiki/LaTeX/Bibliography_Management
I often use the bibliography style natbib because it supplies quite complete set of formats as well as tags for us.
Add this if you want the number of citations to appear in order in the document
they will only be unsorted in the reference page:
\bibliographystyle{unsrt}
I used the following in overleaf and become in ascending order:
\usepackage{cite}
\bibliographystyle{unsrt}
with unsrt the problem is the format. use \bibliographystyle{ieeetr} to get refences in order of citation in document.
If you happen to be using amsrefs they will override all the above - so comment out:
\usepackage{amsrefs}
The datatool package offers a nice way to sort bibliography by an arbitrary criterion, by converting it first into some database format.
Short example, taken from here and posted for the record:
\documentclass{article}
\usepackage{databib}
\begin{document}
% First argument is the name of new datatool database
% Second argument is list of .bib files
\DTLloadbbl{mybibdata}{acmtr}
% Sort database in order of year starting from most recent
\DTLsort{Year=descending}{mybibdata}
% Add citations
\nocite{*}
% Display bibliography
\DTLbibliography{mybibdata}
\end{document}
I use natbib in combination with bibliographystyle{apa}. Eg:
\begin{document}
The body of the document goes here...
\newpage
\bibliography{bibliography} % Or whatever you decided to call your .bib file
\usepackage[round, comma, sort&compress ]{natbib}
bibliographystyle{apa}
\end{document}