Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

The TikZ picture is not aligned with the main content of the document. It slightly shifts to the right. Notice how the words go outside the frame on the right side.

Any hints on how to correct this behavior and have the TikZ object properly aligned with the rest of the document?

\documentclass[a4paper]{article}
\usepackage[a4paper,top=2cm,bottom=2cm,showframe]{geometry}
\usepackage{tikz}
\usetikzlibrary{matrix,positioning}
\pagestyle{empty}
\setlength\parindent{0em}

\begin{document}
Classical Latin slowly changed with the Decline of the Roman Empire, as education and wealth became ever scarcer. The consequent Medieval Latin, influenced by various Germanic and proto-Romance languages until expurgated by Renaissance scholars, was used as the language of international communication, scholarship, and science until well into the 18th century, when it began to be supplanted by vernacular languages.

\bigskip

\begin{tikzpicture}
  \matrix[matrix of nodes, row sep=0.4em,
    column 1/.style={nodes={text width=0.2\textwidth, align=flush left}},
    column 2/.style={nodes={text width=0.8\textwidth, align=flush left}},
    Title43/.style={font=\large\textsc{#1}}] {
    % BLAH BLAH
    |[Title43={Heading 1}]| & \\
    {tralala} & {Classical Latin slowly changed with the Decline of the Roman Empire, as education and wealth became ever scarcer. The consequent Medieval Latin, influenced by various Germanic and proto-Romance languages until expurgated by Renaissance scholars, was used as the language of international communication, scholarship, and science until well into the 18th century, when it began to be supplanted by vernacular languages.} \\
    {tralala} & {lo lo lo lo lo l ooooo ooo oo o ooooooo\\o oooooooooo oooooooo ooooo oo o.} \\
    [1em]% BLAH BLAH 2
    |[Title43={Heading 2}]| & \\
    {tralala} & {lo lo lo lo lo l ooooo ooo oo o ooooooo\\o oooooooooo oooooooo ooooo oo o.} \\
    & {lo lo lo lo lo l ooooo ooo oo o ooooooo\\o oooooooooo oooooooo ooooo oo o.} \\
    {} & {lo lo lo lo lo l ooooo ooo oo o ooooooo\\o oooooooooo oooooooo ooooo oo o.} \\
    {tralala} & {lo lo lo lo lo l ooooo ooo oo o ooooooo\\o oooooooooo oooooooo ooooo oo o end.} \\
  };
\end{tikzpicture}

asdasd asd asd as as asd\\
asdassa asdas dasdasd\\
dasdasdsadasd\\
dasdasdasdasdasd
asdasdas
das
dasdasdasdsadasdas sadas ddasdasdasdsadasdas sadas ddasdasdasdsadasdas sadas ddasdasdasdsadasdas sadas ddasdasdasdsadasdas sadas ddasdasdasdsadasdas sadas ddasdasdasdsadasdas sadas ddasdasdasdsadasdas sadas ddasdasdasdsadasdas sadas ddasdasdasdsadasdas sadas ddasdasdasdsadasdas sadas ddasdasdasdsadasdas sadas ddasdasdasdsadasdas sadas ddasdasdasdsadasdas sadas ddasdasdasdsadasdas sadas ddasdasdasdsadasdas sadas ddasdasdasdsadasdas sadas ddasdasdasdsadasdas sadas ddasdasdasdsadasdas sadas ddasdasdasdsadasdas sadas ddasdasdasdsadasdas sadas ddasdasdasdsadasdas sadas ddasdasdasdsadasdas sadas d ddasdasdasdsadasdas sadas d ddasdasdasdsadasdas sadas d ddasdasdasdsadasdas sadas d ddasdasdasdsadasdas sadas d ddasdasdasdsadasdas sadas d ddasdasdasdsadasdas sadas d ddasdasdasdsadasdas sadas d ddasdasdasdsadasdas sadas d ddasdasdasdsadasdas sadas d ddasdasdasdsadasdas sadas d ddasdasdasdsadasdas sadas d ddasdasdasdsadasdas sadas d ddasdasdasdsadasdas sadas d ddasdasdasdsadasdas sadas d ddasdasdasdsadasdas sadas d ddasdasdasdsadasdas sadas d ddasdasdasdsadasdas sadas d ddasdasdasdsadasdas sadas d ddasdasdasdsadasdas sadas d ddasdasdasdsadasdas sadas d ddasdasdasdsadasdas sadas d ddasdasdasdsadasdas sadas d ddasdasdasdsadasdas sadas d ddasdasdasdsadasdas sadas d ddasdasdasdsadasdas sadas d ddasdasdasdsadasdas sadas d ddasdasdasdsadasdas sadas d ddasdasdasdsadasdas sadas d ddasdasdasdsadasdas sadas d ddasdasdasdsadasdas sadas d ddasdasdasdsadasdas sadas d ddasdasdasdsadasdas sadas d ddasdasdasdsadasdas sadas d ddasdasdasdsadasdas sadas d ddasdasdasdsadasdas sadas d ddasdasdasdsadasdas sadas d ddasdasdasdsadasdas sadas d ddasdasdasdsadasdas sadas d ddasdasdasdsadasdas sadas d ddasdasdasdsadasdas sadas d ddasdasdasdsadasdas sadas d ddasdasdasdsadasdas sadas d ddasdasdasdsadasdas sadas d ddasdasdasdsadasdas sadas d ddasdasdasdsadasdas sadas d ddasdasdasdsadasdas sadas d ddasdasdasdsadasdas sadas d ddasdasdasdsadasdas sadas d ddasdasdasdsadasdas sadas d ddasdasdasdsadasdas sadas d ddasdasdasdsadasdas sadas d ddasdasdasdsadasdas sadas d ddasdasdasdsadasdas sadas d ddasdasdasdsadasdas sadas d ddasdasdasdsadasdas sadas d ddasdasdasdsadasdas sadas d ddasdasdasdsadasdas sadas d ddasdasdasdsadasdas sadas d ddasdasdasdsadasdas sadas d ddasdasdasdsadasdas sadas d ddasdasdasdsadasdas sadas d
\end{document}

Solved by adding inner sep=0em to the matrix.

share|improve this question
    
BTW, how can I show the actual document print/image? I only know how to post the code. –  Daniel Apr 30 '13 at 8:52
    
I've been going over the code over and over again and only noticed the problem after posting it here. Adding inner sep=0em in the matrix pre-code solves the problem. (I'll leave the post just in case someone bumps into the same problem.) –  Daniel Apr 30 '13 at 9:03
3  
You should post that as an answer (you can answer your own questions) and accept it. That way, the question will be marked answered in the list and it will be clear what the answer is –  Mythio Apr 30 '13 at 9:07
1  
@Daniel To post images, you may want to click on the image button along with the button that looks like {}. And, if SX complains that you don't have enough rep, simply remove ! in the line where the image link is added. –  kan Apr 30 '13 at 9:16

1 Answer 1

up vote 1 down vote accepted

Solved by adding inner sep=0em to the matrix.

\matrix[matrix of nodes, row sep=0.4em,inner sep=0em,
...

See the generated PDF.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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