1

When I compile

\documentclass[a4paper]{article}
\usepackage[a4paper, left=5mm, right=5mm, top=4mm]{geometry}

\begin{document}

\noindent\hfil\rule[0mm]{200mm}{.1pt}\hfil
\leftskip4em\rule{.1pt}{150mm}{}

\end{document}

I get enter image description here

where the horizontal line and the vertical line are connected, as I want. When I introduce a multicols environment in order to may write text at the right of the vertical column and I compile it

\documentclass[a4paper]{article}
\usepackage[a4paper, left=5mm, right=5mm, top=4mm]{geometry}
\usepackage{multicol}
\setlength{\columnsep}{-17cm}

\begin{document}

\noindent\hfil\rule[0mm]{200mm}{.1pt}\hfil

\begin{multicols}{2}

\leftskip4em\rule{.1pt}{150mm}{}

\columnbreak
\textbf{Lorem ipsum}

\end{multicols}

\end{document}

I get enter image description here

so the horizontal line and the vertical line become disconnected.

How can I solve this issue? Is it possible I open \begin{multicols} without adding the space between the horizontal and the vertical line? Or may I write Lorem ipsum text at the right of the vertical line placed as it is without using multicols and having this issue?

Thank you!

PS: If I do (as suggested for text at first column of page 3 of https://ctan.javinator9889.com/macros/latex/required/tools/multicol.pdf)

\documentclass[a4paper]{article}
\usepackage[a4paper, left=5mm, right=5mm, top=4mm]{geometry}
\usepackage{multicol}
\setlength{\columnsep}{-17cm}

\begin{document}



\begin{multicols}{2}
[
\noindent\hfil\rule[0mm]{200mm}{.1pt}\hfil
]

\leftskip4em\rule{.1pt}{150mm}{}

\columnbreak
\textbf{Lorem ipsum}

\end{multicols}

\end{document}

I get an error:

Paragraph ended before \@rule was complete. [\noindent\rule[0mm]{
3
  • I understand your specific issue, but maybe it would be helpful to explain in more detail what you are ultimately trying to achieve. Do you want the lines to be in your final document or are they just here to illustrate the vertical space? If you want the lines, how flexible are you in terms of implementation?
    – Markus G.
    Aug 12, 2021 at 22:59
  • In my point of view the two rules are not blocked. When you write something the two rules separate. It would take a node or create a minipage for the part where you will write the text. I think that the two rules should not separated.
    – Sebastiano
    Aug 12, 2021 at 23:04
  • @MarkusG. Yes I want the lines in my final document. In fact I want a centered horizontal line for which I could specify with all details its position (height, horizontal margins) and a perpendicular vertical line for which I also could fully specify its position (horizontal marging, height, touching the horizontal line in just one point). The same for the text, I would like to specify its position as much as possible.
    – iago
    Aug 14, 2021 at 10:32

1 Answer 1

1

See, if the following solution gives what you like to achieve:

\documentclass[a4paper]{article}
\usepackage[a4paper, left=5mm, right=5mm, top=4mm]{geometry}
\usepackage{multicol}

\begin{document}

\noindent\hfill\rule{200mm}{.1pt}\hfill
\hspace*{4em}\rule{.1pt}{150mm}

\vspace{-150mm}
\leftskip 4em \begin{multicols}{2}
\textbf{Lorem ipsum}

\columnbreak
\textbf{Lorem ipsum}

\end{multicols}

\end{document}

enter image description here

Edit: Means of used instructions/commands in above MWE are:

  • Space \hspace{<distance>} add horizontal space after some previous object. If there is no object (for example, just text border) than you need to use `\hspace*{} for inserting space before following object.
  • Space \vspace{<distance>}, has the same features, but in vertical direction
  • \hspace*{4em}\rule{.1pt}{150mm} draw vertical rule with height 150 mm in distance of 4em from left text border. It also introduce vertical space of this amount.
  • \leftskip is TeX primitive which determine distance of paragraph from the left text border.
  • Command \vspace before multicolumn move start of the multicolumn above for length of vertical rule

This solution is quite rude. Unfortunately, it is not clear, what intention of this rules. Better (more consistent) result probably can be achieved for example by use of tcolorbox with defined top and left border line only.

4
  • Thanks @Zarko. In this way I have no need to use multicols anymore. Could you add to your answer what are we doing by means of the lines \hspace*{4em}\rule{.1pt}{150mm} and \vspace*{-150mm}, that is, what do they mean?
    – iago
    Aug 14, 2021 at 10:28
  • @iago, \hspace*{4em} insert horizontal space of size 4em from text border. By this start of rule is moved to the right. You should clarify what actually your problem. Rules can be added to text on different ways.
    – Zarko
    Aug 14, 2021 at 10:58
  • You have solved my problem (look at my comment above to MarkusG). I just wanted the answer explained. What are you doing by means of \vspace*? I ask because if I remove it, text position becomes placed under the vertical line. (you may better add explanation in answer instead of comments) Thanks!
    – iago
    Aug 14, 2021 at 11:19
  • @iago, I only follow instruction in your code MWE and some your commands for space replace with LaTeX version. Frankly said, I do not understand, what you like to achieve. I will add explanation of used commands ASAP.
    – Zarko
    Aug 14, 2021 at 13:08

You must log in to answer this question.

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