From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: Re: exporting code blocks with continued line numbers? Date: Tue, 8 Jan 2019 12:31:17 -0500 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000003d7fad057ef5b7bb" Return-path: Received: from eggs.gnu.org ([209.51.188.92]:48488) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ggvE3-0002Mt-J9 for emacs-orgmode@gnu.org; Tue, 08 Jan 2019 12:31:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ggvE0-0001HZ-Hz for emacs-orgmode@gnu.org; Tue, 08 Jan 2019 12:31:38 -0500 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]:43256) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ggvDy-00014b-D4 for emacs-orgmode@gnu.org; Tue, 08 Jan 2019 12:31:34 -0500 Received: by mail-wr1-x435.google.com with SMTP id r10so4870079wrs.10 for ; Tue, 08 Jan 2019 09:31:31 -0800 (PST) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: org-mode-email --0000000000003d7fad057ef5b7bb Content-Type: text/plain; charset="UTF-8" Answering my own question: (add-to-list 'org-latex-minted-options '("firstnumber" "last")) seems to do it. For per block continuation you can use: #+attr_latex: :options firstnumber=last John ----------------------------------- Professor John Kitchin Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803 @johnkitchin http://kitchingroup.cheme.cmu.edu On Tue, Jan 8, 2019 at 11:40 AM John Kitchin wrote: > Hi all, > > In the following example document: > > #+BEGIN_SRC python -r +n > #!/bin/env python (ref:bang) > print() (ref:print) > #+END_SRC > > Next, you need to modify line [[(filename)]] to point to the Excel sheet > you have saved the data in, line [[(sheet)]] with an integer for the sheet > number for the data (index starts at 1), and line [[(range)]] with the > range for the data. > > #+BEGIN_SRC python -r +n > filename = 'Copper_Samples' (ref:filename) > sheet = 6 (ref:sheet) > Tstar1 = xlsread(filename, sheet, 'A2:E29') (ref:range) > #+END_SRC > > When I export this to LaTeX, the line numbers to the coderefs in the text > are correct, but the line numbers in each code block start at 1. I am > using minted for the export. Is there an option that will tell minted to > continue the line numbers from the previous block? > > Thanks, > > John > > ----------------------------------- > Professor John Kitchin > Doherty Hall A207F > Department of Chemical Engineering > Carnegie Mellon University > Pittsburgh, PA 15213 > 412-268-7803 > @johnkitchin > http://kitchingroup.cheme.cmu.edu > > --0000000000003d7fad057ef5b7bb Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Answering my own questio= n:=C2=A0

(add-to-list 'org-latex-minted-options '= ;("firstnumber" "last")) seems to do it.

=
For per block continuation you can use:

#+attr_latex: :options firstnumber=3Dlast


John

-------------= ----------------------
Professor John Kitchin=C2=A0
Doherty Hall A207= F
Department of Chemical Engineering
Carnegie Mellon University
Pi= ttsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchi= ngroup.cheme.cmu.edu



On Tue, Jan = 8, 2019 at 11:40 AM John Kitchin <jkitchin@andrew.cmu.edu> wrote:
Hi all,

In the following example document:

#+BEGIN_SRC python -r +n
#!/bin/env python = (ref:bang)
print()=C2=A0 (ref:print)
#+END_SRC

Next, you need to modify line [[(filename)]] to point to t= he Excel sheet you have saved the data in, line [[(sheet)]] with an integer= for the sheet number for the data (index starts at 1), and line [[(range)]= ] with the range for the data.

#+BEGIN_SRC python = -r +n
filename =3D 'Copper_Samples' (ref:filename)
<= div>sheet =3D 6 (ref:sheet)
Tstar1 =3D xlsread(filename, sheet, &= #39;A2:E29')=C2=A0 (ref:range)
#+END_SRC

=
When I export this to LaTeX, the line numbers to the coderefs in the t= ext are correct, but the line numbers in each code block start at 1.=C2=A0 = I am using minted for the export. Is there an option that will tell minted = to continue the line numbers from the previous block?

<= div>Thanks,

John

-----------------------------------
P= rofessor John Kitchin=C2=A0
Doherty Hall A207F
Department of Chemical= Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-2= 68-7803
--0000000000003d7fad057ef5b7bb--