From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Belohrad Subject: Re: a4paper to execute latex src block Date: Thu, 19 Dec 2013 10:41:05 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:48353) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vta6V-00085j-DX for emacs-orgmode@gnu.org; Thu, 19 Dec 2013 04:41:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vta6P-0001V3-7O for emacs-orgmode@gnu.org; Thu, 19 Dec 2013 04:41:15 -0500 Received: from static-212-101-19-163.adsl.solnet.ch ([212.101.19.163]:34363 helo=server.belohrad.ch) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vta6O-0001Ur-RO for emacs-orgmode@gnu.org; Thu, 19 Dec 2013 04:41:09 -0500 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: mailing-list-org-mode Fiddling a bit more I have achieved it, but it is solution for all src blocks. By redefining variable org-format-latex-header: (setq org-format-latex-header "\\documentclass[a4paper,12pt]{article} \\usepackage[usenames]{color} \\usepackage{amsmath} \\usepackage[mathscr]{eucal} \\usepackage{tikz} \\pagestyle{empty} \[PACKAGES] \[DEFAULT-PACKAGES] ") So I have removed settings which I don't need, and I ordered it to obligatory use a4paper and 12pt, which I use anyways. Still, how could I change this locally is not clear to me... .d. David Belohrad writes: > Dear All, > > I have following latex src block (see bellow), which I'd like to use to > generate box. When I press C-c C-c and execute the block, it does > exactly what is wanted, i.e. generates cps_fbct_box_btp10.pdf file with > some fancy graphics. The problem is, that I've found, that resulting PDF > graphics does not have expected dimensions. Tracing that back I've > found, that I have to use > > \documentclass[a4paper]{article} > > and not > > \documentclass{article} > > as is generated by execution of the src block. Now, I have tried > everything I know to generate tex file out of this thing, which would > modify the default (no) options to include a4 paper. Nothing works. > > This: > #+LaTeX_CLASS_OPTIONS: [a4paper,twoside,twocolumn] > in front of src block does not include these options into resulting Tex > file > > Adding 'second' document class in :headers does not work either as latex > is complaining that I have specified two classes. > > How can I setup the src block such, that it will generate for me in the > latex preamble article class with a4paper option? > > many thanks > > .d. > > > > > *** Prepare front panel to be sticked on each FBCT > Each FBCT is equipped with a sticker, which is sticked on the FR4 box > with connectors. This identifies which of the connectors is FBCT > output and which of them is calibration input. It adds information > about what FBCT is it and who is responsible (me). > > Script to generate it: > #+begin_src latex :file cps_fbct_box_btp10.pdf :headers '("\\usepackage{tikz}" "\\usepackage[top=5mm,bottom=5mm,left=5mm,right=5mm]{geometry}") > \newcommand{\fbct}{BTP-BCT10 (\#3044)} > \begin{tikzpicture}[thick] > \draw (0,0) -- (136mm,0) -- (136mm,80mm) -- (0,80mm) -- (0,0); > % two main holes > \draw (40mm,40mm) circle (8.5mm); > \draw (96mm,40mm) circle (8.5mm); > % screws around holes for first connector > \draw (30.85mm,30.85mm) circle (1.65mm); > \draw (49.15mm,30.85mm) circle (1.65mm); > \draw (30.85mm,49.15mm) circle (1.65mm); > \draw (49.15mm,49.15mm) circle (1.65mm); > % screws around holes for second connector > \draw (86.85mm,30.85mm) circle (1.65mm); > \draw (105.15mm,30.85mm) circle (1.65mm); > \draw (86.85mm,49.15mm) circle (1.65mm); > \draw (105.15mm,49.15mm) circle (1.65mm); > % holes around the box > \draw (4mm,4mm) circle (1.75mm); > \draw (132mm,4mm) circle (1.75mm); > \draw (132mm,76mm) circle (1.75mm); > \draw (4mm,76mm) circle (1.75mm); > % text messages > \node[color=red,text width=4cm,align=center] at (4cm,1.5cm) > {\LARGE\texttt{Calibration input}}; > \node[color=blue,text width=3cm,align=center] at (96mm,1.5cm) > {\LARGE\texttt{FBCT output}}; > \node[color=black,text width=120mm,align=center] at (68mm,7cm) > {\Huge \texttt{\textbf{\fbct}}}; > \node[color=black,text width=120mm,align=center] at (68mm,6.3cm) > {Resp: \textbf{David Belohrad} (\Email\hspace{1mm}david.belohrad@cern.ch\hspace{2mm}\Mobilefone\hspace{1mm}163455)}; > \end{tikzpicture} > > #+end_src > > #+RESULTS: > #+BEGIN_LaTeX > [[file:cps_fbct_box_btp10.pdf]] > #+END_LaTeX