Create a vertical line in Latex

In summary, the author is seeking help in creating a vertical line in their resume using Latex. They have found a code for a horizontal line but are unsure of how to modify it for a vertical line. They have received suggestions to use special packages and have found one that works. The author shares the code they used for future reference.
  • #1
member 428835
Hi PF!

I am very new with Latex and was building a resume using a downloaded template. What I would like to do is create a vertical line down the page. Can anyone help?

The line of code that seems to create a horizontal line is:
\noindent\makebox[\linewidth]{\color{headings}\rule{\paperwidth}{0.4pt}} % Horizontal rule
Can anyone help me understand how to make a vertical one (and where I can place it)?

This is in a .cls file

Thanks!

Josh
 
Physics news on Phys.org
  • #3
What do you mean by trivial?

Thanks for the response!
 
  • #4
joshmccraney said:
What do you mean by trivial?
What I mean by "not trivial" is that having a vertical rule like that does not fit naturally in the way Latex does page processing. You thus have to use special packages that can take some time to master. In other words, a horizontal rule is easy, a verticle rule is hard.
 
  • #5
Does it matter that my document class is "resume"?
 
  • #6
joshmccraney said:
Does it matter that my document class is "resume"?
I don't know. You'll have to try a package and see how well it interacts with that class.
 
Last edited:
  • #7
Thanks a ton! I found one that works!
 
  • #8
joshmccraney said:
Thanks a ton! I found one that works!

If you care, or can, perhaps it might be something you can share, in case someone else is having the same question:)
 
  • #9
yea no problem! here it is:

\SetBgScale{1}% Thickness of rule
\SetBgAngle{0}% Sets rule angle
\SetBgColor{black}% Color
\SetBgContents{\rule{.4pt}{20cm}}% How long rule is going to be
\SetBgHshift{-3.3cm}% How far into page rule is placed

\begin{document}

hope this helps!
 
  • #10
joshmccraney said:
yea no problem! here it is:

\SetBgScale{1}% Thickness of rule
\SetBgAngle{0}% Sets rule angle
\SetBgColor{black}% Color
\SetBgContents{\rule{.4pt}{20cm}}% How long rule is going to be
\SetBgHshift{-3.3cm}% How far into page rule is placed

\begin{document}

hope this helps!
It will, thanks:)
 

1. How do I create a vertical line in Latex?

To create a vertical line in Latex, you can use the command \vrule followed by the desired width and height of the line. For example, \vrule width 1pt height 5cm will create a vertical line with a width of 1 point and a height of 5 centimeters.

2. Can I customize the color and style of the vertical line?

Yes, you can use the \color command to change the color of the line and the \linestyle command to change the style. For example, \vrule width 1pt height 5cm \color{red} \linestyle{dashed} will create a red, dashed vertical line.

3. How can I add a label or text next to the vertical line?

You can use the \vrule command inside a \parbox or \minipage environment to add text next to the line. For example, \parbox{2cm}{\vrule width 1pt height 5cm} Text next to the line will create a vertical line with the text "Text next to the line" next to it.

4. Is it possible to create multiple vertical lines at once?

Yes, you can use the \multicolumn command to create multiple vertical lines in a table or \rule command to create multiple lines in a document. For example, \multicolumn{3}{c}{\vrule width 1pt height 5cm} \rule{1pt}{5cm} will create two vertical lines, each with a width of 1 point and a height of 5 centimeters.

5. How can I align the vertical line with other elements in my document?

You can use the \raisebox command to adjust the vertical position of the line. For example, \raisebox{-2cm}{\vrule width 1pt height 5cm} will create a vertical line positioned 2 centimeters below its original position. You can also use the \centering command to center the line within a specific area.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
204
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
4K
Replies
15
Views
4K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
5K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
11
Views
4K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
3K
  • Programming and Computer Science
Replies
18
Views
1K
Back
Top