I am using a template which uses a scrartcl based class. In this class I have two commands (\part and \personal) both using tabularx. I am trying to put as the second argument of \part, the box generated with the command \personal.

Putting the command as an argument is giving an error and also, when I added tabularx to the command \part, the text is no longer centered even though I specified \begin{center}.

Here is the class with all the commands:

              [2012/11/09 v1.0
 Two Column Curriculum Vitae]



% 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}
% ]|
    % Fails gracefully if not in LuaLaTeX
    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)

\color[HTML]{303030} % Default foreground color
\definecolor{link}{HTML}{506060} % Hyperlinks

% In tccv \part must contain the subject of the curriculum vitae.
% The command will start a new page and output in onecolumn the
% subject (first and last name) with the hardcoded text
% "Curriculum vitae" under it.
    \begin{tabularx}{\linewidth}{ r | l }
    {\usekomafont{part} #1} & {#2} %\medskip\\
    %{\fontfamily{pzc}\selectfont\Huge Curriculum vitae}

% Overrides the \section command to capitalize every
% word for cosmetic purposes and draws a rule under it.
    \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}
% ]|

% Renders a personal data box:
% |[
% \personal[optional: web site without scheme (no http:// prefix)]
%          {address}{phone number}{email}
% ]|
    \faMapMarker  & {#2}\smallskip\\
    \faPhone     & {#3}\smallskip\\
    \faEnvelope      & \href{mailto:#4}{#4}
    \ifstrempty{#1}{}{\smallskip\\ \faLinkedin & \href{http://www.#1}{#1}}

% Use only \item inside this environment: no other macros
% are allowed:
% |[
% \item{fact}{description}
% ]|
    \textsc{##1} & {\raggedright ##2\medskip\\}\\[\unbaseline]}

%% End of file `tccv.cls'.

And this is the latex document:



    {Address }
    {+33 654 32 10 98}


\item{Spanish}{Native speaker}
\item{English}{Level C2 }
\item{French}{Level C1 }

\section{Software skills}

Python $\bullet$ Java $\bullet$ JavaScript $\bullet$ Matlab $\bullet$ Android Studio $\bullet$ Microsoft Office $\bullet$ C $\bullet$ \LaTeX $\bullet$ Solid Edge $\bullet$ Altium $\bullet$ Arduino


So basically I would like to have the blue box replacing Here is where the box should go, as shown in image. Thanks in advance for your suggestions! enter image description here

EDIT: I have cleaned the code. When speaking of having the command \part centered, I mean that the Name is centered in the page (normally the layout is two-column so I would like only the Name|Box to be in the center of the page.

EDIT 2: I have change the latex document with what I wanted to achieve and gave me an error.

  • Can you remove the code which is not relevant to your question? What is the text of the error you get? Note that a tabularx requires at least one X-type column, that hyperref should be loaded late and that you need to box the stuff you put in the argument of \twocolumn, probably. – cfr Jun 19 '17 at 1:47
  • Don't use \makeatletter or \makeatother in a class or package file. And don't use \\ to break lines outside tabulars etc. – cfr Jun 19 '17 at 1:50
  • I have removed unnecessary code, why shouldn't I use \makeatletter and \makeatother in a class? Thanks in advance. – Juan Castillo Jun 19 '17 at 7:04
  • Well, @ is already a letter. When you say \makeatother you are setting the catcodes to something which is not standard for class and package files. That is, LaTeX expects (and other things you load expect) that @ is other here. So \makeatletter is pointless and \makeatother is wrong. – cfr Jun 19 '17 at 12:51

It isn't clear what you want centred.

Here are two much minimised versions.

\ProvidesClass{tccv} [2012/11/09 v1.0 Two Column Curriculum Vitae]




    \begin{tabularx}{\linewidth}{ r | >{\centering\arraybackslash}X }
      {\usekomafont{part} #1} & {#2}




\part{Name}{Here is where the box should go}


version 1

Note that all the center environment does here is add vertical space, since the tabular is \linewidth wide, so takes the whole line.

If you don't want that, you might want

version 2

    \begin{tabularx}{\linewidth}{ X | X }
      {\usekomafont{part} \hfill #1} & {#2}

More likely, you want neither version, but something more like the following.


      {\usekomafont{part}\hfill #1 \textbar\ }#2\hfill\bigskip\par]}
  • Many thanks for your suggestions, when I get back home I will try your solutions. Have you managed to replace the second argument with the box or it gives you an error? – Juan Castillo Jun 19 '17 at 7:06
  • @JuanCastillo No. I didn't understand your question well enough to figure out which box you meant and I didn't have an error message to provide a clue, either, so I just focussed on the centring bit. I didn't understand that either, but I could generate a number of possible interpretations. – cfr Jun 19 '17 at 12:54
  • Sorry if it wasn't clear, I will update the post with the errors I get when I get back home. As for the centering part, the last solution is the one I was looking for. I have changed the code to show the error I am getting. Thanks again for your help. – Juan Castillo Jun 19 '17 at 13:52
  • I have tried your second suggestion and it even fixes the other issue! Thanks! – Juan Castillo Jun 19 '17 at 19:11
  • @JuanCastillo Stroke of luck, I guess, since I certainly didn't design it to do what I didn't understand at the time :-). – cfr Jun 19 '17 at 22:24

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.