I am using a class that contains macros with \newenvironment
and \renewcommand\item
. I have been struggling with the indentation, as in a normal \begin{itemize}
I have found simple solutions to eliminate it, but they don't seem to work in my case.
An important thing is that I have been searching for solutions that eliminate indentation locally , as in my document I have other lists that I want to preserve with standard indentation.
The class I am using is the following one (in \newenvironment{educationlist}
is where I want to eliminate indentation) :
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{tccv}
[2012/11/09 v1.0
Two Column Curriculum Vitae]
\LoadClass[10pt]{scrartcl}
\setcounter{secnumdepth}{-1}
\RequirePackage[hmargin=1.25cm,vmargin=1.25cm,twocolumn,columnsep=1.25cm]{geometry}
\RequirePackage{bookman,etoolbox,hyperref,needspace,tabularx,xcolor,fontawesome,makecell,graphicx}
% Capitalize words of at least a minimum length (default to 3 chars).
% The text is capitalized before being expanded.
%
% This macro uses Lua to do the job but fails gracefully (that is,
% return the text as is) if \directlua is not available.
%
% |[
% \ucwords[optional: miminum length]{text}
% ]|
\newcommand\ucwords[2][3]{%
% Fails gracefully if not in LuaLaTeX
\providecommand\directlua[1]{#2}%
\directlua{%
local minlen=tonumber("#1")
local src="\luaescapestring{\unexpanded{#2}}"
local dst={}
for w in src:gmatch('[^\string\%s]+') do
if w:len() >= minlen then w = w:sub(1,1):upper()..w:sub(2) end
table.insert(dst, w)
end
tex.print(dst)}}
\pagestyle{empty}
\setlength\parindent{0pt}
\color[HTML]{303030} % Default foreground color
\definecolor{link}{HTML}{506060} % Hyperlinks
\hypersetup{colorlinks,breaklinks,urlcolor=link,linkcolor=link}
\setkomafont{disposition}{\color[HTML]{0058B6}}
\setkomafont{section}{\scshape\Large\mdseries}
% Overrides the \section command to capitalize every
% word for cosmetic purposes and draws a rule under it.
\let\old@section\section
\renewcommand\section[2][]{%
\old@section[#1]{\ucwords{#2}}%
\newdimen\raising%
\raising=\dimexpr-0.7\baselineskip\relax%
\vskip\raising\hrule height 0.4pt\vskip-\raising}
% Allow conditionals based on the job name. This can usually be set
% from a command-line argument: check fausto.en.tex for an example.
%
% |[
% \ifjob{jobname}{content if matches}{content if does not match}
% ]|
\newcommand\ifjob[3]{%
\edef\JOBNAME{\jobname}%
\edef\PIVOT{\detokenize{#1}}%
\ifdefstrequal{\JOBNAME}{\PIVOT}{#2}{#3}%
}
% Use only \item inside this environment: no other macros
% are allowed:
%
% |[
% \item[optional: what has been achieved]{years}{subject}{notes}
% ]|
\newenvironment{educationlist}{%
\renewcommand\item[4][]{%
{\bfseries ##3} & {\raggedleft\scshape ##2} \\
\ifstrempty{##1}{}{\multicolumn{2}{l}{\begin{minipage}{0.45\textwidth}\scshape ##1\end{minipage}} \smallskip\\}
\multicolumn{2}{l}{\begin{minipage}{0.45\textwidth}\itshape ##4\end{minipage}}\medskip\\}
\tabularx{\linewidth}{X r}}
{\endtabularx}
% Use only \item inside this environment: no other macros
% are allowed:
%
% |[
% \item{fact}{description}
% ]|
\newenvironment{factlist}{%
\newdimen\unbaseline
\unbaseline=\dimexpr-\baselinestretch\baselineskip\relax
\renewcommand\item[2]{%
\textsc{##1} & {\raggedright ##2\medskip\\}\\[\unbaseline]}
\tabularx{\linewidth}{rX}}
{\endtabularx}
The Latex document:
\documentclass{tccv}
\usepackage[english]{babel}
\usepackage{fontawesome}
\usepackage[gen]{eurosym}
\begin{document}
\section{Education}
\begin{educationlist}
\item[High school diploma]{1988 -- 1992}
{Informatic engineer}
{ITIS Castelli, Brescia}
\item{1987 -- 1988}
{Classical gymnasium}
{Seminario vescovile, Cremona}
\end{educationlist}
\section{Languages}
\begin{factlist}
\item{Spanish}{Native speaker}
\item{English}{Level C2}
\item{French}{Level C1}
\end{factlist}
\end{document}
The result (as you can see, the Education section has an indent that I want to eliminate while preserving the one of Languages):
Thanks in advance!
Best Answer
Here is a modified class, under the name
mytccv.cls
. The indents came from\tabcolsep
on the left side of thetabular
used in the redefinition of\item
. Also I took the liberty to colour the lines under the section titles (same as font):and the LaTeX code: