Comments (11)
Resolved by 0b7cd88
from asciidoctor-latex.
Thank you!
from asciidoctor-latex.
I updated the gem to account for #44. Please let me know if you
encounter any problems with #44. The project as a whole needs
quite a bit of work.
Jim
On Jun 27, 2016, at 9:47 PM, Yacine Hmito [email protected] wrote:
Thank you!
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub #44 (comment), or mute the thread https://github.com/notifications/unsubscribe/AApgNzKGbVgUJ_gY0swxNvRHjoiq1g9Lks5qQCi2gaJpZM4I_U-K.
from asciidoctor-latex.
When using macros.tex
I now encounter the following error:
asciidoctor: ERROR: test.adoc: line 1: only book doctypes can contain level 0 sections
This does not happen if there are no macros.tex
file.
This happens regardless of the backend used.
This happens even when macros.tex
is empty.
However this does not prevent the document from being properly processed.
from asciidoctor-latex.
I think I found out why this happens.
The module lib/asciidoctor/latex/macro_insert.rb
prepends a passthrough block to the document.
But this block appears before the title, hence the error.
This is without grave consequences for the HTML backend but it adds junks to the .tex
file with the latex backend.
from asciidoctor-latex.
Final words: By inspecting the commit 0b7cd88, I concluded that I missed the actually bug because of the omission of the undocumented include_macros
attribute.
By using it, it would have indeed added the div
to the HTML backend, and only the HTML backend.
Two problems would be remaining:
. Macros would be included in the tex
file regardless of the include_macros
attribute
. The innocent error message above would be printed when using the HTML backend
This is of course what would have happened if I used include_macros
with a version prior to the 0b7cd88 commit.
In light of this, I think the final fix would be to directly inject the div
into the HTML tree in place of the MacroInsert
processor. I don't know if or how this is feasible though. I'll be happy to hack a solution if I ever find time to dig into it.
from asciidoctor-latex.
Very good analysis! I think your proposal is the right one. This probably requires a tree processor -- something I have not used yet. If you find a solution, please let me know. In the meantime, I will look into it also.
from asciidoctor-latex.
I'm going to try a different strategy by introducing a block macro that works like this:
include_latex::macros.tex[]
with the general form
include_latex::PATH_TO_MACRO_FILE[]
I should have this ready shortly. If it works, I will remove the automatic inclusion of macros.tex
from asciidoctor-latex.
I've made the following changes:
(1) Eliminate automatic inclusion of macros.tex
if it is present.
(2) Introduce the block macro include_latex_macros::LATEX_FILE
, where LATEX_FILE is
typically a LaTeX style or macro file, or a path thereto. For the HTML backend, the file is included
in the source text as \( FILE CONTENTS \)
. For the tex backend it is included as-is.
If you find that this change works for you, you can close this issue. I very much appreciate your contributions to this project!
from asciidoctor-latex.
Thank you, this makes me feel very welcome.
I like the solution as it can also serve a wider range of use-cases.
From the quick tests I did, this seems to work, although there still are some irrelevant warnings. I'll give you more details when I'll find how to use the development version on my main computer (I have some trouble with gem paths unrelated to asciidoctor-latex). I expect this to be solved in less than 24 hours. I'll close the issue if it is not done before.
from asciidoctor-latex.
This works like a charm!
Note that, because macros are inserted in the text, you cannot use this new feature as a drop-in replacement for the macros.tex
inclusion. Indeed macros were previously added in the preamble, which allowed the use of "preamble-only" macros (such as \DeclareMathOperator
).
This is not a problem though. Such macros can be included with preamble.tex
for the latex backend and docinfo.html
for the html backend (macros included in the header work, at least on recent versions of Chromium).
from asciidoctor-latex.
Related Issues (20)
- Proposal to promote project to asciidoctor-latex-plus HOT 9
- dollar signs in source blocks HOT 2
- Equation number in LaTeX example does not produce expected result HOT 1
- Enhancement: Support for LaTeX tables
- Multiple math mode glitches HOT 3
- Negative line number reported in output messages
- Inline stem not quoted in the latex backend HOT 1
- Missing backslash escapes in generated .tex source HOT 1
- Latex conversion of tables with "asciidoctor" style columns fails. Table captions missing too.
- Experimental macros left out HOT 1
- Fix, potentially, for fontspec/pdflatex problem
- asterisk lists aren't converted to lists
- `method_missing': undefined method `convert_environment' HOT 3
- Image captions are not getting generated with `asciidoctor-latex` HOT 4
- asciidoctor-bibtex not working with current version HOT 1
- Multiple errors and dysfunctional .tex file HOT 1
- Non escaped underscore in constrained quotes
- Does Not Handle @ In Emails Correctly HOT 1
- % sign is transcribed as is, causing it to comment rest of line
- Issue with labels in Asciidioc to LaTeX HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from asciidoctor-latex.