No Sound in Phone Calls for Nexus 5
The sound during phone calls on my Nexus 5 recently stopped working, and after several days and much frustration, I figured out the cause and a possible work around. The problem started when I was trying to connect the Nexus 5 to a Plantronics wireless headset base with a three-pole plug–I now think it needs a four pole plug to connect to the Plantronics. Around this time the audio stopped working, but started working again briefly when I updated to a new Android security level. Because of the software update, it looked like the problem was a software problem, but it now looks like it is a problem with a connection on the headphone jack that tells the phone that a headset is plugged in even when one is not present.
Here are the symptoms:
- Phone calls do not work with normal phone-to-ear operation; neither party gets sound
- Phone calls work with speakerphone setting
- Phone calls work with Bluetooth headset
- Phone calls work with a wired headset.
The sequence that follows is not the sequence that I used for problem determination, but this is probably the easiest and least destructive approach. Although this is written for a Nexus 5 running Android 6.0.1, this approach will probably work for most Android phones.
Check Volume Settings
Make sure that volume is turned up for music, notifications and phone connections and that it is not in silent mode. This sounds insulting, but you should always start with the easiest to fix problem. Make sure to look at all of the volume levels by pulling down all of the volume controls as shown in Figure 1.

Check Permissions–Non-destructive Check
Next, check permissions for phone app and make sure that it can use microphone and the phone, as shown in Figure 2. If you are running an Android level below 6.0, this option will not be available. If you have not customized permissions, it is unlikely that this is a problem, but it is an easy check and a good opportunity to learn about permissions if you are not familiar with them.

Check for Misbehaving Applications–Non-destructive Check
Next, reboot the phone in safe mode by holding the down volume control while the phone is booting. If things work at this point, you probably have a misbehaving application that is grabbing control of audio and not allowing the phone application to get control of audio. This YouTube video demonstrates putting a phone into safe mode, but all you do is press the power button to bring up the shutdown panel, and then do a long press on the power off panel until the safe mode panel comes up. Figure 3 shows the safe mode panel that occurs when you press and hold the power off panel. Figure 4 shows the safe mode indicator in the lower left of the display that shows that you have successfully entered safe mode.


Check for Headphone Jack Problem
To check for a problem in the headphone jack that continuously tells Android that a headset is plugged in when one is not present, install the Soundabout app from the Google Play Store and manually assign the phone audio to the built-in speaker. Configure the phone app to use the earpiece as shown in Figure 5. If this works, you probably have a dirty or broken headphone jack that makes the hardware think that there is a wired headset connected when there is not. Repeated audio jack notifications like the one in Figure 6 are a strong indication that this is the root cause of the problem. At this point you can either live with the inconvenience of reassigning audio in Soundabout whenever you want to use Bluetooth or a wired headset, or you can get your phone repaired.
Some people have reported that repeatedly inserting and removing an audio plug has fixed this problem.


Permanent Software Workaround
If you know that the headphone jack is causing the problem and do not want to spend the money to have the phone repaired, you can disable the headphone jack using Soundabout, as shown in Figure 7. Disabling the jack will allow the phone to auto-select between speakers, earpiece and Bluetooth as it would normally. You can still use the headphone jack, but using this approach you will have to open Soundabout and re-enable the headphone jack before you use it.

Check Permissions–Destructive Check
If the audio jack is not broken, you can next reset all permissions to defaults, to make sure that it is not a permissions problem related to some other application that the Android phone app uses for something. This is probably a long shot, but it is substantially less time consuming to reset your customized permissions than to do restore data from a factor reset.
Check for Misbehaving Applications–Destructive Check
At this point, you can try a factory reset and restore apps after the reset, assuming you selected the backup options in your Android configuration. This will wipe out all of your data and customization. Even with backups, it will take a couple of days to get all of your apps working again. If this works, the problem was probably in some complex software configuration mess. Figure 8 shows the settings panel where you can perform the reset.

Check for Misbehaving Applications–Really Destructive Check
As a final resort, you can try a factory reset without restoring your apps. This wipes out everything and gives you a base phone. If this works, it means that one of your apps was misbehaving. Add them back one by one to figure out the problem.
Potential Hardware Repairs
I found a Youtube video, FIX: Nexus 5 Mic not Working which describes a possible cause and fix for this problem.
- Details
- Written by: Bruce Moore
- Hits: 14544
Solving Windows 10 Problems with Booting from a CD
I recently did a Clonezilla backup of my Lenovo W541 and had problems getting it to recognize the F12 key that you have to press during the boot process to bring up the boot selection menu. It turned out to be a problem caused by the “fast startup” or “hybrid boot” feature in Windows 10. To boot from a CD by pressing F12 during boot (or to enter the BIOS settings by pressing F1) you will first need to disable “fast startup.”
To disable Fast Startup, go to the Power Settings page shown in Figure 1, and select the “Advanced power settings” dialog link at the bottom of the panel under “Related settings,” then select “Choose what the power buttons do” on the left side of the panel as shown in Figure 2. Next, select the “Change additional options that are not shown” link at the top as shown in Figure 3; this will activate the options at the bottom of the page. Un-check the “hybrid boot” option as shown in Figure 4. You should be able to use use F12 to get to the boot selection menu. If you get a message that the operating system was not recognized, you will need to enter the BIOS settings (press F1 during boot) and temporarily disable the Secure Boot setting in the security tab. Make sure to re-enable Secure Boot in the BIOS when you are finished with your Clonezilla backup.
- Details
- Written by: Bruce Moore
- Hits: 2583
Solving Windows 10 Shutdown Problems on HP 4520s
Since upgrading to Windows 10, I've had difficulty getting my HP 4520s to shut down using the normal Start Button tools, but it would shut down using the Cygwin shutdown command. After trying a lot of stuff, I took it to a local Microsoft Store when we were in the vicinity. The technician was able to fix the problem embarrassingly quickly by disabling the “fast startup” option which is sometimes called “hybrid boot.” This is a relatively new (to me at least) option that speeds up booting, but which does not play well with the older drivers on the HP 4520s, requires that you restart rather than shutdown/start when you install updates and which masks keystrokes to enter BIOS or boot menus while starting up or restarting a machine.
To disable Fast Startup/Hybrid Boot, go to the Power Settings page shown in Figure 1, and select the “Advanced power settings” dialog link at the bottom of the panel under “Related settings,” then select “Choose what the power buttons do” on the left side of the panel as shown in Figure 2. Next, select the “Change additional options that are not shown” link at the top as shown in Figure 3; this will activate the options at the bottom of the page. Un-check the “fast startup” option as shown in Figure 4. You should be able to use the normal shutdown procedures on your HP 4520s.
This may be helpful on other older machines as well.




- Details
- Written by: Bruce Moore
- Hits: 2874
R Reporting Part 8: Using LaTeX to Create Posters
This is the eigth of a series of articles on how to use R, RStudio and TexMaker to prepare presentations and batch jobs for automated reporting on a web server or Microsoft SharePoint server. The series is based upon the presentation that I did at the February 27, 2016 Dallas R User Group Meetup. Because the presentation was primarily a demonstration, there really isn’t a presentation to distribute; this series covers the topics from the presentation/demonstration. The series will eventually include the following articles as I complete them over the next couple of weeks:
- R Reporting Part 1: Tools
- R Reporting Part 2: Choosing the Right Markup for the Task
- R Reporting Part 3: Using Rhtml for Batch Web Reporting
- R Reporting Part 4: Using Markdown for Interactive Presentations
- R Reporting Part 5: Using LaTeX/Beamer for PDF Presentations
- R Reporting Part 6: Using LaTeX for PDF Articles
- R Reporting Part 7: Converting R Documents to E-books
- R Reporting Part 8: Using LaTeX to Create Posters
The series of articles describes the process for daily batch jobs that generate the Daily Econometric Graphs web page which includes links to the same econometric charts in several formats, all generated through the same R code:
- Econometric graphs in PDF form for use as slides on a projector
- Econometric graphs in PDF form for printing
- Econometric graphs in EPUB format
- Econometric graphs in Kindle AZW3 format
- Econometric graphs in A0 poster format
All of the examples are based upon the knitr
R package; you should reference the knitr
documentation, as this article is not a replacement for the knitr
documentation.
Example source is available in images/documents/econometric_source.zip.
LaTeX Poster Styles
Because LaTeX was written by and for academics and professionals in math and science who need to create posters for conferences and other displays, several authors have created LaTeX packages to make it easy to create posters. Here are a few of the major packages:
- Baposter from Brian Amberg is easy to use but has a relatively fixed display style.
- Beamerposter uses Beamer style operations.
- A0poster is perhaps the most flexible of the various poster packages, but with flexibility comes some complexity.
The example that follows will use BAposter, as it is probably the easiest to get working. The example poster is a PDF file Useful Econometrics Poster.
BAPoster Example
The code for the example poster uses the knitr chunk syntax discussed earlier in this series of articles in R Reporting Part 3: Using Rhtml for Batch Web Reporting and set up using the read_chunk("econometric_charts_chunks.R")
call in the prologue of the LaTeX/knitr file:
<<prolog,message=FALSE,echo=FALSE,error=FALSE,warning=FALSE,dev=c('pdf','png','jpeg')>>=
#install.packages(c("dplyr","magrittr","assertr","ggvis","googleVis","htmlwidgets","networkD3","rCharts","qtlcharts","dygraphs","d3heatmap"))
require(ggplot2)
require(dplyr)
require(magrittr)
require(assertr)
require(ggplot2)
require(fImport)
require(reshape2)
require(scales)
require(knitr)
#library(RCurl)
setwd("~/svn_work/Consulting_Business/web_site/articles/econometric_charts/src/R")
options('download.file.method'='wget')
read_chunk("econometric_charts_chunks.R")
@
\documentclass[a0paper,portrait]{baposter}
\usepackage{color}
\definecolor{mssDeepBlue}{rgb}{0.1367188,0.375,0.5742188} % new RGB values
\definecolor{mssCyan}{rgb}{0.0,0.6210938,0.8515625}
\definecolor{mssGreen}{rgb}{0.4101562,0.7421875,0.15625}
\definecolor{mssCyanLight}{rgb}{0.0,0.3105469,0.4257812}
\usepackage{hyperref}
\usepackage{hyperxmp}
\usepackage{ifplatform}
%
%
%
\ifwindows
\newcommand{\mssPathDef}{C:/Users/bwmoore/Documents}
\else
\newcommand{\mssPathDef}{/home/bwmoore}
\fi
\begin{document}
\background{}
\begin{poster}{
background=none,
colspacing=0.7em,
textborder=roundedleft,
headerborder=none,
headershape=roundedright,
headerheight=0.134\textheight,% this defines height of box reserved for title, name, etc.
%another declarations
}
{}
{Useful Econometrics}
{Bruce Moore \\
Moore Software Services LLC \\
Coppell, TX USA \\
moorebw@mooresoftwareservices.com}
{ \includegraphics[width=7cm,angle=0]{"/home/bwmoore/svn_work/Consulting_Business/VG_Visuals/Dropbox/LOGOS/Logo - Tagline Below/MOORE LOGO Tagline"}}
\setlength\parindent{24pt}
%
%
%
%
%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Column 1
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\headerbox{Purpose}{name=purpose,column=0,borderColor=mssDeepBlue,headerColorOne=mssDeepBlue,headerColorTwo=mssDeepBlue,boxshade=none,headerFontColor=white}{
\paragraph{}This poster provides example econometrics to demonstrate using RStudio to generate a poster.
}
%
% Column 1 Box 2
%
\headerbox{Data Source}{name=dataSource,column=0,below=purpose,borderColor=mssDeepBlue,headerColorOne=mssDeepBlue,headerColorTwo=mssDeepBlue,boxshade=none,headerFontColor=white}{
\paragraph{}The data for this poster was pulled from the St. Louis Federal Reserve FRED2 system using the fImport R package.
\paragraph{}The poster uses the \LaTeX\ \href{http://www.brian-amberg.de/uni/poster/}{BAposter} package and was composed in RStudio and generated using the knitr R package. It was formatted for A0 printing (33.11 by 46.81 inches), although BAposter supports other page sizes.
\paragraph{}Lists use the normal \LaTeX\ list itemize environment. For example, the data series used in this poster are
\begin{itemize}
\item Swap rates
\item Used Car and Rruck Consumer Price Index
\item Median Household Income
\item Unemployment Rate
\item Mortgage Delinquency
\end{itemize}
}
%
% Column 1 Box 3
%
\headerbox{Contact Information}{name=contact,column=0,below=dataSource,borderColor=mssDeepBlue,headerColorOne=mssDeepBlue,headerColorTwo=mssDeepBlue,boxshade=none,headerFontColor=white}{
\begin{center}
Bruce Moore \\
bwmoore@mooresoftwareservices.com \\
+1 (972) 652-0254 \\
\includegraphics[width=.27\textwidth]{"/home/bwmoore/svn_work/Consulting_Business/sales_presentations/business_cards/images/bwmoore_tiny"}
\end{center}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Column 2
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\headerbox{Cost of Funds}{name=costOfFunds,column=1,span=2,borderColor=mssDeepBlue,headerColorOne=mssDeepBlue,headerColorTwo=mssDeepBlue,boxshade=none,headerFontColor=white}{
<< costOfFunds,echo=FALSE,message=FALSE,warning=FALSE,error=FALSE,pdf.compress=TRUE,eval=TRUE,fig.path="images/figures/",dev=c("png","pdf","svg"),fig.width=6,fig.height=3,dpi=200>>=
@
%\includegraphics[width=\linewidth]{\mssPathDef/svn_work/Consulting_Business/web_site/articles/econometric_charts/src/R/images/figures/costOfFunds-1.png}
}
%
% Column 2 Box 2
%
\headerbox{Auto CPI}{name=autoCPI,column=1,below=costOfFunds,boxheaderheight=1.0cm,borderColor=mssDeepBlue,headerColorOne=mssDeepBlue,headerColorTwo=mssDeepBlue,boxshade=none,headerFontColor=white}{
<< autoCPI,echo=FALSE,message=FALSE,warning=FALSE,error=FALSE,pdf.compress=TRUE,eval=TRUE,fig.path="images/figures/",dev=c("png","pdf","svg")>>=
@
}
%
% Column 2 Box 3
%
\headerbox{Mortgage Delinquency}{name=mortDelinquncy,column=1,below=autoCPI,boxheaderheight=1.0cm,borderColor=mssDeepBlue,headerColorOne=mssDeepBlue,headerColorTwo=mssDeepBlue,boxshade=none,headerFontColor=white}{
<< mortDelinquency,echo=FALSE,message=FALSE,warning=FALSE,error=FALSE,pdf.compress=TRUE,eval=TRUE,fig.path="images/figures/",dev=c("png","pdf","svg")>>=
@
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Column 3
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Column 3 Box 2
%
\headerbox{Median Household Income}{name=medianHouseholdIncome,column=2,below=costOfFunds,boxheaderheight=1.0cm,borderColor=mssDeepBlue,headerColorOne=mssDeepBlue,headerColorTwo=mssDeepBlue,boxshade=none,headerFontColor=white}{
<< medianHouseholdIncome,echo=FALSE,message=FALSE,warning=FALSE,error=FALSE,pdf.compress=TRUE,eval=TRUE,fig.path="images/figures/",dev=c("png","pdf","svg")>>=
@
}
%
% Column 3 Box 3
%
\headerbox{Unemployment}{name=unemployment,column=2,below=medianHouseholdIncome,boxheaderheight=1.0cm,borderColor=mssDeepBlue,headerColorOne=mssDeepBlue,headerColorTwo=mssDeepBlue,boxshade=none,headerFontColor=white}{
<< medianHouseholdIncome,echo=FALSE,message=FALSE,warning=FALSE,error=FALSE,pdf.compress=TRUE,eval=TRUE,fig.path="images/figures/",dev=c("png","pdf","svg")>>=
@
}
\end{poster}
\end{document}
Set Up Defaults
The first step is to set the various global parameters for the poster, for complete information on the various options, see the BAPoster documentation.
\background{}
\begin{poster}{
background=none,
colspacing=0.7em,
textborder=roundedleft,
headerborder=none,
headershape=roundedright,
headerheight=0.134\textheight,% this defines height of box reserved for title, name, etc.
%another declarations
}
{}
{Useful Econometrics}
{Bruce Moore \\
Moore Software Services LLC \\
Coppell, TX USA \\
This email address is being protected from spambots. You need JavaScript enabled to view it. }
{ \includegraphics[width=7cm,angle=0]{"/home/bwmoore/svn_work/Consulting_Business/VG_Visuals/Dropbox/LOGOS/Logo - Tagline Below/MOORE LOGO Tagline"}}
\setlength\parindent{24pt}
The bracket pairs contain the following:
- The first bracket pair contains the key value options that set up the block shapes and other parameters
- The second bracket pair contains the eyecatcher text; this is not used on this poster
- The third bracket pair contains the poster title
- The fourth bracket pair contains the poster authors
- The final bracket pair contains the logo or header graphic for the poster
Creating a Text Box for a Single Column
BAPoster uses the headerbox
tag to generate each box on the poster:
\headerbox{Purpose}{name=purpose,column=0,borderColor=mssDeepBlue,headerColorOne=mssDeepBlue,headerColorTwo=mssDeepBlue,boxshade=none,headerFontColor=white}{
\paragraph{}This poster provides example econometrics to demonstrate using RStudio to generate a poster.
}
The bracket pairs on the tag are as follows:
- The first bracket pair contains the text for the heading
- The second bracket pair contains the keywords for the tag, including these important tags:
name
is required and is needed to establish the relative position of boxes within a column.column
is required to determine in which column the box should be placedborderColor
and the other keywords are optional but will be used in almost all cases.- The third bracket pair contains the text for the box. This can include any LaTeX tags for tables, lists, math, as long as the output will fit on the poster.
Creating the Second Text Box in a Column
The second and subsequent text boxes in a column are identical to the first but must have a below
keyword to reference the text box that is immediately above:
\headerbox{Data Source}{name=dataSource,column=0,below=purpose,borderColor=mssDeepBlue,headerColorOne=mssDeepBlue,headerColorTwo=mssDeepBlue,boxshade=none,headerFontColor=white}{
\paragraph{}The data for this poster was pulled from the St. Louis Federal Reserve FRED2 system using the fImport R package.
\paragraph{}The poster uses the \LaTeX\ \href{http://www.brian-amberg.de/uni/poster/}{BAposter} package and was composed in RStudio and generated using the knitr R package. It was formatted for A0 printing (33.11 by 46.81 inches), although BAposter supports other page sizes.
\paragraph{}Lists use the normal \LaTeX\ list itemize environment. For example, the data series used in this poster are
\begin{itemize}
\item Swap rates
\item Used Car and Rruck Consumer Price Index
\item Median Household Income
\item Unemployment Rate
\item Mortgage Delinquency
\end{itemize}
}
Creating a Text Box that Spans Columns
To emphasize a point, it will frequently be useful to create a text box that spans columns, as is done in the “Cost of Funds” block on this poster using the span
keyword:
\headerbox{Cost of Funds}{name=costOfFunds,column=1,span=2,borderColor=mssDeepBlue,headerColorOne=mssDeepBlue,headerColorTwo=mssDeepBlue,boxshade=none,headerFontColor=white}{
<< costOfFunds,echo=FALSE,message=FALSE,warning=FALSE,error=FALSE,pdf.compress=TRUE,eval=TRUE,fig.path="images/figures/",dev=c("png","pdf","svg"),fig.width=6,fig.height=3,dpi=200>>=
@
}
This text box incorporates R code that will be evaluated by the knitr
package. knitr
does not know the size of the LaTeX text box, so you will probably want to use the fig.width
and fig.height
keywords for the chunk to set the relative dimensions that you want for any graphics so that the proportions match what you need in the text box.
- Details
- Written by: Bruce Moore
- Hits: 4227
R Reporting Part 7: Converting R Documents to E-books
This is the seventh of a series of articles on how to use R, RStudio and TexMaker to prepare presentations and batch jobs for automated reporting on a web server or Microsoft SharePoint server. The series is based upon the presentation that I did at the February 27, 2016 Dallas R User Group Meetup. Because the presentation was primarily a demonstration, there really isn’t a presentation to distribute; this series covers the topics from the presentation/demonstration. The series will eventually include the following articles as I complete them over the next couple of weeks:
- R Reporting Part 1: Tools
- R Reporting Part 2: Choosing the Right Markup for the Task
- R Reporting Part 3: Using Rhtml for Batch Web Reporting
- R Reporting Part 4: Using Markdown for Interactive Presentations
- R Reporting Part 5: Using LaTeX/Beamer for PDF Presentations
- R Reporting Part 6: Using LaTeX for PDF Articles
- R Reporting Part 7: Converting R Documents to E-books
- R Reporting Part 8: Using LaTeX to Create Posters
The series of articles describes the process for daily batch jobs that generate the Daily Econometric Graphs web page which includes links to the same econometric charts in several formats, all generated through the same R code:
- Econometric graphs in PDF form for use as slides on a projector
- Econometric graphs in PDF form for printing
- Econometric graphs in EPUB format
- Econometric graphs in Kindle AZW3 format
- Econometric graphs in A0 poster format
All of the examples are based upon the knitr
R package; you should reference the knitr
documentation, as this article is not a replacement for the knitr
documentation.
Example source is available in images/documents/econometric_source.zip.
Software Required
Creating epub files requires software that converts from html to epub format. Calibre is the one of the better open source tools for e-book generation and management. It is available for Linux, Windows and OS X. For converting LaTeX files to epub, it is necessary to create an HTML file as an intermediate step. There are several tools to do this; Latex2html is one of the tools that can do this and is arguably the best, but it is not being actively maintained. The LaTeX to HTML FAQ has a list of alternatives.
In looking at alternatives, it is helpful to use one that does not generate pages with headers and footers, as these can create problems during the epub generation process.
Creating an E-book from Rhtml
The first step in creating an E-book is to create an HTML file as input to the process. You can generate the document as the output from running an .RHTML
or by using one of several utilities for converting LaTeX files to HTML. The script below is a very simplified script to generate an epub. For simplicity, error checking and recovery are omitted:
#!/bin/bash
echo $HOME
cd ~/svn_work/Consulting_Business/web_site/articles/econometric_charts/src/R
#
# Run RScript and knitr to generate the HTML file
#
/usr/bin/Rscript -e "require('knitr'); knit('econometric_charts_home_page.Rhtml')"
#
# Compress images
#
optipng images/figures/*.png
optipng *.png
#
# Use Calibre ebook-convert to convert the HTML file to an epub file
#
ebook-convert econometric_charts_home_page.html .epub --authors "Bruce Moore" --language en --no-default-epub-cover
#
# Upload to the web site
#
cd ~/svn_work/Consulting_Business/web_site/articles/econometric_charts/src/R
scp -i /home/batchuser/.ssh/webuser econometric_charts_home_page_article/econometric_charts_home_page_article.epub This email address is being protected from spambots. You need JavaScript enabled to view it. :/home/webuser/www/images/documents/
Run RScript and Knitr
The first section of the script calls Rscript
to run R from the command line and pass two statements. The first is require('knitr')
while the second is to knit()
the Rhtml file which runs all of the R code and creates an HTML file.
#
# Run RScript and knitr to generate the HTML file
#
/usr/bin/Rscript -e "require('knitr'); knit('econometric_charts_home_page.Rhtml')"
Compress Images
The second segment uses optipng
to compress the .png
images that are created as graphics when running the Rhtml file:
#
# Compress images
#
optipng images/figures/*.png
optipng *.png
Ebook-convert
The third segment uses the ebook-convert
program from Calibre to create the epub file. There are numerous options for the ebook-convert
command but the --authors
, --language
and --no-default-epub-cover
options are a minimal set. The first two are self explainatory and are useful for all files. The --no-default-epub-cover
option is useful for input files that have content that generates a good cover page, or where no cover page is needed.
#
# Use Calibre ebook-convert to convert the HTML file to an epub file
#
ebook-convert econometric_charts_home_page.html .epub --authors "Bruce Moore" --language en --no-default-epub-cover
Upload to Server
The final segment is a command to upload files to a web server or other server. In this case, the scp
secure copy command is used. In this use, it is assumed that public key authentication has previously been configured. The -i
option is not normally needed for interactive use, but is necessary for reliable use under cron. The -i
option points to the private key file to be used for authentication.
#
# Upload to the web site
#
cd ~/svn_work/Consulting_Business/web_site/articles/econometric_charts/src/R
scp -i /home/batchuser/.ssh/webuser econometric_charts_home_page_article/econometric_charts_home_page_article.epub This email address is being protected from spambots. You need JavaScript enabled to view it. :/home/webuser/www/images/documents/
Converting LaTeX to Epub
When using a LaTeX input file, there is one additional step in between the RScript
and ebook-convert
segments. Option -split +0
causes the output to be placed into a single HTML file rather than splitting it into files based upon sections.
#
# Generate the epub version of the article
#
latex2html -split +0 econometric_charts_home_page_slides.tex
- Details
- Written by: Bruce Moore
- Hits: 2602
Page 12 of 28