1

I am using the moderncv class to write my CV and I made some modifications in the style file to achieve a better layout. In order to achieve my aim I tinkered with the moderncvstyleclassic.sty file adding two minipages at the start of the CV to put name, address into one and the picture into the other. However, even when I use the commands \noindent etc. and carefully pick the table and minipage options the first line of the address is always indented. I really wonder what causes this, and although it can be fixed by brute force commands I am after a more elegant solution.

EDIT: Reduced the clutter in the moderncv and provided a MWE in the first of the following links. The second link contains the original files for the old version of this package. The third link contains the user edited file which is the style file.

The problem is that the first letter of the address line is indented as can be seen in the attached screenshot. I also commented the portion of the code I edited which is between the lines 143 and 155. To sum it up, I tried to use the \usebox command inside the minipage environment and created another minipage environment for the picture.

enter image description here

ModernCV Example with Address

ModernCV Package Link

ModernCV Edited Style File

1
  • 1
    It seems you are using a very old version (1.1) of moderncv. The current one is version 2.0.0! Please post not only code, explain what you changed (for example with adding comments in the code) and explain what you want to get. Perhaps the current version does what you want? As it stands now someone willing to help you has to guess to mutch. Please explain your problem better!
    – Mensch
    Aug 1, 2016 at 21:25

1 Answer 1

1

Because I have not the complete old version of the class of moderncv you use I ask you to test the following changing in your given class file moderncv.cls in line 306 ff:

\newcommand*{\makenewline}{%
  \if@firstdetailselement%
    \strut% to ensure baseline alignment, e.g. with when put in the margin vs sections that also contains a \strut
  \else%
    \\\fi%
  \@firstdetailselementfalse}

I added the missing % at the end of line 306. This missing % causes the adding of one blank sign you got.

With this changing I get the result you want:

enter image description here

Seems to be a little bug in this version ...

3
  • Thanks this remedy worked. Could you briefly explain why putting a comment character inhibits indention in that command and why this indention only takes place in the first line?
    – Vesnog
    Aug 2, 2016 at 13:09
  • 1
    @Vesnog Please have a look to question tex.stackexchange.com/questions/20577/… does that help you?
    – Mensch
    Aug 2, 2016 at 13:47
  • 1
    I think I understood it now. In my opinion the justification for this behavior is that the first line is executed in the upper part of the if statement -not the else part-, and therefore it indents. We have the missing % sign there.
    – Vesnog
    Aug 2, 2016 at 14:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .