SHARE
TWEET

Untitled

a guest Jul 16th, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. \documentclass[uplatex,dvipdfmx]{jsarticle}
  2.  
  3. \usepackage{listings, jlisting}
  4. \usepackage{xcolor}
  5. \usepackage{graphicx}
  6.  
  7. \definecolor{lstkeywords}{HTML}{009600}
  8. \definecolor{lstcomments}{HTML}{000071}
  9. \definecolor{lststrings}{HTML}{a00000}
  10.  
  11. \newcounter{C}
  12. \newcounter{JAVA}
  13.  
  14. \makeatletter
  15. \lstnewenvironment{JAVA}[1]{
  16.   \renewcommand\lstlistingname{JAVA}
  17.   \let\c@lstlisting=\c@JAVA
  18.   \let\thelstlisting=\theJAVA
  19.   \lstset{
  20.     caption=#1,
  21.     language=JAVA,
  22.     breaklines=true,
  23.     captionpos=b,
  24.     basicstyle=\ttfamily\footnotesize,
  25.     frame=lines,
  26.     framesep=5pt,
  27.     keywordstyle=\color{lstkeywords},
  28.     commentstyle=\color{lstcomments},
  29.     stringstyle=\color{lststrings},
  30.     showstringspaces=false,
  31.     numbers=left,
  32.     stepnumber=1,
  33.     numberstyle=\tiny,
  34.     tabsize=2
  35.   }
  36. } {}
  37.  
  38. \lstnewenvironment{C}[1]{
  39.   \renewcommand\lstlistingname{C}
  40.   \let\c@lstlisting=\c@C
  41.   \let\thelstlisting=\theC
  42.   \lstset{
  43.     caption=#1,
  44.     language=C,
  45.     breaklines=true,
  46.     captionpos=b,
  47.     basicstyle=\ttfamily\footnotesize,
  48.     frame=lines,
  49.     framesep=5pt,
  50.     keywordstyle=\color{lstkeywords},
  51.     commentstyle=\color{lstcomments},
  52.     stringstyle=\color{lststrings},
  53.     showstringspaces=false,
  54.     numbers=left,
  55.     stepnumber=1,
  56.     numberstyle=\tiny,
  57.     tabsize=2
  58.   }
  59. } {}
  60. \makeatother
  61.  
  62. \begin{document}
  63.  
  64. \title{HOGE}
  65. \author{HOGE}
  66. \date{\today}
  67. \maketitle
  68.  
  69. \section{HOGE}
  70. \begin{C}{HOGE}
  71. HOGE
  72. \end{C}
  73.  
  74. \end{document}
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top