By default, Sphinx documentation outputs a PDF that's formatted for duplex printing. So there is a blank page between the title page and the TOC, the TOC and the introduction, the introduction and the first section, etc.
My users are always going to look at the PDF online. So I would like to remove these blank pages.
This seems to be a vexed issue in Sphinx. See this email thread.
This user suggests two solutions, but neither work for me. Curiously, the first solution:
latex_elements = {
'classoptions': ',oneside',
}
gives me
! Package babel Error: You haven't specified a language option.
The second option:
latex_font_size = '10pt,oneside'
runs, but produces a PDF that only has the odd-numbered pages of my document. Alas.
Does anyone know how to produce a PDF without these blank pages?
Put this in your source/conf.py configuration file in the "Options for LaTeX output" section:
latex_elements = {
'extraclassoptions': 'openany,oneside'
}
Related
It used to be that reveal.js would generate one PDF page per slide. Now, as of this issue, it generates one PDF page per fragment. I would like to generate a PDF in the old one-page-per-slide format, though.
This comment on that issue suggests that there is a configuration option for this, but it's not obvious what it is from the project documentation.
Which configuration option controls this? Or, is there another way to get reveal.js PDF export to do one page per slide?
From reveal.js' README.md, under PDF Export > Separate pages for fragments:
Fragments are printed on separate slides by default. Meaning if you have a slide with three fragment steps, it will generate three separate slides where the fragments appear incrementally.
If you prefer printing all fragments in their visible states on the same slide you can set the pdfSeparateFragments config option to false.
So, it seems you can export multiple fragments per page via:
Reveal.configure({ pdfSeparateFragments: false });
I have been pulling my hair out trying to finds a solution to this problem.
I start typing <a then press ctrl-enter to open up the available snippets.
I would then be provided with just a list of tags (with the red V icon at the left), I was expecting to see a list of snippets (green right pointing arrow) that could be selected and would auto complete the tag and closing tag.
The same functionality as seen on this blog post (HTML Paragraph) http://blog.atom.io/2015/05/15/new-autocomplete.html
It is my understanding that autocomplete-plus has snippets from autocomplete-HTML, auto-complete-CSS, autocomplete-atom-API, and autocomplete-snippets. And that these are all now bundled by default into the atom.
I have read many blogs and GitHub issues trying to find a solution and none have worked. my snippets.cson is empty (Ignoring comments)and it is my understanding that they are for custom snippets. I do not want custom snippets at the moment, I just want the defaults which are advertised on the autocomplete plus docs
Has anybody else had this issue or would know solutions?
Each Atom snipped has a specific prefix, in case of the <a> tag it is just a (without the < character), so typing atab pastes the snippet body tag.
We use ABCpdf software, and recently added a Russian translation option for some of our documents. Most of the contents of the PDF come from a web page using the AddImageURL method. This all works fine, meaning that the Russian text is readable.
However, we have a few text sections that need to be placed exactly at the bottom of the page, so we do this with ABCpdf's AddText method. These strings show up as ???????? in the generated PDF.
Here's a quick code sample:
Doc pdfDoc = new Doc();
//snip snip snip...
//add footer text
pdfDoc.Rect.SetRect(30, 30, 552, 10); //footer section
pdfDoc.HPos = 0; //set horizontal position to left
pdfDoc.AddText(GetRussianString("REFERENCE") + " #" + ReferenceID);
After reading the documentation on Websupergoo's site, I tried using AddFont and EmbedFont (separately and together), but this did not work:
pdfDoc.Font = pdfDoc.EmbedFont("Times-Roman", LanguageType.Unicode);
I also searched for ways to set encoding at the document level, and didn't find any documentation on this, at least not for version 8. We are currently using 8.11.2 of the ABCpdf software.
Has anybody done something like this successfully?
OK, the (totally embarrassing) answer is that I was being far too literal about the example from WebSuperGoo's site. I needed to use the exact font name from my development/production machine.
pdfDoc.Font = pdfDoc.EmbedFont("Times New Roman", LanguageType.Unicode);
Obvious? Yes. But it's one of things that can be overlooked when in a hurry, so I'll post the answer here in case anybody else gets tripped up.
Part of my confusion stemmed from the fact that Russian text added from a URL was just fine in the document, but not the content added as text. I'm guessing that abcPDF sets the font according to the encoding it gets from the web page, but that affects only the content it is pulling in, not the overall PDF.
Anyhow, thanks to gekannt and anybody else who took a look.
I'm trying to use Django's built-in admin docs feature to make writing templates easier. Supposedly if you go to /admin/docs/views you should get documentation for every view in your application. I see a list, but none of the links work:
-) Any view listed that's related to my application just goes to a blank page with nothing but the name of the view as a header.
-) The views related to admin all give me Django 404 errors when I click on them, except those that are related to the docs itself. The docs-related links also give me blank pages. (i.e. clicking /admin/doc/filters gives a blank page with nothing but "django.contrib.admindocs.views.template_filter_index" as a title, but clicking /admin/auth/user gives me a Django 404 error
The 404 errors lead me to suspect my URLconf is wrong, but all I did was uncomment the built-in lines. The relevant sections read:
# Uncomment the admin/doc line below to enable admin documentation:
(r'^admin/doc/', include('django.contrib.admindocs.urls')),
# Uncomment the next line to enable the admin:
(r'^admin/', include(admin.site.urls)),
And I have no idea what to make of the blank pages. Do I need to provide some extra meta information somewhere, like I know you need to provide the get_absolute_url on models for some of the admin features to work right?
Even if no one knows the answer, any documentation on the admin docs feature would be useful -- I've been Google all over (and searching StackOverflow) and this feature seems very little-documented.
Thanks!
You need to add 'django.contrib.admindocs' to your INSTALLED_APPS in settings.py. It should already be there and commented out. Though it would be nice if the comment in urls.py mentioned it ... Source.
I've never looked at the views admin doc pages before -- I've never had a need to. B4ut you're right, they seem to be -- lacking in potential features.
If you give your views functions docstrings (documentation), that content will appear on your "blank pages".
Most -- no, all -- of the admin sites views are actually decorated member methods of admin.sites.AdminSite. I looked around, and a view of mine which uses a decorator also suffers from the 404.
The view responsible for view details starts:
def view_detail(request, view):
if not utils.docutils_is_available:
return missing_docutils_page(request)
mod, func = urlresolvers.get_mod_func(view)
try:
view_func = getattr(import_module(mod), func)
except (ImportError, AttributeError):
raise Http404
title, body, metadata = utils.parse_docstring(view_func.__doc__)
...
You can see it tries to import the view to get info from it; if the view is actually a decorator (which probably used an internal function to wrap the real view), it won't be able to import it. eg, if you do from django.contrib.admin.sites import index in a django shell, you'll get an ImportError, whereas django.contrib.admin.site.index (note the singular site) is a:
<bound method AdminSite.index of <django.contrib.admin.sites.AdminSite object at 0x...>>
Further, that last line in my snippet seems to indicate that there's a capability for finer control over what shows up on those pages, if you care to figure out the template that util.parse_docstring uses.
Is there a way to remove blank pages appearing between two chapters, in Appendix?
Your problem is that all chapters, whether they're in the appendix or not, default to starting on an odd-numbered page when you're in two-sided layout mode. A few possible solutions:
The simplest solution is to use the openany option to your document class, which makes chapters start on the next page, irrespective of whether it's an odd or even numbered page. This is supported in the standard book documentclass, eg \documentclass[openany]{book}. (memoir also supports using this as a declaration \openany which can be used in the middle of a document to change the behavior for subsequent pages.)
Another option is to try the \let\cleardoublepage\clearpage command before your appendices to avoid the behavior.
Or, if you don't care using a two-sided layout, using the option oneside to your documentclass (eg \documentclass[oneside]{book}) will switch to using a one-sided layout.
it is very easy:
add \documentclass[oneside]{book}
and youre fine ;)
I tried Noah's suggestion which leads to the best solution up to now.
Just insert \let\cleardoublepage\clearpage before all the parts with the blank pages
Especially when you use \documentclass[12pt,a4paper]{book}
frederic snyers's advice \documentclass[oneside]{book} is also very good and solves the problem, but if we just want to use the book.cls or article.cls, the one would make a big difference presenting your particles.
Hence, Big support to \let\cleardoublepage\clearpage for the people who will ask the same question in the future.
If you specify the option 'openany' in the \documentclass declaration each chapter in the book (I'm guessing you're using the book class as chapters open on the next page in reports and articles don't have chapters) will open on a new page, not necessarily the next odd-numbered page.
Of course, that's not quite what you want. I think you want to set openany for chapters in the appendix. 'fraid I don't know how to do that, I suspect that you need to roll up your sleeves and wrestle with TeX itself
In my case, I still wanted the open on odd pages option but this would produce a blank page with the chapter name in the header. I didn't want the header. And so to avoid this I used this at the end of the chapter:
\clearpage
\thispagestyle{plain}
This let's you keep the blank page on the last even page of the chapter but without the header.
I put the \let\cleardoublepage\clearpage before \makeindex. Else, your content page will display page number based on the page number before you clear the blank page.
One thing I discovered is that using the \include command will often insert and extra blank page. Riffing on the previous trick with the \let command, I inserted \let\include\input near the beginning of the document, and that got rid of most of the excessive blank pages.
You can also use \openany, \openright and \openleft commands:
\documentclass{memoir}
\begin{document}
\openany
\appendix
\openright
\appendixpage
This is the appendix.
\end{document}