emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* a4paper to execute latex src block
@ 2013-12-19  9:00 David Belohrad
  2013-12-19  9:41 ` David Belohrad
  0 siblings, 1 reply; 2+ messages in thread
From: David Belohrad @ 2013-12-19  9:00 UTC (permalink / raw)
  To: mailing-list-org-mode



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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: a4paper to execute latex src block
  2013-12-19  9:00 a4paper to execute latex src block David Belohrad
@ 2013-12-19  9:41 ` David Belohrad
  0 siblings, 0 replies; 2+ messages in thread
From: David Belohrad @ 2013-12-19  9:41 UTC (permalink / raw)
  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 <david@belohrad.ch> 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-12-19  9:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-12-19  9:00 a4paper to execute latex src block David Belohrad
2013-12-19  9:41 ` David Belohrad

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).