laTex cv currvita - templates

I found this template and I would like to modify two things but all I tried does not work:
I would like to have more white vertical space before it displays my name since it's too close to the top as it is now
I would like the text of experience (blablablablabla..) to be more wide and therefore to reduce left and right margins
Any ideas on how to modify this template?
Thx
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Classicthesis-Styled CV
% LaTeX Template
% Version 1.0 (22/2/13)
%
% This template has been downloaded from:
% http://www.LaTeXTemplates.com
%
% Original author:
% Alessandro Plasmati
%
% License:
% CC BY-NC-SA 3.0 (http://creativecommons.org/licenses/by-nc-sa/3.0/)
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%----------------------------------------------------------------------------------------
% PACKAGES AND OTHER DOCUMENT CONFIGURATIONS
%----------------------------------------------------------------------------------------
\documentclass{scrartcl}
\reversemarginpar % Move the margin to the left of the page
\newcommand{\MarginText}[1]{\marginpar{\raggedleft\itshape\small#1}} % New command defining the margin text style
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english,italian]{babel}
\usepackage[nochapters]{classicthesis} % Use the classicthesis style for the style of the document
\usepackage[LabelsAligned]{currvita} % Use the currvita style for the layout of the document
\renewcommand{\cvheadingfont}{\hspace{3.5cm}\LARGE\color{Maroon}} % Font color of your name at the top
\usepackage{hyperref} % Required for adding links and customizing them
\hypersetup{colorlinks, breaklinks, urlcolor=Maroon, linkcolor=Maroon} % Set link colors
\newlength{\datebox}\settowidth{\datebox}{Spring 2011} % Set the width of the date box in each block
\newcommand{\NewEntry}[3]{\noindent\hangindent=2em\hangafter=0 \parbox{\datebox}{\small \textit{#1}}\hspace{1.5em} #2 #3 % Define a command for each new block - change spacing and font sizes here: #1 is the left margin, #2 is the italic date field and #3 is the position/employer/location field
\vspace{0.3em}} % Add some white space after each new entry
%
\newcommand{\Description}[1]{\hangindent=1em\hangafter=0\noindent\raggedright\footnotesize{#1}\par\normalsize\vspace{1em}} % Define a command for descriptions of each entry - change spacing and font sizes here
%----------------------------------------------------------------------------------------
\date{} % Don't print the date
\begin{document}
\thispagestyle{empty} % Stop the page count at the bottom of the first page
%----------------------------------------------------------------------------------------
% CONTACT INFORMATION
%----------------------------------------------------------------------------------------
\begin{cv}{\spacedallcaps{Mario Rossi}}\vspace{1.8em} % Your name
\noindent\spacedlowsmallcaps{Contact Information}
\vspace{0.1em}
\hrule
\vspace{1em}
\NewEntry{Address}{Salita del carro, L'isola che non c'è} % Address
\NewEntry{Email}{\href{mailto:name#gmail.com}{name#gmail.com}} % Email address
\NewEntry{Linkedin}{\href{http://it.linkedin.com/pub/....}{http://it.linkedin.com/...../}} % Linkedin
\NewEntry{Phone}{+39 333\ \ $\cdotp$\ \ 11111111} % Phone number
%\vspace{1em} % Extra white space between the personal information section and goal
%\noindent\spacedlowsmallcaps{Goal}\vspace{1em} % Goal heading, could be used for a quotation or short profile instead
%\Description{Gain fundamental experience in my area of interest and expertise.}\vspace{2em} % Goal text
%----------------------------------------------------------------------------------------
% EXPERIENCE
%----------------------------------------------------------------------------------------
\vspace{0.6em}% Extra space between major sections
\noindent\spacedlowsmallcaps{Experience}
\vspace{0.1em}
\hrule
\vspace{1em}
%------------------------------------------------
\NewEntry{}{ \textsc{Somewhere,\textit{ City} }}
\Description{\MarginText{July - December 2015}blablablablablablablablablablablablablablablablablablablablablablablablablablablablablablablablablablablablablablablablablablablablablablablablablabla\\ }
%----------------------------------------------------------------------------------------
\end{cv}
\end{document}

Here is how I addressed your two requirements:
Insert an invisible, vertical strut as part of the \cvheadingfont. I used \rule{0pt}{100pt}, but you can adjust (increase/decrease) the value of 100pt to move the content up/down.
Switched the document class to use the default article class, since there seems to be no need for using KOMA-script. This also allows for ease-of-use when changing the page layout/geometry using geometry. You can adjust the left and right margins to suit your needs.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Classicthesis-Styled CV
% LaTeX Template
% Version 1.0 (22/2/13)
%
% This template has been downloaded from:
% http://www.LaTeXTemplates.com
%
% Original author:
% Alessandro Plasmati
%
% License:
% CC BY-NC-SA 3.0 (http://creativecommons.org/licenses/by-nc-sa/3.0/)
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%----------------------------------------------------------------------------------------
% PACKAGES AND OTHER DOCUMENT CONFIGURATIONS
%----------------------------------------------------------------------------------------
\documentclass{article}
\reversemarginpar % Move the margin to the left of the page
\newcommand{\MarginText}[1]{\marginpar{\raggedleft\itshape\small#1}} % New command defining the margin text style
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english,italian]{babel}
\usepackage[nochapters]{classicthesis} % Use the classicthesis style for the style of the document
\usepackage[LabelsAligned]{currvita} % Use the currvita style for the layout of the document
\usepackage{lipsum}
\renewcommand{\cvheadingfont}{%
\rule{0pt}{100pt}%
\centering\LARGE\color{Maroon}} % Font color of your name at the top
\usepackage{hyperref} % Required for adding links and customizing them
\hypersetup{colorlinks, breaklinks, urlcolor=Maroon, linkcolor=Maroon} % Set link colors
\newlength{\datebox}\settowidth{\datebox}{Spring 2011} % Set the width of the date box in each block
\newcommand{\NewEntry}[3]{%
\noindent\hangindent=2em\hangafter=0
\parbox{\datebox}{\small \textit{#1}}\hspace{1.5em} #2 #3 % Define a command for each new block - change spacing and font sizes here:
% #1 is the left margin,
% #2 is the italic date field and
% #3 is the position/employer/location field
\vspace{0.3em}} % Add some white space after each new entry
%
\newcommand{\Description}[1]{%
\hangindent=1em\hangafter=0
\noindent\raggedright\footnotesize #1\par
\normalsize\vspace{1em}} % Define a command for descriptions of each entry - change spacing and font sizes here
\usepackage[left=100pt,right=2cm]{geometry}
%----------------------------------------------------------------------------------------
\date{} % Don't print the date
\begin{document}
\thispagestyle{empty} % Stop the page count at the bottom of the first page
%----------------------------------------------------------------------------------------
% CONTACT INFORMATION
%----------------------------------------------------------------------------------------
\begin{cv}{\spacedallcaps{Mario Rossi}}\vspace{1.8em} % Your name
\noindent\spacedlowsmallcaps{Contact Information}
\vspace{0.1em}
\hrule
\vspace{1em}
\NewEntry{Address}{Salita del carro, L'isola che non c'è} % Address
\NewEntry{Email}{\href{mailto:name#gmail.com}{name#gmail.com}} % Email address
\NewEntry{Linkedin}{\href{http://it.linkedin.com/pub/....}{http://it.linkedin.com/...../}} % Linkedin
\NewEntry{Phone}{+39 333\ \ $\cdotp$\ \ 11111111} % Phone number
%\vspace{1em} % Extra white space between the personal information section and goal
%\noindent\spacedlowsmallcaps{Goal}\vspace{1em} % Goal heading, could be used for a quotation or short profile instead
%\Description{Gain fundamental experience in my area of interest and expertise.}\vspace{2em} % Goal text
%----------------------------------------------------------------------------------------
% EXPERIENCE
%----------------------------------------------------------------------------------------
\vspace{0.6em}% Extra space between major sections
\noindent\spacedlowsmallcaps{Experience}
\vspace{0.1em}
\hrule
\vspace{1em}
%------------------------------------------------
\NewEntry{}{\textsc{Somewhere,\textit{City}}}
\Description{\MarginText{July - December 2015}\lipsum[1]}
%----------------------------------------------------------------------------------------
\end{cv}
\end{document}

Related

Github icon in latex

I have resume template on overleaf. Now I want to add github logo on that after linkdein logo. How can I do that?
https://www.overleaf.com/articles/aditya-gadepallis-resume/kzdksnkdcrsr
How I want to add github logo after linkdein logo.
I am confused how to do that can someone please help me in that.
This is the tex file : https://pastebin.com/qVJ7HViy
This is the cls file : https://pastebin.com/AX27WY7e
\ProvidesClass{twentysecondcv}[2017/01/08 CV class]
\LoadClass{article}
\NeedsTeXFormat{LaTeX2e}
%----------------------------------------------------------------------------------------
% REQUIRED PACKAGES
%----------------------------------------------------------------------------------------
\RequirePackage[sfdefault]{ClearSans}
\RequirePackage[T1]{fontenc}
\RequirePackage{tikz}
\RequirePackage{xcolor}
\RequirePackage[absolute,overlay]{textpos}
\RequirePackage{ragged2e}
\RequirePackage{etoolbox}
\RequirePackage{ifmtarg}
\RequirePackage{ifthen}
\RequirePackage{pgffor}
\RequirePackage{marvosym}
\RequirePackage{parskip}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
\ProcessOptions\relax
%----------------------------------------------------------------------------------------
% COLOURS
%----------------------------------------------------------------------------------------
\definecolor{white}{RGB}{255,255,255}
\definecolor{gray}{HTML}{4D4D4D}
\definecolor{sidecolor}{HTML}{E7E7E7}
\definecolor{mainblue}{HTML}{0E5484}
\definecolor{maingray}{HTML}{B9B9B9}
%----------------------------------------------------------------------------------------
% MISC CONFIGURATIONS
%----------------------------------------------------------------------------------------
\renewcommand{\bfseries}{\color{gray}} % Make \textbf produce coloured text instead
\pagestyle{empty} % Disable headers and footers
\setlength{\parindent}{0pt} % Disable paragraph indentation
%----------------------------------------------------------------------------------------
% SIDEBAR DEFINITIONS
%----------------------------------------------------------------------------------------
\setlength{\TPHorizModule}{1cm} % Left margin
\setlength{\TPVertModule}{1cm} % Top margin
\newlength\imagewidth
\newlength\imagescale
\pgfmathsetlength{\imagewidth}{5cm}
\pgfmathsetlength{\imagescale}{\imagewidth/600}
\newlength{\TotalSectionLength} % Define a new length to hold the remaining line width after the section title is printed
\newlength{\SectionTitleLength} % Define a new length to hold the width of the section title
\newcommand{\profilesection}[1]{%
\setlength\TotalSectionLength{\linewidth}% Set the total line width
\settowidth{\SectionTitleLength}{\huge #1 }% Calculate the width of the section title
\addtolength\TotalSectionLength{-\SectionTitleLength}% Subtract the section title width from the total width
\addtolength\TotalSectionLength{-2.22221pt}% Modifier to remove overfull box warning
\vspace{8pt}% Whitespace before the section title
{\color{black!80} \huge #1 \rule[0.15\baselineskip]{\TotalSectionLength}{1pt}}% Print the title and auto-width rule
}
% Define custom commands for CV info
\newcommand{\cvdate}[1]{\renewcommand{\cvdate}{#1}}
\newcommand{\cvnumberphone}[1]{\renewcommand{\cvnumberphone}{#1}}
\newcommand{\cvaddress}[1]{\renewcommand{\cvaddress}{#1}}
\newcommand{\cvsite}[1]{\renewcommand{\cvsite}{#1}}
\newcommand{\Education}[1]{\renewcommand{\Education}{#1}}
\newcommand{\skills}[1]{\renewcommand{\skills}{#1}}
\newcommand{\COURSEWORK}[1]{\renewcommand{\COURSEWORK}{#1}}
\newcommand{\cvname}[1]{\renewcommand{\cvname}{#1}}
\newcommand{\cvjobtitle}[1]{\renewcommand{\cvjobtitle}{#1}}
% Command for printing the contact information icons
\newcommand*\icon[1]{\tikz[baseline=(char.base)]{\node[shape=circle,draw,inner sep=1pt, fill=mainblue,mainblue,text=white] (char) {#1};}}
% Command for printing skill progress bars
% Command for printing skills text
\newcommand\skillstext[1]{
\renewcommand{\skillstext}{
\begin{flushleft}
\foreach [count=\i] \x/\y in {#1}{
\x$ \star $\y
}
\end{flushleft}
}
}
%----------------------------------------------------------------------------------------
% SIDEBAR LAYOUT
%----------------------------------------------------------------------------------------
\newcommand{\makeprofile}{
\begin{tikzpicture}[remember picture,overlay]
\node [rectangle, fill=sidecolor, anchor=north, minimum width=9cm, minimum height=\paperheight+1cm] (box) at (-5cm,0.5cm){};
\end{tikzpicture}
%------------------------------------------------
\begin{textblock}{6}(0.5, 0.2)
%------------------------------------------------
\ifthenelse{\equal{\profilepic}{}}{}{
\begin{center}
\begin{tikzpicture}[x=\imagescale,y=-\imagescale]
\clip (600/2, 567/2) circle (567/2);
\node[anchor=north west, inner sep=0pt, outer sep=0pt] at (0,0) {\includegraphics[width=\imagewidth]{\profilepic}};
\end{tikzpicture}
\end{center}
}
%------------------------------------------------
{\Huge\color{mainblue}\cvname}
%------------------------------------------------
{\Large\color{black!80}\cvjobtitle}
%------------------------------------------------
\renewcommand{\arraystretch}{1.6}
\begin{tabular}{p{0.5cm} #{\hskip 0.5cm}p{5cm}}
\ifthenelse{\equal{\cvdate}{}}{}{\textsc{\Large\icon{\Info}} & \cvdate\\}
\ifthenelse{\equal{\cvaddress}{}}{}{\textsc{\Large\icon{\Letter}} & \cvaddress\\}
\ifthenelse{\equal{\cvnumberphone}{}}{}{\textsc{\Large\icon{\Telefon}} & \cvnumberphone\\}
\ifthenelse{\equal{\cvsite}{}}{}{\textsc{\Large\icon{\Mundus}} & \cvsite\\}
\ifthenelse{\equal{\cvmail}{}}{}{\textsc{\large\icon{#}} & \href{mailto:\cvmail}{\cvmail}}
\end{tabular}
%------------------------------------------------
\ifthenelse{\equal{\Education}{}}{}{
\profilesection{Education}
\begin{flushleft}
\Education
\end{flushleft}
}
%------------------------------------------------
\ifthenelse{\equal{\skills}{}}{}{
\profilesection{Skills}
\begin{flushleft}
\skills
\end{flushleft}
}
\ifthenelse{\equal{\COURSEWORK}{}}{}{
\profilesection{COURSEWORK}
\begin{flushleft}
\COURSEWORK
\end{flushleft}
}
%------------------------------------------------
\end{textblock}
}
%----------------------------------------------------------------------------------------
% COLOURED SECTION TITLE BOX
%----------------------------------------------------------------------------------------
% Command to create the rounded boxes around the first three letters of section titles
\newcommand*\round[2]{%
\tikz[baseline=(char.base)]\node[anchor=north west, draw,rectangle, rounded corners, inner sep=1.6pt, minimum size=5.5mm, text height=3.6mm, fill=#2,#2,text=white](char){#1};%
}
\newcounter{colorCounter}
\newcommand{\sectioncolor}[1]{%
{%
\round{#1}{
\ifcase\value{colorCounter}%
maingray\or%
mainblue\or%
maingray\or%
mainblue\or%
maingray\or%
mainblue\or%
maingray\or%
mainblue\or%
maingray\or%
mainblue\else%
maingray\fi%
}%
}%
\stepcounter{colorCounter}%
}
\renewcommand{\section}[1]{
{%
\color{gray}%
\Large\sectioncolor{#1}%
}
}
\renewcommand{\subsection}[1]{
\par\vspace{.5\parskip}{%
\large\color{gray} #1%
}
\par\vspace{.25\parskip}%
}
%----------------------------------------------------------------------------------------
% LONG LIST ENVIRONMENT
%----------------------------------------------------------------------------------------
\setlength{\tabcolsep}{0pt}
% New environment for the long list
\newenvironment{twenty}{%
\begin{tabular*}{\textwidth}{#{\extracolsep{\fill}}ll}
}{%
\end{tabular*}
}
\newcommand{\twentyitem}[4]{%
#1&\parbox[t]{0.83\textwidth}{%
\textbf{#2}%
\hfill%
{\footnotesize#3}\\%
#4\vspace{\parsep}%
}\\
}
%----------------------------------------------------------------------------------------
% SMALL LIST ENVIRONMENT
%----------------------------------------------------------------------------------------
\setlength{\tabcolsep}{0pt}
% New environment for the small list
\newenvironment{twentyshort}{%
\begin{tabular*}{\textwidth}{#{\extracolsep{\fill}}ll}
}{%
\end{tabular*}
}
\newcommand{\twentyitemshort}[2]{%
#1&\parbox[t]{0.83\textwidth}{%
\textbf{#2}%
}\\
}
%----------------------------------------------------------------------------------------
% MARGINS AND LINKS
%----------------------------------------------------------------------------------------
\RequirePackage[left=7.6cm,top=0.1cm,right=1cm,bottom=0.2cm,nohead,nofoot]{geometry}
\RequirePackage{hyperref}
Quick hack:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Twenty Seconds Resume/CV
% LaTeX Template
% Version 1.1 (8/1/17)
%
% This template has been downloaded from:
% http://www.LaTeXTemplates.com
%
% Original author:
% Carmine Spagnuolo (cspagnuolo#unisa.it) with major modifications by
% Vel (vel#LaTeXTemplates.com)
%
% License:
% The MIT License (see included LICENSE file)
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%----------------------------------------------------------------------------------------
% PACKAGES AND OTHER DOCUMENT CONFIGURATIONS
%----------------------------------------------------------------------------------------
\documentclass[letterpaper]{twentysecondcv} % a4paper for A4
%----------------------------------------------------------------------------------------
% PERSONAL INFORMATION
%----------------------------------------------------------------------------------------
% If you don't need one or more of the below, just remove the content leaving the command, e.g. \cvnumberphone{}
\cvname{Aditya} % Your name
\cvjobtitle{Gadepalli} % Job title/career
\cvdate{16 February 1997} % Date of birth
\cvaddress{adityagadepalli#gmail.com} % Short address/location, use \newline if more than 1 line is required
\cvnumberphone{+91 9553336954} % Phone number
\cvsite{linkedin.com/in/a-gadepalli} % Personal website
\makeatletter
\newcommand{\cvmail}{example#mail.com}
\usepackage{fontawesome5}
\renewcommand{\makeprofile}{
\begin{tikzpicture}[remember picture,overlay]
\node [rectangle, fill=sidecolor, anchor=north, minimum width=9cm, minimum height=\paperheight+1cm] (box) at (-5cm,0.5cm){};
\end{tikzpicture}
%------------------------------------------------
\begin{textblock}{6}(0.5, 0.2)
%------------------------------------------------
\ifthenelse{\equal{\profilepic}{}}{}{
\begin{center}
\begin{tikzpicture}[x=\imagescale,y=-\imagescale]
\clip (600/2, 567/2) circle (567/2);
\node[anchor=north west, inner sep=0pt, outer sep=0pt] at (0,0) {\includegraphics[width=\imagewidth]{\profilepic}};
\end{tikzpicture}
\end{center}
}
%------------------------------------------------
{\Huge\color{mainblue}\cvname}
%------------------------------------------------
{\Large\color{black!80}\cvjobtitle}
%------------------------------------------------
\renewcommand{\arraystretch}{1.6}
\begin{tabular}{p{0.5cm} #{\hskip 0.5cm}p{5cm}}
\ifthenelse{\equal{\cvdate}{}}{}{\textsc{\Large\icon{\Info}} & \cvdate\\}
\ifthenelse{\equal{\cvaddress}{}}{}{\textsc{\Large\icon{\Letter}} & \cvaddress\\}
\ifthenelse{\equal{\cvnumberphone}{}}{}{\textsc{\Large\icon{\Telefon}} & \cvnumberphone\\}
\ifthenelse{\equal{\cvsite}{}}{}{\textsc{\Large\icon{\scalebox{0.85}{\faLinkedin}}} & \url{linkedin.com/in/a-gadepalli}\\}
\textsc{\Large\icon{\scalebox{0.8}{\faGithub}}} & \url{https://github.com}\\
\ifthenelse{\equal{\cvmail}{}}{}{\textsc{\large\icon{#}} & \href{mailto:\cvmail}{\cvmail}}
\end{tabular}
%------------------------------------------------
\ifthenelse{\equal{\Education}{}}{}{
\profilesection{Education}
\begin{flushleft}
\Education
\end{flushleft}
}
%------------------------------------------------
\ifthenelse{\equal{\skills}{}}{}{
\profilesection{Skills}
\begin{flushleft}
\skills
\end{flushleft}
}
\ifthenelse{\equal{\ExtraCurricular}{}}{}{
\profilesection{Extra-Curricular}
\begin{flushleft}
\ExtraCurricular
\end{flushleft}
}
%------------------------------------------------
\end{textblock}
}
\makeatother
\newcommand{\profilepic}{example-image-duck}
%----------------------------------------------------------------------------------------
\begin{document}
%----------------------------------------------------------------------------------------
% Education
%----------------------------------------------------------------------------------------
\Education{B.E.(Hons.) Mechanical Engineering BITS Pilani | 2018 | GPA:8.947/10
\newline \newline Class XII \newline Mahathi Jr College | 2014 | 95.7 \%
\newline \newline Class X \newline Rishi Vid. Gurukulam | 2012 | 10/10} % To have no Education section, just remove all the text and leave \Education{}
%----------------------------------------------------------------------------------------
% SKILLS
%----------------------------------------------------------------------------------------
% Skill bar section, each skill must have a value between 0 an 6 (float)
\skills{Languages: C, Java, Matlab, SQL, Gosu, Basics of R and Python
\newline WebDev : HTML, CSS, JS, JQuery, php
\newline Simulation : Ansys, Comsol, Arduino
\newline Design : ProE, AutoCAD, Solidworks, Autodesk Alias, Adobe Photoshop
\newline Other: MS Office, JIRA, Git, Adobe AE
\newline Certifications: Oracle Certified Associate, Java SE 8 Programmer}
\ExtraCurricular{Co-Founder \& Head # Evolve \\ - Organized talks \& workshops
\\ - Brought the alumni of IITs, BITS, NITs and industry professionals to guide students
\newline\newline Graphic Designer # Designers Anonymous \& Dept. of Technical Arts\\- Taught design softwares to students\\- Designed content to publicize fests
\newline \newline Event Manager # BITS Embryo \\ - Organizer of conclave forums \& talks\\
- Handled logistics \& pitched speakers
\newline\newline Volunteer # NSS \& Nirmaan NGO \\ - Created jobs for rural women\\- Co-organized Cyclone relief fund-raiser, cleanliness drives \& taught rural school kids
\newline\newline Class Committee representative \& Teaching Assistant for the courses Production Techniques \& Human Resource Development}
%------------------------------------------------
% Skill text section, each skill must have a value between 0 an 6
%----------------------------------------------------------------------------------------
\makeprofile % Print the sidebar
%----------------------------------------------------------------------------------------
% INTERESTS
%----------------------------------------------------------------------------------------
%----------------------------------------------------------------------------------------
% EDUCATION
%----------------------------------------------------------------------------------------
\section{Work Experience and Internships}
\begin{twenty} % Environment for a list with descriptions
\twentyitem{Since Aug'18}{Senior Analyst}{Capgemini, Hyderabad}{Building a Rating Engine for Insurance firms using Guidewire \& Java}
\twentyitem{Jan-Jun'18}{Research Intern}{Center for AI \& Robotics, DRDO, Bengaluru}{Designed \& built a Stair Climber bot along with its basic SDK library\\ Worked on Active Noise Cancellation algorithms for Wall Climber bot}
\twentyitem{July'17}{Summer Intern}{NTPC Limited, Solapur}{Analyed \emph{Scope of Wind capacity installations} using Meteorological data and learnt about the practical challenges of commissioning them}
\twentyitem{June'17}{Summer Intern}{RINL, Visakhapatnam}{Learnt about steel making processes \& waste heat recovery systems\\ Analyzed workflow \& suggested optimization of few bottlenecks}
\twentyitem{Summer'16}{Summer Intern}{Century Rayon, Mumbai}{Investigated the "Heating Effects in Cake conditioning Rooms"\\
Studied TQM and DMAIC practices to address performance issues}
%\twentyitem{<dates>}{<title>}{<location>}{<description>}
\end{twenty}
%----------------------------------------------------------------------------------------
% PUBLICATIONS
%----------------------------------------------------------------------------------------
\section{Research and Projects}
\begin{twenty} % Environment for a short list with no descriptions
\twentyitem{May-Dec'17}{Advanced Materials for Energy Efficient Buildings} {}{Studied the application of Phase Change Materials in buildings to \\reduce cooling load \& energy usage across various geographies}
\twentyitem{Jan-May'17}{Design of Cleanroom for MEMS Fabrication}{}{Optimized the control parameters of an ISO 5 Cleanroom using DOE methods \& COMSOL5.1 (CFD) \& validated results with Hemair SI Ltd.}
\twentyitem{Jan-May'17}{Interactive Creation of Splines}{}{Formulated algorithms and built a GUI using Matlab to obtain splines and their respective blending functions for any given dynamic input}
\twentyitem{Aug-Nov'16}{Fabrication of Tabletop EDM Machine}{}{Led a team of 8 students to design \& build the product from genesis \&
achieved 20 micron erosion on AISI 1020 steel using brass electrode}
\twentyitem{Aug-Nov'15}{Critical analysis of Performance appraisal systems}{}{Led a team of 8 students to survey \& review the appraisal systems of NTPC and IBM to measure its influence on employee's work outputs}
%\twentyitemshort{<dates>}{<title/description>}
\end{twenty}
%----------------------------------------------------------------------------------------
% AWARDS
%----------------------------------------------------------------------------------------
\section{Achievements}
\begin{twenty} % Environment for a short list with no descriptions
\twentyitem{Dec'17}{Book Distribution Campaign}{}{Single handedly ran a campaign \& sold over 150+ books within 3 days}
\twentyitem{Mar'17}{First - VIKAS Soch Ideation Marathon}{}{Won 10k in cash for best social startup idea at Launchpad E-Summit}
\twentyitem{Mar'16}{Runners Up - Ground Reality}{}{Won 12k in cash for the best B-Plan submission at Pearl 2017}
\twentyitem{Feb'10}{Best All Rounder Award}{}{Ranked first across all campuses of school for all-round excellence}
\twentyitem{2010-11}{Olympiads(School Level)}{}{GOLD Medals won at NSO(2011), NCO(2010) \& IMO(2010))}
%\twentyitemshort{<dates>}{<title/description>}
\end{twenty}
%----------------------------------------------------------------------------------------
% EXPERIENCE
%----------------------------------------------------------------------------------------
\section{Electives and MOOCs}
\begin{twenty} % Environment for a list with descriptions
\twentyitem{Electives}{Reverse Engineering \& Rapid Prototyping, Renewable Energy, Quality Control Assurance \& Reliability, Project Appraisal, Public Policy,\\Principles of Management, HR Development, Fundamentals of\\Finance \& Accounting, Srimad Bhagavad Gita}{}{}
\twentyitem{MOOCs}{\textbf{Introduction to R,SQL \& Python Courses on Datacamp}\\Currently pursuing Deep Learning Specialization on Coursera}{}{}
%\twentyitem{<dates>}{<title>}{<location>}{<description>}
\end{twenty}
%----------------------------------------------------------------------------------------
% OTHER INFORMATION
%----------------------------------------------------------------------------------------
%----------------------------------------------------------------------------------------
% SECOND PAGE EXAMPLE
%----------------------------------------------------------------------------------------
%\newpage % Start a new page
%\makeprofile % Print the sidebar
%\section{Other information}
%\subsection{Review}
%Alice approaches Wonderland as an anthropologist, but maintains a strong sense of noblesse oblige that comes with her class status. She has confidence in her social position, education, and the Victorian virtue of good manners. Alice has a feeling of entitlement, particularly when comparing herself to Mabel, whom she declares has a ``poky little house," and no toys. Additionally, she flaunts her limited information base with anyone who will listen and becomes increasingly obsessed with the importance of good manners as she deals with the rude creatures of Wonderland. Alice maintains a superior attitude and behaves with solicitous indulgence toward those she believes are less privileged.
%\section{Other information}
%\subsection{Review}
%Alice approaches Wonderland as an anthropologist, but maintains a strong sense of noblesse oblige that comes with her class status. She has confidence in her social position, education, and the Victorian virtue of good manners. Alice has a feeling of entitlement, particularly when comparing herself to Mabel, whom she declares has a ``poky little house," and no toys. Additionally, she flaunts her limited information base with anyone who will listen and becomes increasingly obsessed with the importance of good manners as she deals with the rude creatures of Wonderland. Alice maintains a superior attitude and behaves with solicitous indulgence toward those she believes are less privileged.
%----------------------------------------------------------------------------------------
\end{document}

Pandoc template: different separator for last item

I'm writing a custom Pandoc template and want it to print a list of authors so that all authors are separated with ", " except for the last author who instead is separated with an "and". Can this be done?
Let's say this is my template:
$if(title)$
$title$
$endif$
$if(author)$
$for(author)$$author$$sep$, $endfor$
$endif$
$body$
Which outputs:
My title
Author 1, Author 2, Author 3
Document body
But I want it to output:
My title
Author 1, Author 2 and Author 3
Document body
You have to use so-called "pipes" from Pandoc template syntax (see https://pandoc.org/MANUAL.html).
We'll make a for loop for all-but-last items in our array (it is considered as a pronoun inside the loop, refering to the values from authors/allbutlast). For those elements of our authors array, we'll use ", " as a separator, but outside the loop, we'll simply put the "final separator" ("and" in this case), and the last element of authors array (~ stands for unbreakable space, if you are going to output to LaTeX).
$for(authors/allbutlast)$$it$$sep$, $endfor$ and~$authors/last$
EDIT:
In case there's only one author, use something like this:
$if(author/allbutlast)$
$for (author/allbutlast)$
${it}$sep$,
$endfor$
and ${author/last}
$else$
${author/last}
$endif$
I changed Jan's answer a little to get it to work in my use-case (a Quarto template). Why do I have by-author? Not sure, but that is what the Quarto template I am changing uses.
$if(by-author/allbutlast)$
$for(by-author/allbutlast)$
{\large{$by-author.name.literal$}}$sep$,
$endfor$
$for(by-author/last)$
{and \large{$by-author.name.literal$}}
$endfor$
$else$
${by-author/last}
$endif$
Here is my full use case. I know this is way more than what was asked, but if you end up on this answer and are making pandoc templates, this might be helpful. I've learned a lot from seeing full use cases. I am working on a title page template for a Quarto book.
YAML _quarto.yml
project:
type: book
book:
title: The title
subtitle: The subtitle
author:
- name: Jane Doe
- name: Eva Nováková
- name: Matti Meikäläinen
chapters:
- index.qmd
- chap1.qmd
- chap2.qmd
- references.qmd
bibliography: references.bib
format:
pdf:
documentclass: scrbook
template-partials: ["partials/before-body.tex"]
toc: true
include-in-header:
text: |
\newcommand*{\plogo}{\fbox{$\mathcal{PL}$}} % logo
\usepackage[utf8]{inputenc} % international characters
\usepackage[T1]{fontenc} % international characters
\usepackage{hyphenat} % don't hyphenate the title
\usepackage{authblk}
partials/before-body.tex
\begin{frontmatter} % why not titlepage? dunno, titlepage threw errors.
\raggedleft % Right align the title page
\rule{1pt}{\textheight} % Vertical line
\hspace{0.05\textwidth} % Whitespace between the vertical line and title page text
\parbox[b]{0.85\textwidth}{ % Paragraph box for holding the title page
{\large\bfseries\nohyphens{$title$}}\\[2\baselineskip] % Title
$if(subtitle)$
{\large\textit{$subtitle$}}\\[4\baselineskip] % Subtitle
$endif$
$if(by-author/allbutlast)$
$for(by-author/allbutlast)$
{\large{$by-author.name.literal$}}$sep$,
$endfor$
$for(by-author/last)$
{and \large{$by-author.name.literal$}}
$endfor$
$else$
${by-author/last}
$endif$
\vspace{0.5\textheight} % Whitespace
{\noindent The Publisher~~\plogo}\\[\baselineskip] % Publisher+logo
}
\end{frontmatter}

Unable to set the Entry box to correct position in python

I am trying to learn creating GUI using Tkinter .I created a window which includes text,Messagebox,Entry widget,labels and Radio buttons.
I used grid method for frames and tried to make entry boxes in row0 and row1 .And a message Box with Some text.But these are not properly aligned even though i gave correct rows and columns but output is not in order.
Entry box is created very far though i mentioned column1 .And message box is created as per the column specified.Can anyone help me how to solve this.If i am missing anything please let me now .
from Tkinter import*
import tkMessageBox
class Example:
def __init__(self,root):
root.title("Sample")
#Entry functions ---------------------------------------
Label(root, text="First Name").grid(row=0)
Label(root, text="Last Name").grid(row=1)
self.e1 = Entry(root)
self.e1.bind("<Return>",self.ShowChoice_radio)
self.e2 = Entry(root)
self.e2.bind("<Return>",self.ShowChoice_radio)
self.e1.grid(row=0,column=1)
self.e2.grid(row =1,column = 1)
#------------------------------------------------------------------------
self.frame=Frame(root)
self.frame.grid(row=3,sticky=W)
self.label=Label(self.frame, text="mine", width=12,bg="green",fg="white",justify=LEFT)
self.label.grid(row=3,column=4,sticky=W,pady=4)
root.minsize(width=666, height=220)
self.v=IntVar()
role=[("ENGLISH",1),("SPANISH",2),("GERMAN",3)]
Label(self.frame,text="Choose your role of target:",justify=LEFT,padx=2,pady=2).grid(row=4,sticky=W)
i=0
for txt,val in role:
i=i+1
self.rad_bt=Radiobutton(self.frame,text=txt,padx=20,variable=self.v,
command=self.ShowChoice_radio,value=val)
self.rad_bt.grid(row=4,column=i+1)
self.bottomframe = Frame(root)
self.bottomframe.grid(row=12,sticky=W)
self.hello(12)
T=Text(self.bottomframe,height=2,width=30)
T.pack(padx=100,side=TOP)
T.insert(END,"just a normal text to display!\n")
self.mbutton=Button(self.bottomframe,text='Quit',command=self.callback,state='normal')
self.mbutton.pack(padx=3,pady=3,side='left')
self.help=Button(self.bottomframe,text='Help',command=self.help_msg,width=5,justify=CENTER)
self.help.pack(padx=93,pady=3,side='left')
def ShowChoice_radio(self):
print self.v.get()
def help_msg(self):
tkMessageBox.showinfo("Help to print ",message="Not yet implemented")
root.minsize(width=666, height=666)
self.show_entry_fields()
self.help.config(state=DISABLED)
def callback(self):
if tkMessageBox.askyesno('verify','Really Quit?'):
root.destroy()
def hello(self,name):
w=Label(root,text="Hello Tkinter!",width=15).grid(row=10)
whatever_you_do = "Whatever . it is my test that \n i can anble to display manner in this case find out whether it is correct one or wrong \n)"
msg=Message(root, anchor='s',width=200,text = whatever_you_do)
msg.config(bg='lightgreen', font=('times', 14, 'italic'))
msg.grid(row=10,column=1,sticky=W)
def show_entry_fields(self):
print "First Name: %s\nLast Name: %s" % (self.e1.get(), self.e2.get())
if __name__=="__main__":
root=Tk()
app=Example(root)
root.mainloop()
Even the quit and Help buttons are not proper...!!!
I initially voted to close this because there is not a clear question, but mostly only a series of statements and opinions, at least one of which is incorrect. After looking more, I think I can answer your implied question "Why is tkinter behaving in a way that seems wrong to me?". The answer, I believe, is that you do not understand that grid coordinates are independent (start over) for each container gridded. Also, coordinates not used are ignored. In particular:
Root has a grid of 5 rows and 2 columns. Renumbering the rows 0, 1, 2, 3, 4 instead of the confusing labeling you used, there is no entry in column 1 for rows 2 and 4. The width of column 0 is determined by the width of self.frame in row 2, column 0. The entry boxes are far to the right because column 0 is very wide.
Self.frame has a grid of 2 rows and 4 columns. The first 3 columns of row 0 are empty. Self.bottomframe is packed instead of gridded. The buttons are to the left of where you want because you packed them to the left. In other words, tkinter did just what you said, which is apparently not what you want.
You might list the result better if you got rid of self.frame, put 'mine' in (2,0) or (2,0), 'Choose...' in (3, 0), and a frame with 3 radio buttoms in (3,1). Then root column 0 would not be so overly wide.

In MS Excel, Text Width of text in a cell returned by GetTextExtentPoint32W is more than the actual width

I'm using GetTextExtentPoint32W to get width of a text in a cell in MS Excel 2010. The cell width is fetched using ActiveCell.Width. These two widths are then compared to determine whether the text fits in the cell or extends out of the cell.
Visually, even though the text fits perfectly in the cell, the text width returned by the method is more than the cell width. Also, when I increase the font size the difference between actual text width and that returned by the method increases.
Following is a part of the source code used to achieve the result. Please help me solve this error.
hDC = ctypes.windll.user32.GetDC(self.windowHandle)
tempBMP = ctypes.windll.gdi32.CreateCompatibleBitmap(hDC, 1, 1)
hBMP = ctypes.windll.gdi32.SelectObject(hDC, tempBMP)
iFontSize = self.excelCellObject.Font.Size
deviceCaps = ctypes.windll.gdi32.GetDeviceCaps(hDC, 90)
iFontSize = int(iFontSize)
iFontSize = ctypes.c_int(iFontSize)
iFontSize = ctypes.windll.kernel32.MulDiv(iFontSize, deviceCaps, 72)
iFontSize = iFontSize * -1
iFontWeight = 700 if self.excelCellObject.Font.Bold else 400
sFontName = self.excelCellObject.Font.Name
sFontItalic = self.excelCellObject.Font.Italic
sFontUnderline = True if self.excelCellObject.Font.Underline else False
sFontStrikeThrough = self.excelCellObject.Font.Strikethrough
#Create a font object with the correct size, weight and style
hFont = ctypes.windll.gdi32.CreateFontW(iFontSize,
0, 0, 0,
iFontWeight,
sFontItalic,
sFontUnderline,
sFontStrikeThrough,
False, False, False,
False, False,
sFontName)
#Load the font into the device context, storing the original font object
hOldFont = ctypes.windll.gdi32.SelectObject(hDC, hFont)
sText = self.excelCellObject.Text
log.io("\nText \t"+sText+"\n")
textLength = len(sText)
class structText(ctypes.Structure):
_fields_ = [("width", ctypes.c_int),
("height",ctypes.c_int)]
StructText = structText()
getTextExtentPoint = ctypes.windll.gdi32.GetTextExtentPoint32W
getTextExtentPoint.argtypes = [ctypes.c_void_p,
ctypes.c_char_p,
ctypes.c_int,
ctypes.POINTER(structText)]
getTextExtentPoint.restype = ctypes.c_int
#Get the text dimensions
a = ctypes.windll.gdi32.GetTextExtentPoint32W(hDC,
sText,
textLength,
ctypes.byref(StructText))
#Delete the font object we created
a = ctypes.windll.gdi32.DeleteObject(hFont)
a = ctypes.windll.gdi32.DeleteObject(tempBMP)
#Release the device context
a = ctypes.windll.user32.ReleaseDC(self.windowHandle, hDC)
textWidth = StructText.width
cellWidth = self.excelCellObject.Width
Thanks.
I do not use Python or Excel 2010 so cannot comment on your current approach. However, I have struggled with a similar problem. I hope the following points will be helpful.
Background
If you hover over the right boundary of an Excel column and hold the left mouse button you will get a display of the format: “Width: n.nn (mm pixels)”.
The help for the ColumnWidth property says:
One unit of column width is equal to the width of one character in the
Normal style. For proportional fonts, the width of the character 0
(zero) is used.
Use the Width property to return the width of a column in points.
As far as I can tell, “Normal style” means the standard font name and size at the time the workbook was created. Changing the standard font name and size for an existing workbook does not appear to have any effect. Changing the font name and size for a worksheet has no effect.
Two example displays for a standard width column are:
For Arial 10 Width: 8.43 (64 pixels)
For Tahoma 10.5 Width: 8.38 (72 pixels)
I have created a string of zeros and attempted to measure how many are visible depending on the width of the column. I found the number of zeroes that I could see matched the value displayed reasonably well for such as subjective measure.
With VBA, the ColumnWidth property of a column or cell sets or returns the width in characters.
With VBA, The read only Width property of a column or cell returns .75 * the width in pixels.
The significance of the above information is that the width values obtained from Excel are not necessarily correct for the font being used.
My problem and the solution I discovered
The problem I had was that I was merging cells and filling them with text. Although Excel will adjust the height of a row so the text within an unmerged cell is visible, it will not do so for a merged cell. I tried many techniques including Microsoft’s .Net, text rendering routines without success. Nothing I tried would reliably emulate Excel’s system for determining the width of text.
The technique I eventually used successfully involved picking a cell to the right and below all used cells for experimental use. I adjusted the width of the experimental cell’s column to match the combined width of the merged cell and copied the formatted value from the cell whose height I wanted. Because the experimental cell was unmerged, Excel would adjust the height as appropriate. I then made sure the source row was at least this height.
The key feature of this technique was that I was not trying to emulate Excel’s system for determining the width of text; I was using Excel’s system.
You would need to try different column widths for the experimental cell. I would start with the current width of the source column. If the row height matches that for a single row, the width of the source column is already sufficient. If the row height is more than that for a single row, I would increase the column width until the row height matched that for a single row and then adjust the source column’s width to match. If you start with the widest value (in characters or Python’s text width) you will probably get the source column width correct at the first attempt which would avoid the need for later adjustments.

Identify subsequent event windows (or occurrences) for each individual

This question is in the context of twoway line with the by() option, but I think the bigger problem is how to identify a second (and all subsequent) event windows without a priori knowing every event window.
Below I generate some data with five countries over the 1990s and 2000s. In all countries an event occurs in 1995 and in Canada only the event repeats in 2005. I would like to plot outcome over the five years centered on each event in each country. If I do this using twoway line and by(), then Canada plots twice in the same plot window.
clear
set obs 100
generate year = 1990 + mod(_n, 20)
generate country = "United Kingdom" in 1/20
replace country = "United States" in 21/40
replace country = "Canada" in 41/60
replace country = "Australia" in 61/80
replace country = "New Zealand" in 81/100
generate event = (year == 1995) ///
| ((year == 2005) & (country == "Canada"))
generate time_to_event = 0 if (event == 1)
generate outcome = runiform()
encode country, generate(countryn)
xtset countryn year
forvalue i = 1/2 {
replace time_to_event = `i' if (l`i'.event == 1)
replace time_to_event = -`i' if (f`i'.event == 1)
}
twoway line outcome time_to_event, ///
by(country) name(orig, replace)
A manual solution adds an occurrence variable that numbers each event occurrence by country, then adds occurrence to the by() option.
generate occurrence = 1 if !missing(time_to_event)
replace occurrence = 2 if ///
(inrange(year, 2005 - 2, 2005 + 2) & (country == "Canada"))
twoway line outcome time_to_event, ///
by(country occurrence) name(attempt, replace)
This works great in the play data, but in my real data there are many more countries and many more events. I can manually code this occurrence variable, but that is tedious (and now I'm really curious if there's a tool or logic that works :) ).
Is there a logic to automate identifying windows? Or one that at least works with twoway line? Thanks!
You have generated a variable time_to_event which is -2 .. 2 in a window and missing otherwise. You can use tsspell from SSC, installed by
ssc inst tsspell
to label such windows. Windows are defined by spells or runs of observations all non-missing on that time_to_event:
tsspell, cond(time_to_event < .)
tsspell requires a prior tsset and generates three variables explained in its help. You can then renumber windows by using one of those variables _seq (sequence number within spell, numbered 1 up)
gen _spell2 = (_seq > 0) * sum(_seq == 1)
and then label spells distinctly by using country and the spell identifier for each spell from _spell, another variable produced by tsspell:
egen gspell = group(country _spell) if _spell2, label
My code assumes that windows are disjoint and cannot overlap, but that seems to be one of your assumptions too. Some technique for handling spells is given by http://www.stata-journal.com/sjpdf.html?articlenum=dm0029 That article does not mention tsspell, which in essence is an implementation of its principles. I started explaining the principles, but the article got long enough before I could explain the program. As the help of tsspell is quite detailed, I doubt that a sequel paper is needed, or at least that it will be written.
(LATER) This code also assumes that windows don't touch. Solving that problem suggests a more direct approach not involving tsspell at all:
bysort country (year) : gen w_id = (time_to_event < .) * sum(time_to_event == -2)
egen w_label = group(country w_id) if w_id, label