1

I want to divide equally 2 sections of text, putting a vertical line between the two sections in the same page. How can I do this?

I have tried with the command \vrule, but I encountered some difficulties. The vertical line should be centered, with one portion of text on the left of the line, and the other portion of text on the right of the line.

PS. It is for a translation. The source text should be on one side, and the translated text on the other side. The lenghts should be equal.

  • Please describe your desired setup in more detail. E.g., are the two "sections" of equal length, or do they have different lengths? If it's the latter, are you looking to adjust the two column widths so that the sections end up occupying the same amount of vertical space? Put differently, what exactly does "divide equally" entail? Please advise. – Mico Feb 27 '18 at 21:04
  • 1
    Are you in twocolumn or using multicols? Do you know how wide to make the text using minipages? – John Kormylo Feb 27 '18 at 21:04
  • 1
    in both the standard twocolumn mode and multicols package drawing a rule between the columns is a standard built in feature, but impossible to tell from your question what your input looks like – David Carlisle Feb 27 '18 at 21:06
  • PS. It is for a translation. The source text should be on one side, and the translated text on the other side. The lengths should be equal. – Always learning Feb 27 '18 at 21:21
4

There are several possibilities to achieve a vertical line separating two columns of text. The following MWE shows two of them:

\documentclass{article}
\usepackage{multicol}
\usepackage{lipsum}
\setlength{\columnseprule}{0.4pt}
\usepackage{tabularx}
\begin{document}
\lipsum[1]
\begin{multicols}{2}
\lipsum[1]
\end{multicols}

\noindent\begin{tabularx}{\textwidth}{@{}X|X@{}}
\lipsum[2] & \lipsum[2]
\end{tabularx}
\end{document}

The first example uses the multicol packge and its \columnseprule to set up two columns that are automatically separated by a vertical line. In this example the text is automatically equally distributed between the two columns.

The second example uses tabularx. Here you have to distribute the contents yourself.

enter image description here

To print a text in two langugages in two columns, you might also be interested in the paracol package as shown in the below MWE. You can use the switchcolumn command to insert the follwing text into the other column. Using the starred variant, you can synchronize columns to let paragraphs in both columns start in the same line. Additionally, the paracol environment can spread over several pages.

\documentclass{article}
\usepackage{lipsum}
\usepackage{paracol}
\setlength{\columnseprule}{0.4pt}
\setlength{\columnsep}{3em}

\begin{document}

\begin{paracol}{2}
\lipsum[1]
\switchcolumn
\lipsum[2]
\switchcolumn*
\lipsum[4]
\switchcolumn
\lipsum[3]
\end{paracol}

\end{document}
  • @CarLaTeX: You are right. Thanks for reminding me. – leandriis Feb 27 '18 at 21:14
  • PS. It is for a translation. The source text should be on one side, and the translated text on the other side. The lengths should be equal. – Always learning Feb 27 '18 at 21:21
  • @Alwayslearning: I have added another MWE using the paracol package which might be better suited for your translation porpose. – leandriis Feb 27 '18 at 21:52
3

You can use paracol:

\documentclass{article}
\usepackage{geometry}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[italian,english]{babel}
\usepackage{paracol}
\usepackage{microtype}

\setlength{\columnseprule}{0.2pt}

\begin{document}

\begin{paracol}{2}
As any dedicated reader can clearly see, the Ideal of 
practical reason is a representation of, as far as I know, 
the things in themselves; as I have shown elsewhere, the 
phenomena should only be used as a canon for our 
understanding. The paralogisms of practical reason are 
what first give rise to the architectonic of practical 
reason. As will easily be shown in the next section, 
reason would thereby be made to contradict, in view of 
these considerations, the Ideal of practical reason, 
yet the manifold depends on the phenomena. Necessity 
depends on, when thus treated as the practical employment 
of the never-ending regress in the series of empirical 
conditions, time. Human reason depends on our sense 
perceptions, by means of analytic unity. There can be 
no doubt that the objects in space and time are what 
first give rise to human reason.

\switchcolumn
\selectlanguage{italian}

Come ogni lettore dedicato può vedere chiaramente, 
l'Ideale della ragione pratica è una rappresentazione, 
per quanto ne so, delle cose in sé; come ho dimostrato 
altrove, i fenomeni dovrebbero essere usati solo come 
canone per la nostra comprensione. I paralogismi della 
ragione pratica sono quelli che per primi danno origine 
all'architettura della ragione pratica. Come sarà 
facilmente mostrato nella prossima sezione, la ragione 
sarebbe così in contraddizione, alla luce di queste 
considerazioni, l'Ideale della ragione pratica, ma il 
molteplice dipende dai fenomeni. La necessità dipende, 
se così trattata come l'impiego pratico del regresso 
infinito nella serie di condizioni empiriche, dal tempo. 
La ragione umana dipende dalle nostre percezioni sensoriali, 
per mezzo dell'unità analitica. Non c'è dubbio che gli 
oggetti nello spazio e nel tempo siano ciò che per primo 
dà origine alla ragione umana.
\end{paracol}

\bigskip

\columnratio{0.49}
\begin{paracol}{2}
As any dedicated reader can clearly see, the Ideal of 
practical reason is a representation of, as far as I know, 
the things in themselves; as I have shown elsewhere, the 
phenomena should only be used as a canon for our 
understanding. The paralogisms of practical reason are 
what first give rise to the architectonic of practical 
reason. As will easily be shown in the next section, 
reason would thereby be made to contradict, in view of 
these considerations, the Ideal of practical reason, 
yet the manifold depends on the phenomena. Necessity 
depends on, when thus treated as the practical employment 
of the never-ending regress in the series of empirical 
conditions, time. Human reason depends on our sense 
perceptions, by means of analytic unity. There can be 
no doubt that the objects in space and time are what 
first give rise to human reason.

\switchcolumn
\selectlanguage{italian}

Come ogni lettore dedicato può vedere chiaramente, 
l'Ideale della ragione pratica è una rappresentazione, 
per quanto ne so, delle cose in sé; come ho dimostrato 
altrove, i fenomeni dovrebbero essere usati solo come 
canone per la nostra comprensione. I paralogismi della 
ragione pratica sono quelli che per primi danno origine 
all'architettura della ragione pratica. Come sarà 
facilmente mostrato nella prossima sezione, la ragione 
sarebbe così in contraddizione, alla luce di queste 
considerazioni, l'Ideale della ragione pratica, ma il 
molteplice dipende dai fenomeni. La necessità dipende, 
se così trattata come l'impiego pratico del regresso 
infinito nella serie di condizioni empiriche, dal tempo. 
La ragione umana dipende dalle nostre percezioni sensoriali, 
per mezzo dell'unità analitica. Non c'è dubbio che gli 
oggetti nello spazio e nel tempo siano ciò che per primo 
dà origine alla ragione umana.
\end{paracol}

\end{document}

English text courtesy of kantlipsum, translation by https://www.deepl.com/Translator

enter image description here

  • @Dr.ManuelKuehner Never used, actually. ;-) – egreg Feb 27 '18 at 22:22
  • Thanks! @egreg I will look at it tomorrow! (Going to sleep now) – Always learning Feb 27 '18 at 23:25
  • Are geometry and microtype necessary packages? @egreg – Always learning Feb 28 '18 at 12:27
  • @Alwayslearning No; I loaded geometry in order to have wider lines; microtype makes justification easier in narrow columns. – egreg Feb 28 '18 at 12:51
  • @egreg If I copy and paste your work, TexStudio does not compile properly (it does not show the pdf) and it gives this error: "! pdfTeX error (font expansion): auto expansion is only possible with scalable fonts." Instead, if I don't use the other two packages, it does not appear the vertical line. – Always learning Feb 28 '18 at 13:00
1

Would you like to achieve something like this?

\documentclass[twocolumn]{article}
\usepackage{lipsum}


\begin{document}
    \setlength{\columnseprule}{0.4pt}
\lipsum
\end{document}

enter image description here

  • PS. It is for a translation. The source text should be on one side, and the translated text on the other side. The lengths should be equal. – Always learning Feb 27 '18 at 21:21
  • You can change the column. – Sigur Feb 27 '18 at 21:28

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.