2

I use sharelatex Academic CV template and have spent hours but failed to find how to do this. I have a block of text without any user-created line breaks but that span multiple lines and so has automatically-created line breaks. I end this block of text with my user-created line break.

I have a series of these text blocks. These are references of my articles. I want each reference (each block of text) to stick together visually but have some space between the block (i.e., for each reference to be differentiated from other references).

Let me demonstrate it in text format how I want it to look:

Doe, J. (2012). Brainwashing and totalitarian influence. In V. S. Ra- machandran (Ed.), Encyclopedia of Human Behavior (2nd Ed.) (pp. 406-412). San Diego, CA: Elsevier Academic Press.

Doe, J., & Buddy, C. (2011). Initial impressions of others. In K. Deaux & M. Snyder (Eds.), The Oxford handbook of Personality and Social Psychology (pp. 337-366). New York: Oxford University Press.

I'm aware that I can manually insert a vertical space. However, it will get inefficient as I will have to do this for a lot of such references.

This is the preamble to my CV:

\documentclass[10pt, a4paper]{article}
\usepackage{fontspec} 

% DOCUMENT LAYOUT
\usepackage{geometry} 
\geometry{a4paper, textwidth=5.5in, textheight=8.5in, marginparsep=7pt, marginparwidth=.6in}
\setlength\parindent{0in}
\linespread{1.03} %Adil added this to change linespacing, default is 1


% FONTS
\usepackage[usenames,dvipsnames]{xcolor}
\usepackage{xunicode}
\usepackage{xltxtra}
\defaultfontfeatures{Mapping=tex-text}
%\setromanfont [Ligatures={Common}, Numbers={OldStyle}, Variant=01]{Linux Libertine O}
%\setmonofont[Scale=0.8]{Monaco}
%%% modified by Karol Kozioł for ShareLaTeX use
\setmainfont[
  Ligatures={Common}, Numbers={OldStyle}, Variant=01,
  BoldFont=LinLibertine_RB.otf,
  ItalicFont=LinLibertine_RI.otf,
  BoldItalicFont=LinLibertine_RBI.otf
]{LinLibertine_R.otf}
\setmonofont[Scale=0.8]{DejaVuSansMono.ttf}

% ---- CUSTOM COMMANDS
\chardef\&="E050
\newcommand{\html}[1]{\href{#1}{\scriptsize\textsc{[html]}}}
\newcommand{\pdf}[1]{\href{#1}{\scriptsize\textsc{[pdf]}}}
\newcommand{\doi}[1]{\href{#1}{\scriptsize\textsc{[doi]}}}
% ---- MARGIN YEARS
\usepackage{marginnote}
\newcommand{\amper{}}{\chardef\amper="E0BD }
\newcommand{\years}[1]{\marginnote{\scriptsize #1}}
\renewcommand*{\raggedleftmarginnote}{}
\setlength{\marginparsep}{7pt}
\reversemarginpar

% HEADINGS
\usepackage{sectsty} 
\usepackage[normalem]{ulem} 
\sectionfont{\mdseries\upshape\Large}
\subsectionfont{\mdseries\scshape\normalsize} 
\subsubsectionfont{\mdseries\upshape\large} 

% PDF SETUP
% ---- FILL IN HERE THE DOC TITLE AND AUTHOR
\usepackage[%dvipdfm, 
bookmarks, colorlinks, breaklinks, 
% ---- FILL IN HERE THE TITLE AND AUTHOR
    pdftitle={S. Adil Sarıbay - vita},
    pdfauthor={S. Adil Sarıbay},
    pdfproducer={http://nitens.org/taraborelli/cvtex}
]{hyperref}  
\hypersetup{linkcolor=blue,citecolor=blue,filecolor=black,urlcolor=MidnightBlue} 

And this is a sample little section:

    \section*{Publications}

\subsection*{Journal articles}
\years{2015} Günsoy, C., Cross, S. E., \textbf{Sarıbay, S. A.}, Olcaysoy-Okten, I., \& Kurutaş, M. (2015).  Would you post that picture and let your dad see it? Culture, honor, and Facebook. \emph{European Journal of Social Psychology, 45}, 323-335.\\
\years{2012} \textbf{Sarıbay, S. A.}, Rim, S., \& Uleman, J. S. (2012).  Primed self-construal, culture, and stages of impression formation. \emph{Social Psychology [Special Issue on Culture as Process], 43 (4),} 196-204.\\
Uleman, J. S., Rim, S., \textbf{Sarıbay, S. A.}, \& Kressel, L. (2012).  Controversies, questions, and prospects for spontaneous social inferences. \emph{Social and Personality Psychology Compass, 6 (9),} 657-673.\\

The parskip suggestion kind of worked but it also partially messed up the alignment between the \years and the text.

  • Welcome to TeX.SX! This might be a case for \setlength{\parskip}{1ex} – egreg Jan 30 '16 at 23:55
  • Maybe just using the parskip package will suffice? It replaces regular indented paragraphs with paragraphs delimited by blank lines. So if each of your blocks is a simple paragraph, then parskip will insert a blank line automatically between them. If you are generating the references using natbib or biblatex, however, or if they are in some sort of list structure, then the answer will be different. You need to show us a tiny complete document that shows what you are doing for us to help you. – Alan Munn Jan 30 '16 at 23:55
  • If you insert manual line breaks anyway, you might just define a macro doing that and adding the extra space. Apart from that, the efficiency difference between typing \` and \[1ex]` for all references is (especially with copy+paste) not so big. As @AlanMunn pointed out, a MWE can possibly show whether there are better solutions than those already provided in the comments. – cryingshadow Jan 31 '16 at 0:14
  • note that is (I hope!) not an inserted line break (\\ or \newline or \linebreak) but rather a paragraph break (blank line or \par) in which case tex has a parameter to set the inter-paragraph space as shown by egreg in the first comment. – David Carlisle Jan 31 '16 at 0:19
  • use of \\ outside tables is almost always wrong:-) – David Carlisle Jan 31 '16 at 0:34
3

You can set \parskip, but this needs a minor modification to \years so the \marginnote appears when the paragraph has already started. I set \parskip only locally, for the list of publications.

I also reorganized your preamble to have all packages first and settings later. Note that xltxtra and xunicode should not be loaded; just fontspec.

Never use \\ for ending a paragraph. It should only be used in contexts where it makes sense, that is, where you have to explicitly mark new lines, such as tabular or flushleft.

\documentclass[10pt, a4paper]{article}
\usepackage{fontspec} 

\usepackage{geometry} 
\usepackage{marginnote}
\usepackage{sectsty} 
\usepackage[normalem]{ulem} 
\usepackage[usenames,dvipsnames]{xcolor}
\usepackage{fontspec}
\usepackage[
  bookmarks, colorlinks, breaklinks, 
  % ---- FILL IN HERE THE TITLE AND AUTHOR
  pdftitle={S. Adil Sarıbay - vita},
  pdfauthor={S. Adil Sarıbay},
  pdfproducer={http://nitens.org/taraborelli/cvtex}
]{hyperref}  

% FONTS

\defaultfontfeatures{Mapping=tex-text}
\setmainfont[
  Ligatures={Common}, Numbers={OldStyle}, Variant=01,
  BoldFont=LinLibertine_RB.otf,
  ItalicFont=LinLibertine_RI.otf,
  BoldItalicFont=LinLibertine_RBI.otf
]{LinLibertine_R.otf}
\setmonofont[Scale=0.8]{DejaVuSansMono.ttf}

% ---- SETTINGS
\geometry{a4paper, textwidth=5.5in, textheight=8.5in, marginparsep=7pt, marginparwidth=.6in}
\setlength\parindent{0in}
\linespread{1.03} %Adil added this to change linespacing, default is 1
\hypersetup{linkcolor=blue,citecolor=blue,filecolor=black,urlcolor=MidnightBlue} 

% ---- CUSTOM COMMANDS
\chardef\&="E050
\newcommand{\html}[1]{\href{#1}{\scriptsize\textsc{[html]}}}
\newcommand{\pdf}[1]{\href{#1}{\scriptsize\textsc{[pdf]}}}
\newcommand{\doi}[1]{\href{#1}{\scriptsize\textsc{[doi]}}}
% ---- MARGIN YEARS
\newcommand{\amper{}}{\chardef\amper="E0BD }
\newcommand{\years}[1]{%
  \par\leavevmode\marginnote{\scriptsize #1}\ignorespaces
}
\renewcommand*{\raggedleftmarginnote}{}
\setlength{\marginparsep}{7pt}
\reversemarginpar

% HEADINGS
\sectionfont{\mdseries\upshape\Large}
\subsectionfont{\mdseries\scshape\normalsize} 
\subsubsectionfont{\mdseries\upshape\large} 

% PDF SETUP
% ---- FILL IN HERE THE DOC TITLE AND AUTHOR

\begin{document}

\section*{Publications}

\subsection*{Journal articles}

\begingroup\setlength\parskip{1ex}

\years{2015} Günsoy, C., Cross, S. E., \textbf{Sarıbay, S. A.}, Olcaysoy-Okten, I., \& Kurutaş, M. 
(2015).  Would you post that picture and let your dad see it? Culture, honor, and Facebook. 
\emph{European Journal of Social Psychology, 45}, 323-335.

\years{2012} \textbf{Sarıbay, S. A.}, Rim, S., \& Uleman, J. S. (2012).  Primed self-construal, 
culture, and stages of impression formation. \emph{Social Psychology [Special Issue on Culture as 
Process], 43 (4),} 196-204.

Uleman, J. S., Rim, S., \textbf{Sarıbay, S. A.}, \& Kressel, L. (2012).  
Controversies, questions, and prospects for spontaneous social inferences. \emph{Social and Personality 
Psychology Compass, 6 (9),} 657-673.

\endgroup

\end{document}

enter image description here

  • That's swell. I tried it and with that couple lines of code (begingroup-endgroup) I was able to format a whole ton of publications and presentations. Thank you very much also for fixing my preamble (it was provided by sharelatex). Cheers! – Adil Jan 31 '16 at 7:14
  • Regarding your comment: "Note that xltxtra and xunicode should not be loaded". When those are gone, then the "XeTeX" in the "Typeset in XeTeX" indication at the bottom of the end of the document disappears. So, I added those back :-) – Adil Jan 31 '16 at 7:54
  • @Adil The logo is provided by metalogo; I should have said that xunicode should not be loaded and xltxtra only if you really need its functions. – egreg Jan 31 '16 at 10:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.