1

I want something as follows:

enter image description here

I tried it with $\hline$ and some text but getting some errors. I'm almost a beginner in LaTeX.

\documentclass[12pt]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{multicol}
\usepackage{url}
\usepackage{amsmath, amsfonts, amsthm}
\usepackage{amssymb}
\usepackage{color}
\usepackage{mdframed}
\usepackage{lipsum}
\setlength{\columnseprule}{1pt}
\def\columnseprulecolor{\color{black}}



\begin{document}
    Problem: \underline{\hspace{30pt}}
    \hfill
        Page \underline{\hspace{30pt}} of \underline{\hspace{30pt}}
    
    
    \noindent\rule{\textwidth}{1pt}
\end{document}

Any help is appreciated.

6
  • Welcome to TeX.SX! Please help us help you and add a minimal working example (MWE) that illustrates your problem. Reproducing the problem and finding out what the issue is will be much easier when we see compilable code, starting with \documentclass{...} and ending with \end{document}.
    – TobiBS
    Jul 25, 2020 at 14:04
  • @TobiBS Added my work. Those packages aren't really used, though
    – VIVID
    Jul 25, 2020 at 14:08
  • This may help u: tex.stackexchange.com/questions/19579/…
    – domperor
    Jul 25, 2020 at 14:09
  • 3
    Do you just want something like Problem: \underline{\hspace{30pt}} ? Jul 25, 2020 at 14:11
  • You can try also with a table.
    – Sebastiano
    Jul 25, 2020 at 15:17

1 Answer 1

2
    \documentclass{article}
\usepackage[tmargin=2cm,bmargin=2cm,rmargin=2cm,lmargin=2cm]{geometry}
\usepackage{amsmath}
\usepackage{fancyhdr} 
\pagestyle{fancy}
\fancyhf{}
\renewcommand{\headrulewidth}{1pt}
\rhead{}
\lhead{Problem : \underline{\hspace{30pt}} \\ Page \underline{\hspace{15pt}} of \underline{\hspace{15pt}}}
\cfoot{\thepage/\pageref{LastPage}}
\begin{document}
Problem 01: Evaluate the following integral : $$\int_1^e \left(\ln x\right)^2 dx$$
\end{document}

I used the fancyhdr package to write on the head of the page, and according to @lanThompson comment I used the following \underline{\hspace{30pt}}. enter image description here

As I said, I'm not satisfied with the blank space, meaning I don't know how to make that line, I used only the comment of @lanthompson!

2
  • Thank you! Could you please add the commands to remove the page number at the bottom? I really need this.
    – VIVID
    Jul 25, 2020 at 15:48
  • @VIVID All that you need to do is to replace \cfoot{\thepage/\pageref{LastPage}} with \cfoot{}
    – user209604
    Jul 25, 2020 at 17:36

You must log in to answer this question.

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