From 2657c3c0a61b16de6129e5945ca5576666ec40e5 Mon Sep 17 00:00:00 2001 From: Milanka Ringwald Date: Thu, 18 Jun 2015 17:39:57 +0200 Subject: [PATCH] size of figs in latex fixed manualy --- .../markdown/btstack_gettingstarted.tex | 4 +-- docs/manual/markdown/docs/profiles.md | 13 ++++--- docs/manual/markdown/markdown2pdf.py | 34 +++++++++++++++++-- example/embedded/spp_counter.c | 4 +-- 4 files changed, 41 insertions(+), 14 deletions(-) diff --git a/docs/manual/markdown/btstack_gettingstarted.tex b/docs/manual/markdown/btstack_gettingstarted.tex index db9ce215c..2db497b7d 100644 --- a/docs/manual/markdown/btstack_gettingstarted.tex +++ b/docs/manual/markdown/btstack_gettingstarted.tex @@ -53,8 +53,8 @@ breaklines=true, % sets automatic line breaking breakatwhitespace=false, % sets if automatic breaks should only happen at whitespace escapeinside={\%*}{*)}, % if you want to add a comment within your code belowcaptionskip=5em, -belowskip=1em, -aboveskip=1.8em, +aboveskip=\baselineskip, +belowskip=\baselineskip, commentstyle=\itshape\color{mygreen}, keywordstyle=\bfseries\color{black}, identifierstyle=\color{black}, diff --git a/docs/manual/markdown/docs/profiles.md b/docs/manual/markdown/docs/profiles.md index 53aa0e949..98028b776 100644 --- a/docs/manual/markdown/docs/profiles.md +++ b/docs/manual/markdown/docs/profiles.md @@ -277,17 +277,16 @@ resolve the peer Bluetooth address as explained in Section on An LE device is discoverable and connectable, only if it periodically sends out Advertisements. An advertisement contains up to 31 bytes of -data. To configure and enable advertisement broadcast, the following HCI -commands can be used: +data. To configure and enable advertisement broadcast, the following GAP +functions can be used: -- *hci_le_set_advertising_data* +- *gap_advertisements_set_data* -- *hci_le_set_advertising_parameters* +- *gap_advertisements_set_params* -- *hci_le_set_advertise_enable* +- *gap_advertisements_enable* -As these are direct HCI commands, please refer to Section -[subsubsection:sendinghci] for details and have a look at the [SPP and LE +Please have a look at the [SPP and LE Counter example](examples/generated/#sec:sppandlecounterExample). In addition to the Advertisement data, a device in the peripheral role diff --git a/docs/manual/markdown/markdown2pdf.py b/docs/manual/markdown/markdown2pdf.py index 1eff3d821..c448742a3 100755 --- a/docs/manual/markdown/markdown2pdf.py +++ b/docs/manual/markdown/markdown2pdf.py @@ -3,10 +3,38 @@ import sys, yaml import os, re -def href2path(line): +def fix_latex(line): corr = re.match('.*(href{}).*',line) if corr: line = line.replace(corr.group(1), "path") + corr = re.match('.*begin{lstlisting}',line) + if corr: + line = "\leavevmode" + line + + corr = re.match('.*section{APIs}.*',line) + if corr: + line = "\leavevmode\pagebreak\n" + line + + corr = re.match('(.*includegraphics)(.*btstack-architecture.*)',line) + if corr: + line = corr.group(1) + "[width=\\textwidth]" + corr.group(2) + + corr = re.match('(.*includegraphics)(.*singlethreading-btstack.*)',line) + if corr: + line = corr.group(1) + "[width=0.3\\textwidth]" + corr.group(2) + + corr = re.match('(.*includegraphics)(.*multithreading-monolithic.*)',line) + if corr: + line = corr.group(1) + "[width=0.8\\textwidth]" + corr.group(2) + + corr = re.match('(.*includegraphics)(.*multithreading-btdaemon.*)',line) + if corr: + line = corr.group(1) + "[width=0.8\\textwidth]" + corr.group(2) + + corr = re.match('(.*includegraphics)(.*btstack-protocols.*)',line) + if corr: + line = corr.group(1) + "[width=0.8\\textwidth]" + corr.group(2) + return line @@ -30,7 +58,7 @@ def main(argv): section_ref = re.match('.*\(((.*)(#sec:.*))\).*',line) if section_ref: line = line.replace(section_ref.group(2),"") - aout.write(line) + aout.write(line) pandoc_cmd = "pandoc -f markdown -t latex --filter pandoc-fignos --listings latex/btstack_generated.md -o latex/btstack_generated.tex" p = os.popen(pandoc_cmd,"r") @@ -49,7 +77,7 @@ def main(argv): with open(btstack_generated_file, 'r') as fin: for line in fin: - line = href2path(line) + line = fix_latex(line) aout.write(line) diff --git a/example/embedded/spp_counter.c b/example/embedded/spp_counter.c index 70a37d127..0024b2936 100644 --- a/example/embedded/spp_counter.c +++ b/example/embedded/spp_counter.c @@ -158,8 +158,8 @@ static void one_shot_timer_setup(void){ * packet handler, see Listing SppServerPacketHandler. In this example, * the following events are passed sequentially: * - BTSTACK_EVENT_STATE, - * - HCI_EVENT_PIN_CODE_REQUEST (Standard pairing) or \\ - * HCI_EVENT_USER_CONFIRMATION_REQUEST \\ (Secure Simple Pairing), + * - HCI_EVENT_PIN_CODE_REQUEST (Standard pairing) or + * - HCI_EVENT_USER_CONFIRMATION_REQUEST (Secure Simple Pairing), * - RFCOMM_EVENT_INCOMING_CONNECTION, * - RFCOMM_EVENT_OPEN_CHANNEL_COMPLETE, and * - RFCOMM_EVENT_CHANNEL_CLOSED