TransWikia.com

Is this achieved with a list?

TeX - LaTeX Asked on December 27, 2020

I am new to LaTex. I want to generate the code as shown below. But I don’t know how to achieve it? It does not seem to be a pseudo-code implementation method. The above marked this is a list, but the form of the list I know is 1. 2. 3.. How can I implement such a code? How to add the outer box and the text on it?
enter image description here

I used the two-column format. The command setlengthcolumnsep{0.25cm} sets the column spacing to 0.25. When I used listing, the result now is:

enter image description here
The numbers cover the text in the left column. In the top picture, the code is closer to the middle.

I used a thesis template. The address of the template is: https://www.microarch.org/micro53/submit/micro53-latex-template.zip
Thank you very much

The following is part of the template. This template generates a two-column format. But I did not find the setting in the code. The list generated by the following code will cover the left column.

 documentclass{sig-alternate}
usepackage{mathptmx} % This is Times font

usepackage{fancyhdr}
usepackage[normalem]{ulem}
usepackage[hyphens]{url}
usepackage[sort,nocompress]{cite}
usepackage[final]{microtype}
usepackage[keeplastbox]{flushend}
% Always include hyperref last
usepackage[bookmarks=true,breaklinks=true,letterpaper=true,colorlinks,linkcolor=black,citecolor=blue,urlcolor=black]{hyperref}

% Ensure letter paper
pdfpagewidth=8.5in
pdfpageheight=11in

%%%%%%%%%%%---SETME-----%%%%%%%%%%%%%
newcommand{microsubmissionnumber}{XXX}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

fancypagestyle{firstpage}{
  fancyhf{}
  renewcommand{headrulewidth}{0pt}
  fancyhead[C]{vspace{15pt}normalsize{MICRO 2020 Submission
      textbf{#microsubmissionnumber} -- Confidential Draft -- Do NOT Distribute!!}} 
  fancyfoot[C]{thepage}
}

usepackage{listings}

lstset{
    basicstyle = ttfamily,
    numbers = left,
    numberstyle = footnotesize,
    frame=lrtb
}
%set margin
%usepackage{geometry}
%newgeometry{left=0.75in,right=0.75in,top=1in,bottom=1in}
setlengthcolumnsep{0.25cm}

pagenumbering{arabic}

%%%%%%%%%%%---SETME-----%%%%%%%%%%%%%
title{Guidelines for Submission to MICRO 2020} 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

begin{document}
maketitle
thispagestyle{firstpage}
pagestyle{plain}




%%%%%% -- PAPER CONTENT STARTS-- %%%%%%%%

begin{abstract}

    This document is intended to serve as a sample for submissions to the 53rd International Symposium on Microarchitecture~{textregistered} (MICRO 2020). We provide some guidelines that authors should follow when submitting papers to the conference.  This format is derived from the ACM sig-alternate.cls file, and is used with an objective of keeping the submission version similar to the camera-ready version.

end{abstract}

section{Introduction}

This document provides instructions for submitting papers to the 53rd International Symposium on Microarchitecture~{textregistered} (MICRO 2020).  In an effort to respect the efforts of reviewers and in the interest of fairness to all prospective authors, we request that all submissions to MICRO 2020 follow the formatting and submission rules detailed below. Submissions that violate these instructions may not be reviewed, at the discretion of the program chairs, in order to maintain a review process that is fair to all potential authors. This document is itself formatted using the MICRO 2020 submission format. The content of this document mirrors that of the submission instructions that appear on the conference website. All questions regarding paper formatting and submission should be directed to the program chairs.





section{Paper Preparation Instructions}

subsection{Paper Formatting}


begin{lstlisting}
lfence
rdtsc
mov %eax, %edi
mov (%r8), %r8
mov (%r8), %r8
mov (%r8), %r8
mov (%r8), %r8
mov (%r8), %r8
mov (%r8), %r8
mov (%r8), %r8
mov (%r8), %r8
mov (%r8), %r8
mov (%r8), %r8
mov (%r8), %r8
mov (%r8), %r8
lfence
rdtsc
sub %edi, %eax
end{lstlisting}



end{document}

One Answer

Use listings. The following is a start:

enter image description here

documentclass{article}

usepackage{listings}

lstset{
  basicstyle = ttfamily,
  numbers = left,
  numberstyle = footnotesize,
  frame=lrtb
}

begin{document}

begin{lstlisting}[caption = Code for probing one 12-way cache set]
    lfence
    rdtsc
    mov %eax, %edi
    mov (%r8), %r8
    mov (%r8), %r8
    mov (%r8), %r8
    mov (%r8), %r8
    mov (%r8), %r8
    mov (%r8), %r8
    mov (%r8), %r8
    mov (%r8), %r8
    mov (%r8), %r8
    mov (%r8), %r8
    mov (%r8), %r8
    mov (%r8), %r8
    lfence
    rdtsc
    sub %edi, %eax
end{lstlisting}

end{document}

Answered by Werner on December 27, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP