Comments (17)
I needed to apply the following diff in order to get make
to work:
diff --git a/main.tex b/main.tex
index a65621d..a02003b 100644
--- a/main.tex
+++ b/main.tex
@@ -1,5 +1,7 @@
% documentclass and similar are handled by pandoc in the Makefile.
+\newcommand{\passthrough}[1]{\lstset{mathescape=false}#1\lstset{mathescape=true}}
+
\begin{document}
% Cover matter is handled by pandoc in the Makefile.
from ebook.
Hi @wizofe. I was getting the same issue under windows. I am using Pandoc 2.1.1 and MiKTeK 2.9.6520 x64 with a custom build script - essentially batch file that creates the PDF and epub
I managed to trace my problem to this file - lines 670-672
41_advanced_unit_testing.md
For some odd reason the emitted latex code does not parse very well and i'm not an expert in latex commands. I changed it to the following, which is probably not the best solution, but it generates the PDF without issues.
from ebook.
Hi, @wizofe. Could you post your full updated Makefile
recipe for the pdf
target, and not just a couple lines? On first glance, it seems like the line continuation \
at the end of your --pdf-engine
line is missing.
As for the fatal: your current branch 'master' does not have any commits yet
error, how are you cloning the repository?
from ebook.
Hi @timparenti! Thanks for your answer ⌨️My Makefile paste follows. As for the git fatal, I git forked & cloned the repo on my account.
TITLE=A Friendly Introduction\\\\to Software Testing
AUTHOR=Bill Laboon
DEDICATION=for AKS and CKN
# If pandoc or xelatex are not in your PATH, specify their locations here:
PANDOC= pandoc
XELATEX= xelatex
MD_FILES= $(wildcard text/*.md)
pdf: main.tex tex_files
# Uses date of most recent commit in repo
$(PANDOC) main.tex -o software-testing-laboon-ebook.pdf \
--pdf-engine $(XELATEX) \
--top-level-division=chapter -N --toc --toc-depth=2 \
-M documentclass="book" \
-M classoption="twoside" \
-M classoption="letterpaper" \
-M geometry="margin=1.25in" \
-M title="\Huge{\textbf{${TITLE}}}" \
-M author="\LARGE{${AUTHOR}}" \
-M date="{\Large\textcopyright~\textbf{$(shell git log -1 --date=iso --format='%ai' | cut -c-10 )}}\\\\Compiled in PDF\LaTeX{}\endgraf\textit{${DEDICATION}}"
tex_files: compiled_tex/ $(patsubst text/%.md,compiled_tex/%.tex,$(MD_FILES))
compiled_tex/:
mkdir -p compiled_tex/
compiled_tex/%.tex: text/%.md
$(PANDOC) text/$*.md \
--listings --highlight-style kate \
-o compiled_tex/$*.tex
clean:
rm -rf compiled_tex/
# Remove temporary compilation directories, if they still exist
rm -rf tex2pdf*/
.PHONY: pdf tex_files clean
from ebook.
@yonush Any chance you'd be able to provide the (bad) LaTeX code that pandoc
generates for those lines as they appear in this repo? It's possible it's a bug in the upstream project, which has happened here before.
from ebook.
@timparenti This appears to be the bad code generated by Pandoc that breaks.
This is the excerpt from the input.log
from ebook.
Yep, with Pandoc 2.1.1, I get the following in compiled_tex/41_advanced_unit_testing.tex
at lines 1106–1115:
\begin{enumerate}
\def\labelenumi{\arabic{enumi}.}
\tightlist
\item
\passthrough{\lstinline!int j = 7;!}
\item
\passthrough{\lstinline&System.out.println("Bark!");&}
\item
\passthrough{\lstinline!foo--;!}
\end{enumerate}
I finally got around to looking at this more, and grep
ing through the compiled_tex/
files, I see most \lstinline
s use a !
delimiter, but those with !
in them use "
. It seems &
is the third choice if both !
and "
are used, and the "Bark!" line here is the only place that happens in our text.
Ampersands are funny creatures in LaTeX. They generally need to be escaped when you want them to be treated as literal. It seems that something about the dummy \passthrough
command Pandoc introduced recently to help with escaping is not actually expecting these ampersands.
Probably &
should just be removed from the list of characters that can delimit a \lstinline
in Pandoc's LaTeX writer, since it requires special treatment, which was recognized in jgm/pandoc@24acb71 just before 2.1.1 was released. Interestingly, _
should probably meet the same fate, but it's less likely to crop up as an issue since it's currently the sixteenth-choice delimiter.
I've just opened jgm/pandoc#4369 against the upstream project to do this. Thanks for reporting this behavior!
from ebook.
@timparenti Hello, I would like to translate to Spanish but I do not know how. I would like to do it by means of pull request :)
from ebook.
@shadowz10 I would love to see this translated into Spanish! It may make more sense to do this a separate repository, though, instead of as a PR.
from ebook.
@laboon I do translations for utopian.io and they require that it be with PR.
I would love to contribute with translations into Spanish by doing PR.
from ebook.
@laboon If you want, I could set up a repository so I can work making a
PR. thanks
from ebook.
@laboon @wizofe Just a note that jgm/pandoc#4369 was merged upstream on 26 April 2018 and released in pandoc 2.2 on 27 April 2018.
I just re-ran this with a fresh upgrade to pandoc 2.2.1 via Homebrew (with the updated Makefile parameters for pandoc 2.x in #144), and it now compiles cleanly, so this one can probably be closed now.
from ebook.
@wizofe if this works for you, let me know and I can close it up.
from ebook.
What is your latex version? I update my pandoc to 2.2.1, but still
! Undefined control sequence.
<recently read> \passthrough
it seems that latex lstlistings did not contain this command.
from ebook.
The above error still persists for me too. I am using the latest build of Pandoc 2.2.1 and recently updated MikTex.
from ebook.
I just download texlive 2018, still
from ebook.
I need renewcommand passthrough, I had solved, ref https://stackoverflow.com/questions/50854429/bookdown-undefined-control-sequence-recently-read-passthrough
from ebook.
Related Issues (20)
- possible bug in example code p. 27 HOT 4
- Failed Make HOT 2
- Typo in chapter 2.4 in the provided pdf HOT 1
- Typo on page 24
- Complex numbers HOT 2
- Potential capitalization Issue HOT 2
- Missing word "to" at the end of Test Plans chapter HOT 1
- Repeated word/grammatical error
- Incomplete Sentence HOT 1
- Code Example Not Formatted HOT 2
- 29_test_plan workthrough boundary values HOT 1
- 29_test_plan Choosing input values section HOT 1
- Title page not parsing TeX HOT 2
- Inline code not being displayed HOT 1
- Typos: Chapter 18 - Stochastic Testing
- pandoc: unrecognized option `--pdf-engine' HOT 2
- failed make - "Missing number, treated as zero." HOT 1
- Unable to Compile PDF: "make: Nothing to be done for 'ebook-master'." HOT 1
- Please add a LICENSE so that we know what we are allowed to do with the book source. HOT 2
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 ebook.