Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Latex/pdf support #57

Closed
stefanodavid opened this issue Mar 20, 2020 · 8 comments
Closed

Improve Latex/pdf support #57

stefanodavid opened this issue Mar 20, 2020 · 8 comments

Comments

@stefanodavid
Copy link

Support for tabs in latex/pdf was required in #19, apparently added in PR #23 (commit 3f9bf17), but it is not part of the current release. Was it ever part of a release and are there any plan to (re)introduce that feature? If I apply the code in that commit to the current release, the output latex code does not change at all from the current release...

I use currently as a workaround the .. only:: directives with tabs for html and topics for latex, but it would be better to have it automatic with sphinx_tabs.

@ScriptAutomate
Copy link

I have had to do something very similar in order to allow compatibility between my PDF and HTML builds. I've had to go so far as make a build script that gets run in my CI pipelines that uses sed replacements to ensure the PDF comes out okay, using admonitions in the rst before the PDFs are built.

# sphinx-tabs formatting workaround
## Replacing tabs with admonitions, to properly render
for TAB_FILE in $(grep -R '.. tabs::' docs/ | cut -d':' -f1 | sort | uniq)
do
    sed -i 's/\ \ \ \.\.\ tabs:://g' $TAB_FILE
    sed -i 's/\ \ \ \ \.\.\ tab::/\ \ \.\. admonition::/g' $TAB_FILE
done

It's literally modifying the rst temporarily when the pipeline job for building PDFs runs. It's been the best way for me to make the lives of other contributors (and myself) easier. Once it can work fine out-of-box, I'll won't have to remember it for other projects using this plugin that also generate PDFs

@chrisjsewell chrisjsewell changed the title Latex/pdf support? Improve Latex/pdf support Aug 20, 2020
@chrisjsewell
Copy link
Member

yep its on the TODO list, when I start restructuring some of the parsing logic, to work better with MyST-Parser

@Daltz333
Copy link
Collaborator

Since we pushed the new version, is this issue still present? On our PDF, it prints each tab as it's own thing.

@stefanodavid
Copy link
Author

Hi @Daltz333 thanks for you efforts!

Since opening this issue, I moved projects that required a PDF to sphinx-panels and used tabbed::, but I made a quick test with tabs:: and tabbed::. By comparing the results, tabs:: just writes the tab's title as a separate paragraph, while tabbed:: puts it as a \subsubsection*, and I prefer the latter which makes clear that each tab is a separate thing.
But my initial request is now satisfied, so you can close the issue.

@Daltz333 Daltz333 closed this as completed May 2, 2021
@jdillard
Copy link
Contributor

On our PDF, it prints each tab as it's own thing.

What is "our PDF" here? I don't see any PDF downloads in the docs: https://sphinx-tabs.readthedocs.io

@Daltz333
Copy link
Collaborator

Daltz333 commented May 22, 2021

My personal project frc-docs.readthedocs.io

@jdillard
Copy link
Contributor

jdillard commented May 22, 2021

Got it, thanks! Here is an example from your docs PDF, using Java and C++ tabs, for the curious:

image

I wonder if turning on the PDF for the sphinx-tabs docs would be worthwhile.

@krzychb
Copy link

krzychb commented Dec 15, 2021

Hi,

Is it possible to change the order of how tabs and the corresponding content appear in PDF?

Tab 1
Content of tab 1
Tab 2
Content of Tab 2

Now we see first all the tabs and then all the content so the reader will likely be confused about what content is for what tab.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants