Latex template for quickly writing summaries of courses - latex

For some courses I take, we are allowed to write a summary and to used it at the exam. The summary allowed is usually limited to something like ten A4 pages. I quickly googled for latex templatex, but I couldn't find anything useful so far.
The template should allow to used the full space available on an A4 paper, by default latex documents usually have large borders. I guess I'm not the first person looking for this kind of template, so please post any links if you know good templates.

You can setup your margins pretty easily using the geometry package (which should be part of most latex distributions I believe) http://ctan.org/tex-archive/macros/latex/contrib/geometry/
You'll probably also need one of the multiple column layouts and amsmath packages.
You can find a bunch of details on page layout here: http://en.wikibooks.org/wiki/LaTeX/Page_Layout
I'd probably use something like this:
\documentclass[a4paper]{article}
\usepackage[margin=1cm]{geometry}
\usepackage{amsmath}
\usepackage{multicol}
\begin{document}
\begin{multicols}{3}
... MY STUFF HERE ...
\end{multicols}
\end{document}
EDIT: Original version was trying to use the plain style, which seems to not exist. Also had the usepackages inside the document rather than the preamble, and had some spelling mistakes. Won't look useful until you fill it with some stub data... head over to lipsum.com for some filler text.

Related

Latex - how can I make a text to stand out more?

I'm designing my diploma thesis and would like to make a big question mark to every problem and a exclamation mark to every solution. It should like like this:
Do you know any Latex-Libraries to accomplish that behaviour? If there is no such library I would be more than happy if you could help me getting started writing my own Latex-Command.
Here is one basic approach. No packages are involved.
A particular thing about your layout is the use of the margin, correlated with that line of text. One way about it is to define a simple environment, which uses Latex command for margin notes, \marginpar. Then you can also set up fonts as you please, within this environment. Below I also insert an unrelated margin note, as an example in case you are not familiar with those.
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\newenvironment{Q} {\hspace{\stretch{1}} \Huge} {\marginpar{ \Huge{?} } \newline}
\newenvironment{A} {\hspace{\stretch{1}} \Huge} {\marginpar{ \Huge{!} } \newline}
\begin{document}
\section{First section}
Some text ... Margin note entered {\em here} \marginpar{NOTE} ... more text \\
\vspace{0.5in}
\begin{Q} Here is a question \end{Q}
State your question ... \\
\begin{A} This is an answer \end{A}
Go with the answer ... \\
New paragraph, for other text ...
\end{document}
See this page in Latex Wikibooks for a very clear explanation of how to define a new environment. If you end up wanting more control see the package environ.
Margin notes provide you with a few options. If you want to reverse the logic of where they are placed, use \reversemarginpar. You can also set up different text to appear depending on which margin the note goes in by using \marginpar[left text]{right text}. See the Wikibooks article on footnotes and margin notes, which spells out where notes go based on the document type.
Here are some posts for more specialized uses: on notes in both margins, and on notes in narrow margnins. For doing far more with margin notes see package magrinnote, and there are yet other packages, like todonotes. See this post for a visual show off of what it can do.
I've used a basic way to change font size, and no special symbols. A list of these fonts can be found in this post, for example. You can use very particular fonts and/or symbols if you like, which are convenient to set up in the new environment. See, for example, this post, which also has another way of formatting for your Q&A. Also informative may be this post.
Note that you can also use existing environments inside this new one, if you wish. You can also set up a counter, and have an ability to cross-reference these. See this post for an example.

How can I use org-mode to write LaTeX for scientific journals?

I write most text using org-mode nowadays, and I often use it to generate PDF via LaTeX (xelatex, specifcally). But now I want to use it to write scientific articles, and journals often want me to use a specific style. This includes a .cls-file, which is easy enough using org-latex-classes, but quite often, they require a specific setup following \begin{document} (i.e. a specific abstract section, funky author and affiliation, etc, and I don't see how to do that. That is, I now do this within a #+begin/end_latex section - but this needs to be completely rewritten if I switch style.
I realize I probably need to fiddle with the LaTeX code at some point, but I'd like to minimize this fiddling as far as possible, and I'd like to be able to switch from one journal to another with a minimum of fuss, and keeping my org-mode source as intact as possible.
See item 3 at http://kitchingroup.cheme.cmu.edu/blog/2014/08/08/What-we-are-using-org-mode-for/
There is a list of papers there we have written in org-mode and exported to LaTeX. We have probably 8 more since that post.
In the SI you can find the org-source embedded in the PDF, and here: Spencer D. Miller, Vladimir V. Pushkarev, Andrew J. Gellman and John R. Kitchin, Simulating Temperature Programmed Desorption of Oxygen on Pt(111) Using DFT Derived Coverage Dependent Desorption Barriers, Topics In Catalysis, 57(1), 106-117 (2013). http://link.springer.com/article/10.1007%2Fs11244-013-0166-3 you can even find our manuscript embedded.
You may also want to checkout https://github.com/jkitchin/org-ref for citation management and https://github.com/jkitchin/jmax/blob/master/ox-manuscript.el for how we do our exports.
Depending on the amount of latex polishing you need to do, you may find it simpler to just add some things to your org file, and use a little bit of babel directly. Here is a snippet of how the start of one my files might look. Some of things are in there, because I will also have the R code for the statistical analyses in the org file in order to be able to have a more reproducible work flow:
# -*- mode: org; org-export-babel-evaluate: nil -*-
#+Title: This is my title
#+Author: An Author, Another Author, and Last Author
#+Options: toc:nil ':t *:nil -:nil ::nil <:nil ^:t author:t d:t H:5 |:t
#+Property: header-args:R :session *myarticlessection* :results output :exports both :cache yes
#+Latex_Class: article
#+Latex_Class_Options: [12pt]
#+Latex_Header: \usepackage{amsmath}
#+Latex_Header: \usepackage[T1]{fontenc}
#+Latex_Header: \usepackage{mathptmx}
#+Latex_Header_Extra: \linespread{1.5}
#+LATEX_HEADER: \usepackage[citestyle=authoryear-icomp,bibstyle=authoryear, hyperref=true,backref=true,maxcitenames=3,url=true,backend=biber,natbib=true] {biblatex}
#+Latex_header: \addbibresource{myarticles.bib}
#+BEGIN_SRC latex :results output
\begin{abstract}
Here is where I put the abstract.
\end{abstract}
#+END_SRC
#+RESULTS:
#+BEGIN_LaTeX
\begin{abstract}
And this is where it ended up after evaluating the babel block.
\end{abstract}
#+END_LaTeX
I used org-mode to write several papers, including my PhD thesis. It helped me greatly to keep track of open problems, priorities, annotations etc.
I use a small custom converter that reads the .org file and exports parts of it to a .tex file. Note that "normal" org-mode text (including headings, text, priorities, keywords etc.) is not exported, just the stuff between #BEGIN_LaTeX and #END_LaTeX tags. This way, you can make annotations as you see fit, which won't appear in the published text.

Latex paragraph spacing and page Margins

My latex file is:
\title{\large\textbf{Optimizarea rela\c tiei dintre structur\u a \c si comportament \^in modelarea UML}}
\author{
Sorin Oltean \\
\textit{Universitatea Transilvania din Bra\c sov} \\
\small\textit{oltean.s#gmail.com, sorin.oltean#romtelecom.ro} \\
\small Tel.: 0752/314288
}
\documentclass[12pt]{article}
\begin{document}
\maketitle
\renewcommand\abstractname{\textit{\textbf{Abstract}}}
\begin{abstract}
Something..... text.........
\end{abstract}\\\
\textbf{Cuvinte cheie:} \textit{sistem, structur\u a, comportament, UML}
\section{Introducere}
\paragraph{ }
Para11.............
\paragraph{ }
Para2......
\bibliographystyle{abbrv}
\bibliography{main}
\end{document}
After para1, i wanna start a new paragraph, but between the paragraphs there is a blank line, how can i start the 2nd paragraph below the 1st one, without that blank space?
Also, how can i define the margins (top, down, left, right) of the document? There is too much space from the left, right, top and down, i wanna just 2cm space from the left and right, and 3cm from the top and down. Sorry for my bad english..
Also how can i specify the font name and size of the document?
Thanks!
I see you make several mistakes that are typical for beginners:
Don't use the standard classes for generic documents (article, report, book), they are too inflexible. Use the KOMA-Script classes (scrartcl, scrreprt, scrbook) or the memoir class instead.
Don't change the default settings until you have read books or articles about typography.
In particular, the default page margins are OK, there is no need to change them. Margins of 2 cm would be way too narrow.
When it comes to fonts, the answer depends on which engine you use: pdfTeX-based documents require specially-crafted packages, whereas modern engines (XeTeX and LuaTeX) can access system fonts. Like before, don't switch fonts light-heartedly. Only very few fonts of high quality are available to normal users. In particular, never use Arial or Times New Roman. On Mac OS X, you could use Hoefler Text, on Windows Cambria, for example.
Don't include formatting commands in token lists that are intended for plain strings like \title or \abstractname; use the formatting commands that your document class provides.
\paragraph is a sectioning commands that creates a heading; use blank lines to separate simple text paragraphs.
Load the inputenc package (only necessary in the case of pdfTeX) so that you can enter non-ASCII characters directly.
The \documentclass command must come first.
Don't use the geometry package unless you have very specific and unavoidable requirements.
Avoid the parskip package; modern document classes already include its functionality; and normally, paragraphs should be marked by indents, not by vertical space, so no changes to the default are required.
Never use the fullpage package, it's completely outdated.
Like the others said, start by reading some introductory material about LaTeX like the Short Introduction.
Read the document Obsolete packages and commands.
Use the geometry package. It allows full control over margins etc.
\usepackage{geometry}
\geometry{margin=2cm}
The space between paragraphs can be set via parskip:
\setlength{\parskip}{0cm}
However, parskip does not work for paragarphs introduced by \paragraph. But if your paragraphs do not need a caption (as I assume since you wrote \paragraph{}, it may be better to begin paragraphs just with a blank line:
\setlength{\parskip}{0cm}
Here goes the first paragraph.
Here the second. With no space. Note that this paragraph was introduced with a blank line.
\paragraph{The third paragraph} This paragraph will have a small offset, since it is introduced explicitly with paragraph command.
I would suggest this as a good reference to start with. Familarize yourself with the way documents are prepared for LaTeX.
1) There is no need to use \paragraph{}, just an empty line between paragraphs is enough. This will create a visible vertical space between paragraphs (that's why you wanted different paragraphs, right?). If you are bothered by the default indention for the new paragraph have a look at the documentation for \noindent or \parskip.
2) If you really have to start tweaking the page layout (i.e. your university/journal/employer doesn't already provide an accepted class or style) have a look at the geometry package.
3) There should be some fonts available in your installation already (beton, helvet, palatino?), and these can be loaded as packages. It really depends on what exactly you need to do.
For paragraphs, try putting your text inside the {} so that you have
\paragraph{
Para11.............
}
But normally I think you can just put two lines between each paragraph and not bother with \paragraph{}. Otherwise, you can change the parskip value. Wikibooks shows how but I'm not allowed to post a 2nd link. It's in the Document Structure part of the Latex wikibook.
You can use the geometry package to specify your margins:
\usepackage{geometry}
\geometry{top=3cm, left=2cm, right=2cm, bottom=3cm}
Documentation
For less margins I recommend using fullpage, i.e.
\usepackage{fullpage}
see fullpage documentation for more information
Use the geometry package to change the margins of the document
\usepackage[top=3cm,left=2cm,right=2cm,bottom=3cm]{geometry}
I think the space between the paragraphs can be configured with the package:
\usepackage{parskip}
Documentation in CTAN is here. I haven't really tested it though.
For the margins you could do it manually with , the esaiest way is to do it the following package:
\usepackage[margin=2.5cm]{geometry}
You can check documentation here.

Exclude entry from glossary?

I'm using the glossaries package in LaTeX. I've got \gls{foo} in my document, but I don't want the entry for "foo" to appear in the glossary. How can I keep a working (i.e. expanding) \gls{foo} in the body of my document, but exclude the entry for "foo" from the glossary?
EDIT: I want to use \gls{foo} to indicate "as used here, 'foo' has its specific meaning within this document." In a few cases, though, I've ended up with a "foo" whose definition is too obvious--or difficult--to articulate in the glossary.
So I want \gls{foo} to be expanded as usual, but I don't want the "foo" entry to appear in the glossary.
I hope this adds a little more information about what I'm trying to accomplish. It may be an abuse of glossaries, but I find it helpful to make sure I'm always using the same words and the right words while writing technical documents.
If you are using the glossaries package you can create an "ignored" glossary like
\documentclass{article}
\usepackage{glossaries}
\newglossary[glignoredl]{ignored}{glignored}{glignoredin}{Ignored Glossary}
\makeglossaries
\newglossaryentry{foofoo}{name={FOOFOO},description={foofoo stuff}}
\newglossaryentry{foo}{name={FOO},type={ignored},description={no good description}}
\newglossaryentry{bar}{name={BAR},description={bar of stuff}}
\begin{document}
Here is a \gls{foo} that is also a \gls{bar}, but of course it's also a \gls{foofoo}.
Why not consider buying a \gls{foo}?
\printglossary
% \printglossary[type={ignored}]
\end{document}
I have no idea why you'd want to do this, but the following should work:
\let\oldgls\gls% store the original meaning of \gls in a new command named \oldgls
\let\gls\relax$ make \gls do nothing
Some text with \gls{foo} no links to the glossary,
and no ``foo'' entry in the glossary.
\let\gls\oldgls% restore the original meaning of \gls
Some more text with \gls{bar} that links to the glossary,
and with a ``bar'' entry in the glossary.
This can be accomplished by adding the terms to a special common dictionary. It's actually a built-in feature of the glossaries package and it's even exemplified by the package author. From said example:
\documentclass{article}
\usepackage{glossaries}
\newignoredglossary{common}
\makeglossaries
\newglossaryentry{sample}{name={sample},description={an example}}
\newglossaryentry{commonex}{type=common,name={common term}}
\begin{document}
\gls{sample}. \gls{commonex}.
\printglossaries
\end{document}
Note the use of the \newignoredglossary command.

Showing labels in BibTex [LaTeX]

I'm currently using the apalike style for my bibliography, using natbib for author-year, however when I generate the bibliography I lose the labels that normally precede the reference,
i.e. [S. Rostami, 2010] Shahin Rostami (2010) https://stackoverflow.com/questions/ask etc etc..
I read apalike.bst and it seems this is intended, my quesiton is, how do I get them back? Something I can include in the preamble? Otherwise is there a similar style that shows labels?
Also, I'm doing this all in Lyx.
OK, a real answer!
Advice: don't use homebrew citation styles in scientific articles. If your university recommends a specific style (e.g., APA, Chicago), use the existing matching style. Otherwise, you can get a feel for what is the dominant citation/reflist style by looking at what styles used by the articles you cite.
If you really do want to create such a homebrew cite/reflist style, then the easy option is to copy the .bbl file into your article and edit that: with luck, you can devise a regex that will create all or most of the labels you want. But rerunning Bibtex will not respect the changes you have made. The "right" thing is to clone apalike.bst and change the way it generates the author/date sentence to include the label information as well. BST hacking is a bit of a black art —time-consuming, fiddly, and poorly documented— but the language is not essentially difficult. Look at btxhak, Designing Bibtex styles and Nicolas Markey's tutorial to get started. Alternatively, there are some bst-hackery-avoiding suggestions in this SO Q&A.

Resources